UART and USART Appendix#
This appendix provides a reference for the Universal Asynchronous Receiver/Transmitter (UART) and Universal Synchronous/Asynchronous Receiver/Transmitter (USART) peripherals.
It defines key terms, lists acronyms, includes example links, and answers frequently asked questions about UART/USART operation on the SiWx917 platform.
Glossary#
The glossary defines important terms used in UART/USART communication.
Universal Asynchronous Receiver/Transmitter (UART):
An asynchronous serial communication interface supporting 5-, 6-, 7-, and 8-bit character encoding, parity, stop bits, and automatic flow control using Request to Send (RTS) and Clear to Send (CTS).Universal Synchronous/Asynchronous Receiver/Transmitter (USART):
A flexible serial communication interface that supports both synchronous (full/half-duplex) and asynchronous modes with 5–8-bit encoding and high baud rates.Baud Rate:
The number of signal transitions per second in serial communication. Programmable up to 921,600 bps (UART) and 20 Mbps (USART).Flow Control:
Hardware-based handshaking (RTS/CTS) that prevents buffer overflow. Automatic flow control is available in the High-Performance (HP) UART.Direct Memory Access (DMA):
A high-speed transfer mechanism that moves data between memory and peripherals without CPU intervention. Supported in HP and Ultra-Low-Power (ULP) UART instances.First In, First Out (FIFO):
A temporary data buffer that maintains transmission order with programmable thresholds (maximum depth: 16 bytes).Half Duplex:
Bidirectional communication where transmission and reception occur alternately (used in USART synchronous mode).Full Duplex:
Simultaneous bidirectional communication supported in both UART and USART.RS485:
A multidrop differential serial protocol supporting half-duplex (RS485) and full-duplex (RS422) operation.Driver Enable (DE):
A control signal used to enable the RS485 driver during transmission.Receiver Enable (~RE):
A control signal used to enable the RS485 receiver during reception.9-bit Addressing:
Used in multi-device setups. The primary sends an address byte; only the addressed secondary device responds.
Acronyms#
Acronym | Description |
|---|---|
ISR | Interrupt Service Routine |
FIFO | First In, First Out |
LSB | Least Significant Bit |
MSB | Most Significant Bit |
RTS | Request to Send |
CTS | Clear to Send |
TAR | Transmit Address Register |
RAR | Receive Address Register |
THR | Transmit Holding Register |
RBR | Receive Buffer Register |
FCR | FIFO Control Register |
LCR | Line Control Register |
MCR | Modem Control Register |
LSR | Line Status Register |
IER | Interrupt Enable Register |
IIR | Interrupt Identification Register |
Extended Examples#
These links provide example implementations demonstrating UART and USART functionality in the WiSeConnect SDK.
UART Example: sl_si91x_uart
ULP UART Example: sl_si91x_ulp_uart
USART Asynchronous Example: sl_si91x_usart_async
USART Synchronous (Primary) Example: sl_si91x_usart_sync_master
USART Synchronous (Secondary) Example: sl_si91x_usart_sync_slave
UART RS485 Example: sl_si91x_uart_rs485
Frequently Asked Questions (FAQ)#
This section answers common questions about UART and USART configuration and use.
Q: How do I select the correct baud rate for my application?
A: Choose a baud rate supported by both the SiWx917 and the connected device. Common values include 9600 and 115200. Make sure both ends are configured identically.
Q: What is the difference between UART and USART?
A: UART supports only asynchronous communication. USART supports both synchronous and asynchronous communication.
Q: How can I enable hardware flow control?
A: Set the flow_control parameter to SL_USART_FLOW_CONTROL_RTS_CTS in the configuration structure and connect the RTS and CTS pins appropriately.
Q: How do I handle errors such as framing or parity errors?
A: Error events are delivered to your callback function. Handle these events by checking the status flags and implementing error-handling logic in the callback.
Q: Can I use Direct Memory Access (DMA) for UART transfers?
A: Yes. The SiWx917 UART and USART drivers support DMA for efficient data movement.