Introduction: UART vs USART
UART stands for Universal Asynchronous Receiver Transmitter.
USART stands for Universal Synchronous Asynchronous Receiver Transmitter.
They are basically just a piece of hardware that converts parallel data into serial data.
Difference between UART and USART
The only difference between them is that the UART peripheral supports only asynchronous mode, whereas USART supports both synchronous and asynchronous modes.
All modern microcontrollers come with a USART module instead of just a UART module. So that you can use the USART module both in the synchronous mode as well as asynchronous mode. Unlike Ethernet, USB, etc., there is no specific port for USART communication. They are commonly used in conjugation with protocols like RS-232, RS-434, USB, etc.
In synchronous transmission, the clock is sent separately from the data stream, and no start/stop bits are used. This you have already seen in the case of SPI or I2C communication. This improves data transmission efficiency by avoiding the extra bits like start/stop, which are not useful data.
Typically, the USART hardware will have the following components:
- Baud rate generator: It generates the required baud rate for the data communication.
- TX and RX shift registers.
- Transmit/Receive control blocks.
- Transmit/Receive buffers.
- First-in, First-out (FIFO) buffer memory: Having a FIFO is a very powerful feature but at the same time very expensive. If you take the case of STM32F4xx based microcontroller, it doesn’t support any transmit or receive FIFOs.
We can conclude that the USART is just a piece of hardware in your microcontroller that transmits and receives data bits either in synchronous mode or an asynchronous mode. If it is an asynchronous mode, then the clock will not be sent along with the data. Instead, we use synchronization bits like start and stop along with the useful data.
In the following article, let’s Understand the UART pins
FastBit Embedded Brain Academy Courses,
Click here: https://fastbitlab.com/course1