UART
Contents
Background information
This page will cover Universal asynchronous receiver/transmitter (UART) protocol, how it functions, how to communicate with a device over it, and where to find ports that allow access.
UART or Universal asynchronous receiver/transmitter is often used as a low level protocol to communicate with devices, such as HDD controllers, It is asynchronous meaning it does not have a clock(clk) line
therefore relies on an external clock.(this will be covered later in the Baud Rate section)
The UART protocol runs off two data lines plus ground (three in total), these are
2.0 connections
- Transmit(TX)
- Receive(RX)
- Ground(GND)
The lines are typically connected to its opposite(e.g. TX to RX, RX to TX, GND to GND)
3.0 Protocol configuration
There are five main aspects to communicating over UART, with two additional (Break condition, idle state) conditions.
1. Baud Rate
Due to UART being Asynchronous and lacking a clock(clk) signal, A baud rate measured in bits per second(BPS) must be set for data to be transmitted at the same speed by both devices
otherwise data will not be transmitted correctly, Both sides of the communication must be operating at the same speed otherwise communication will not be successful.
The most commonly used bod rates are, 9600,19200,38400,57600,115200.
2. Data bits
As the name suggests data bits is the size of the data packets that are being sent with the most common size being 8 data bits per package however other sizes are possible.
Logically, the bigger the data bits the more data they can carry but the slower the transfer rate due to the increased size.
3. Parity
Parity also known as error checking is an optional (typically not used) but useful bit within the communication packet as it can aid in the detection of packet corruption
Note the use of the word aid as like most systems it is not perfect, so data corruption may still occur.
- None- nothing used
- Even - parity bit is set to make all the 1's even
- odd - parity bit is set to make all the 1's odd
4. Stop Bits
Stop bits denote the end of each packet, which allows for the receiver to recognize the end of each packet then the start of a new one. Typically the stop bits are only one bit but can also be two 5. Flow Control
Flow control is responsible for making sure the data transfer speeds are kept consistent, regardless of the fact one device maybe faster than the other.
- None - no control
- Hardware - The use of two additional pins Request To Send(RTS), Clear To Send(CTS) to indicate when a device requires more data or is ready for more data.
- Software - uses special charters(XON to resume, XOFF to pause) which are placed within the data for the other device to register
- UART to USB adapter
- jumper wires
- serial terminal
- Multimeter
- Soldering iron
- baud rate detection tool
- Reference 1: UART basic's guide
- Reference 2: UART specification
6. Break condition A Break condition is similar to a time-out, if an extended period of low voltage(e.g. no activity/break) occurs then a break condition is applied, can be used as a control signal
7. Idle state Idle state defines how the lines appear when there is no data being transmitted (typically a high voltage)
What tools you will need
Items are not listed in any particular orderRequired
Optional but useful
Step-by-step guide with images
Insert step-by-step walkthrough with images and summary text here
Flow chart of order of operations
Insert a flow chart of steps and actions for each task (create using diagram)
Troubleshooting/tips and tricks
Fixes to any common issues that were encountered or could be easily encountered
different configuration settings can be tried without damage to the devices
Related Topics
Topics such as desoldering to chip off or firmware dumping for disk PCB repairs
Further reading
External references in wiki references can just be cited through the keyword link