UART: Difference between revisions
No edit summary |
No edit summary |
||
| (8 intermediate revisions by the same user not shown) | |||
| Line 118: | Line 118: | ||
</ul> | </ul> | ||
</li> | </li> | ||
<li><a href="#section2"> Step-by-step guide with images</a></li> | <li><a href="#section2"> Step-by-step guide with images</a></li> | ||
<li><a href="#section3"> Flow chart of order of operations</a></li> | <li><a href="#section3"> Flow chart of order of operations</a></li> | ||
| Line 130: | Line 130: | ||
<p>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. | <p>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. | ||
</br> | </br> | ||
UART or Universal asynchronous receiver/transmitter is often used as a low level protocol to | 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 </br> | ||
therefore relies on an external clock.(this will be covered later in the Baud Rate section) | |||
</br> The UART protocol runs off two data lines plus ground(three in total), these are </br> | </br> The UART protocol runs off two data lines plus ground (three in total), these are </br> | ||
<B> 2.0 connections</B> | <B> 2.0 connections</B> | ||
<ul> | <ul> | ||
| Line 143: | Line 143: | ||
<include diagram somewhere> | <include diagram somewhere> | ||
</br> | </br> | ||
<B>3.0 Protocol | <B>3.0 Protocol configuration </B> | ||
</br> | </br> | ||
There are five main aspects to communicating over UART, with two additional (Break condition, idle state) conditions. | There are five main aspects to communicating over UART, with two additional (Break condition, idle state) conditions. | ||
| Line 151: | Line 151: | ||
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 | 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 | ||
</br> | </br> | ||
otherwise data will not be transmitted correctly Both sides of the | 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. | ||
</br> | </br> The most commonly used bod rates are, 9600,19200,38400,57600,115200. | ||
</br> | </br> | ||
<B>2.</B> Data bits | <B>2.</B> Data bits | ||
</br>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. | </br>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. | ||
<br> | <br> | ||
Logically the bigger the data bits the more data they can carry but the slower the transfer rate due to the increased size. | Logically, the bigger the data bits the more data they can carry but the slower the transfer rate due to the increased size. | ||
</br> | </br> | ||
<B>3.</B> Parity | <B>3.</B> Parity | ||
<br> | <br> | ||
Parity also | 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 | ||
</br> | </br> | ||
Note the use of the word aid as like most systems it is not perfect so data corruption may still occur. | Note the use of the word aid as like most systems it is not perfect, so data corruption may still occur. | ||
</br> | </br> | ||
<ul> | <ul> | ||
<li>None</li> | <li>None- nothing used </li> | ||
<li>Even | <li>Even - parity bit is set to make all the 1's even </li> | ||
<li> | <li>odd - parity bit is set to make all the 1's odd </li> | ||
</ul> | |||
</br> | |||
<B>4.</B> Stop Bits</br> | |||
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 | |||
<B>5.</B> Flow Control | |||
</br> | |||
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. | |||
</br> | |||
<ul> | |||
<li>None - no control </li> | |||
<li>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.</li> | |||
<li>Software - uses special charters(XON to resume, XOFF to pause) which are placed within the data for the other device to register</li> | |||
</br> | |||
<B>6.</B> 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 | |||
</br> | |||
<B>7.</B> Idle state | |||
Idle state defines how the lines appear when there is no data being transmitted (typically a high voltage) | |||
</p> | </p> | ||
| Line 186: | Line 202: | ||
<h3 id="required">Required</h3> | <h3 id="required">Required</h3> | ||
<ul> | <ul> | ||
<li> | <li> UART to USB adapter</li> | ||
<li> jumper wires</li> | |||
<li> serial terminal</li> | |||
</ul> | </ul> | ||
</tr> | </tr> | ||
| Line 192: | Line 210: | ||
<h3 id="optional">Optional but useful</h3> | <h3 id="optional">Optional but useful</h3> | ||
<ul> | <ul> | ||
<li> | <li>Multimeter</li> | ||
<li> Soldering iron </li> | |||
<li>baud rate detection tool</li> | |||
</ul> | </ul> | ||
</tr> | </tr> | ||
| Line 198: | Line 218: | ||
</div> | </div> | ||
<h1 id="section2">Step-by-step guide with images</h1> | <h1 id="section2">Step-by-step guide with images</h1> | ||
<p>Insert step-by-step walkthrough with images and summary text here</p> | <p>Insert step-by-step walkthrough with images and summary text here</p> | ||
| Line 211: | Line 227: | ||
<h1 id="section4">Troubleshooting/tips and tricks</h1> | <h1 id="section4">Troubleshooting/tips and tricks</h1> | ||
<p>Fixes to any common issues that were encountered or could be easily encountered</p> | <p>Fixes to any common issues that were encountered or could be easily encountered</p> | ||
<p> different configuration settings can be tried without damage to the devices</p> | |||
<h1 id="section5">Related Topics</h1> | <h1 id="section5">Related Topics</h1> | ||
<p>Topics such as desoldering to chip off or firmware dumping for disk PCB repairs</p> | <p>Topics such as desoldering to chip off or firmware dumping for disk PCB repairs</p> | ||
<ul> | <ul> | ||
<li><a href=" | <li><a href="https://archive.org/details/the-hardware-hacking-handbook">the hardware hacking handbook</a></li> | ||
<li><a href="#">Related Topic 2</a></li> | <li><a href="#">Related Topic 2</a></li> | ||
</ul> | </ul> | ||
Latest revision as of 13:16, 10 March 2025
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