Inputs: None (configuration block only)
Outputs: None (configuration block only)
This is a configuration block that sets up UART peripheral parameters. It does not have signal portsโuse UART Tx and UART Rx blocks for data transmission and reception.
| Family | Series | Architecture ID | Notes |
|---|---|---|---|
| dsPIC | 30F, 24F, 33F, 33E, 33C, 33A | 1, 2, 3, 4, 8 | Full support including IrDA on capable devices |
| PIC32 | MK, MZ, MX, PIC32A | Included in dsPIC arch | Standard UART functionality |
| SAM | E7x, E5x, D5x, C2x, D2x | 5, 6, 7 | USART peripheral (SAMx callback variants) |
| Parameter | Description |
|---|---|
| UART Module | Select UART/USART number (1 to N, depending on device) |
Number of available UARTs detected automatically from selected chip.
| Parameter | Options | Description |
|---|---|---|
| Baud Rate Selection | Popup list or Custom | Choose from standard rates (110 to 12M baud) or enter custom value |
| Standard Rates | 110, 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, … | Up to 12000000 baud on capable devices |
| Custom Baud | User-defined | Enter any baud rate value (validated against FCY) |
| Init Sequence Baud | Same options | Optional different baud rate for initialization sequence |
| Mode | Description | Availability |
|---|---|---|
| Full Duplex | Default mode - independent Tx and Rx | All devices |
| Half Duplex | One-wire Rx-Tx (shared pin) | All devices |
| IrDA Mode | Infrared communication (requires IrDA encoder/decoder) | Only on devices with UxMODE bit 12 |
| Mode | Description | Use Case |
|---|---|---|
| Do not implement Tx | No transmit capability | Receive-only applications |
| Simplest | 1, 4, or 8 byte internal buffer (device dependent) | Low data rate, minimal overhead |
| Circular Buffer | Software circular buffer with interrupt | Moderate data rate, reliable |
| DMA Ping-Pong | Two DMA buffers alternating | High throughput, no data loss |
| DMA Circular Buffer | DMA with circular buffer | Continuous streaming |
| DMA Single Buffer | Single DMA buffer (possible data loss) | High speed, can tolerate data loss |
| Mode | Description | Use Case |
|---|---|---|
| Do not implement Rx | No receive capability | Transmit-only applications |
| Simplest | 1, 4, or 8 byte internal buffer | Low data rate polling |
| Circular Buffer | Software circular buffer with interrupt | Reliable reception, moderate rate |
| DMA Ping-Pong | Two DMA buffers alternating | High throughput reception |
| Parameter | Description |
|---|---|
| RX Pin | Receive data pin (remappable on PPS-capable devices) |
| TX Pin | Transmit data pin (remappable on PPS-capable devices) |
| CTS Pin | Clear To Send (hardware flow control, optional) |
| RTS Pin | Request To Send (hardware flow control, optional) |
| DTR Pin | Data Terminal Ready (dsPIC CK/33A only) |
| DSR Pin | Data Set Ready (dsPIC CK/33A only) |
| Parameter | Description |
|---|---|
| Idle Time Control | Insert phantom bytes for idle time on Tx line (dsPIC CK only) |
| Initialization Sequence | Configure different settings at startup |
| External PIL Communication | Enable for Processor-in-the-Loop testing |
**``**``**``**``**``**
| Register | Description | Configured Fields |
|---|---|---|
| U | x | BRG |
| U | x | MODE |
| U | x | STA |
| U | x | BRGH |
| U | x | MODEH |
| U | x | STAH |
SAM devices use USART peripheral with different register structure:
US_CR - Control RegisterUS_MR - Mode RegisterUS_BRGR - Baud Rate GeneratorUS_IER/IDR - Interrupt Enable/DisableAdd UART Config block to model
Configure parameters:
UART Module: 1
Baud Rate: 9600
Duplex Mode: Full duplex
Tx Implementation: Circular Buffer
Rx Implementation: Circular Buffer
RX Pin: Select from dropdown (e.g., RP36/RB4)
TX Pin: Select from dropdown (e.g., RP37/RB5)
Add UART Tx block (same UART number)
Add UART Rx block (same UART number)
Build and deploy
Configure UART Config block:
Baud Rate: 115200
Tx Implementation: DMA Ping-Pong Mode
Rx Implementation: DMA Ping-Pong
Ensure DMA channels are available on selected device
Configure buffer sizes in Tx/Rx blocks
For dsPIC/PIC32 devices:
UxBRG = (FCY / (4 * BaudRate)) - 1 (BRGH = 1) UxBRG = (FCY / (16 * BaudRate)) - 1 (BRGH = 0)
The block automatically selects BRGH mode for best accuracy.
Problem: Desired baud rate cannot be achieved with acceptable error.Solution: Adjust system clock (FCY) or choose a different baud rate that divides evenly.
Problem: Selected pin not available for UART function.Solution: Check device datasheet for UART pin mapping. Ensure PPS is configured correctly on remappable devices.
Problem: DMA mode selected but not functioning.Solution: Verify device has DMA capability. Check DMA channel availability in model (other blocks may use DMA).
[Communication Blocks] | [UART Tx] | [UART Rx] | Code Generation