The design of the UART is based on the method of Figure 9.7 but insteadof both the receiver and transmitter using the same shift pulses, each usesshift pulses obtained from its own clock generator. Both these clock generators must have nominally the same frequency, although in practice they willnot be exactly the same.The format of each byte as transmitted is shown in Figure 9.10. When nottransmitting data, the UART output carries a high logic level, that is, theserial line idles high. To indicate the start of a byte, the line is brought lowso that the data bits are prefaced by a logic 0. After the data bits, the linereturns to the idling level, ready for the start of another byte. The data bitsare said to be framed between a Start bitand a Stop bit.Once the receiver has detected the Start transition from the high to thelow level, it can begin reading the data. The best time to read the incomingdata is in the middle of each bit time; a slight difference between the speedsof the transmitter and receiver clocks will cause the time of reading the datato vary a little about this mid-bit time. This will allow up to a half-bit timedifference before the wrong bit is read. To accommodate this sampling nearthe middle of the bit, the UART receiver clock frequency is such that, typically, 16 clock pulses occur within each bit time. Then, following the highto low transition at the start of a data frame, a counter begins to count thereceiver clock cycles. When this counter reaches eight, the time is very nearlythe middle of the Start bit and the Start bit is read. Subsequently, the receiverreads the incoming signal every 16 receiver clock cycles (that is, near themiddle of each data bit) and shifts the data into the receiver data register.
đang được dịch, vui lòng đợi..