Low-speed serial transceivers are some of the simplest components that can be used in an embedded system. Many components will integrate a serial interface, such as UART, USART, SPI, I2C, or CAN to implement chip-to-chip communication or chip-to-user communication. These protocols use a small number of signals, simple signaling format, and are easily converted to other protocols with interface converter chips, in firmware, in software, or by terminal applications on a computer.
The universal asynchronous receiver transmitter (UART) protocol is one of the simplest 2-wire protocols that can be used in an embedded system. You’ll often see this broken out on a development board so that a user can interface with a laptop and provide configuration commands for a chip. There is a variant of this protocol, known as universal synchronous-asynchronous receiver transmitter (USART). How are these different and what is their level of compatibility?
USART vs. UART Explained
MCUs will include standardized serial protocols in addition to a set of GPIOs and some special feature pins. UART is most likely to make an appearance in general-purpose microcontrollers with moderate pin counts. It is primarily used for communication between specific chips, as well as between a chip and the user through a computer. For configuration purposes or to query the state of the device, the easiest way to do this with a modern computer is through a USB-to-UART interface bridge that plugs into a USB port. These can be purchased for under $10 on Amazon, Alibaba, Digi-Key, Sparkfun, eBay, and many other online merchants.
In very small MCUs, like the ATTiny series, you won’t see this protocol and you’ll only see something like I2C and possibly a few configuration pins tied to power/ground to set the device functionality. As the pin count moves up, you will tend to see UART, more GPIOs, and something faster like SPI or USB implemented in these components.
The main difference between these protocols is the presence of the clock pin (XCK) and the direction pin (XDIR) both being present in USART. The data rate is generated internally by the transmitter through an internal clock, which is then transmitted along with the data stream over a dedicated wire. This enables faster data rates than would be possible in UART.
Where USART is Used
USART connections were originally common in desktop computers and would be implemented in the serial port. Later, USB became the standard interface used for serial communication, and so modern desktops and laptops no longer include serial ports. In the past, the serial port would be provided over a D-sub connector (DB9) on the back side of the computer as shown below.
PC serial ports were formerly used to implement USART.
Although USART fell out of favor with laptops and desktops, many industrial control systems still use USART over these connectors. Shielded DB9 connectors are still used for this purpose, although the connection could also be made over an M-type connector when more rugged connectivity is needed. Equipment such as PLCs, HVAC, networking equipment, robotic processing equipment, and small IIoT devices could all be accessed over UART or USART.
Running USART as UART
Finally, UART communication can be implemented in a USART interface. This is why it is common to see a USART connection in a larger microcontroller, but not a UART connection; it is because UART is being implemented over the USART interface.
In terms of what happens in the firmware, this type of function may be integrated into the device libraries and will be configured with a static variable in one of the header (.h) files. As long as the peripheral’s required baud rate is known ahead of time, then a transmitter with a USART interface could implement UART. The transmitter simply needs to form the same messaging format used in a standard UART message.
Once configured in asynchronous mode, the transmitting device will not send a clock or direction signal along with the data stream. In terms of what happens in the hardware, the two are compatible at the register level, the only difference is in the timing as mentioned above. Rx and Tx lines would still be used for communication between the peripheral and the host.
You can design embedded systems with UART and USART protocols when you use the best set of PCB design features in OrCAD from Cadence. OrCAD is the industry’s best PCB design and analysis software with utilities covering schematic capture, PCB layout and routing, and manufacturing. OrCAD users can access a complete set of schematic capture features, mixed-signal simulations in PSpice, and powerful CAD features, and much more.