Professional Documents
Culture Documents
Uart
Uart
Jin-Fu Li
Introduction
• UART (modem)
Universal asynchronous receiver and transmitter
• Data format
Stop Parity Data Data Data Data Data Data Data Data Start
Bit Bit Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Bit
Rcv datareg
Receiver
controller
Clock
Sys clock To host processor
Generator
Data reg
Byte ready Transmitter
T byte controller
1
1 Serial out
XMT shfteg
Byte ready: asserted by the host processor to indicate that data bus has valid data
Load XMT Datareg: asserting transfers data bus to the transmitter data storage
register, XMT datareg
T byte: asserting initiates transmission of a byte of data, along with the stop, start,
and parity bits
Bit count: counts bits in the word during transmission
State : state of the transmitter controller state machine
Load XMT shtreg: asserting loads the contents of XMT datareg into XMT shtreg
Start: signals the start of transmission
Shift: directs XMT shtreg to shift by one bit toward the LSB and backfill with stop bit (1)
Clear : clears bit counter
Next state: the next state of the state machine controlling the data path of the transmitter
National Central University EE613 VLSI Design 4
FSM State Diagram of Transmitter
Byte ready==0
Idle
T byte==0
waiting Start=0
sending Shift=1
Read not ready in: signals that the host is not ready to receive data
Sample counter: counts the samples of a bit
Bit counter: counts the bits that have been sampled
State: state of the state machine controlling the data path of the receiver
Clr sample counter: clear sample counter
Clr bit counter: clear bit counter
Shift: causes RCV shftreg to shift towards the LSB
Load: causes RCV shftreg to transfer data to RCV datareg
Error1: asserted if host is not ready to receive data after last bit has been sampled
Error2: asserts if the stop-bit is missing
Next state: next state of the state machine controlling the data path of the receiver
National Central University EE613 VLSI Design 6
FSM State Diagram of Receiver
Serial in==1
Idle