The UART
The UART
After the Start Bit, the individual bits of the word of data are sent, with the
Least Significant Bit (LSB) being sent first. Each bit in the transmission is
transmitted for exactly the same amount of time as all of the other bits, and
the receiver “looks” at the wire at approximately halfway through the period
assigned to each bit to determine if the bit is a 1 or a 0. For example, if it takes
two seconds to send each bit, the receiver will examine the signal to
determine if it is a 1 or a 0 after one second has passed, then it will wait two
seconds and then examine the value of the next bit, and so on.
The sender does not know when the receiver has “looked” at the value of the
bit. The sender only knows when the clock says to begin transmitting the next
bit of the word.
When the entire data word has been sent, the transmitter may add a Parity Bit
that the transmitter generates. The Parity Bit may be used by the receiver to
perform simple error checking. Then at least one Stop Bit is sent by the
transmitter.
When the receiver has received all of the bits in the data word, it may check
for the Parity Bits (both sender and receiver must agree on whether a Parity
Bit is to be used), and then the receiver looks for a Stop Bit. If the Stop Bit does
not appear when it is supposed to, the UART considers the entire word to be
garbled and will report a Framing Error to the host processor when the data
word is read. The usual cause of a Framing Error is that the sender and
receiver clocks were not running at the same speed, or that the signal was
interrupted.
Regardless of whether the data was received correctly or not, the UART
automatically discards the Start, Parity and Stop bits. If the sender and
receiver are configured identically, these bits are not passed to the host.
If another word is ready for transmission, the Start Bit for the new word can
be sent as soon as the Stop Bit for the previous word has been sent.