UART (Continued)
UART CONTROL AND STATUS REGISTERS
The operation of the UART is programmed through three
registers: ENU, ENUR and ENUI. The function of the individual bits in these registers is as follows:
ENU-UART Control and Status Register (Address at 0BA)
PEN PSEL1 XBIT9/ CHL1 CHL0 ERR RBFL TBMT
PSEL0
0RW 0RW 0RW 0RW 0RW 0R 0R IR
Bit 7 Bit 0
ENUR-UART Receive Control and Status Register (Address
at 0BB)
DOE FE PE SPARE RBlT9 ATTN XMTG RCVG
0RD 0RD 0RD 0RW* 0R 0RW 0R 0R
Bit 7 Bit 0
ENUI-UART Interrupt and Clock Source Register (Address
at 0BC)
STP2 STP78 ETDX SSEL XRCLK XTCLK ERI ETI
0RW 0RW 0RW 0RW 0RW 0RW 0RW 0RW
Bit 7 Bit 0
* Bit is not used.
0 Bit is cleared on reset.
1 Bit is set to one on reset.
R Bit is read-only; it cannot be written by software.
RW Bit is read/write.
D Bit is cleared on read; when read by software as a
one, it is cleared automatically. Writing to the bit does
not affect its state.
DESCRIPTION OF UART REGISTER BITS
ENUÐUART CONTROL AND STATUS REGISTER
TBMT: This bit is set when the UART transfers a byte of
data from the TBUF register into the TSFT register for transmission. It is automatically reset when software writes into
the TBUF register.
RBFL: This bit is set when the UART has received a complete character and has copied it into the RBUF register. It
is automatically reset when software reads the character
from RBUF.
ERR: This bit is a global UART error flag which gets set if
any or a combination of the errors (DOE, FE, PE) occur.
CHL1, CHL0: These bits select the character frame format.
Parity is not included and is generated/verified by hardware.
CHL1
e
0, CHL0e0 The frame contains eight data bits.
CHL1
e
0, CHL0e1 The frame continues seven data
bits.
CHL1
e
1, CHL0e0 The frame continues nine data bits.
CHL1
e
1, CHL0e1 Loopback Mode selected. Transmit-
ter output internally looped back to
receiver input. Nine bit framing format is used.
XBIT9/PSEL0: Programs the ninth bit for transmission
when the UART is operating with nine data bits per frame.
For seven or eight data bits per frame, this bit in conjunction
with PSEL1 selects parity.
PSEL1, PSEL0: Parity select bits.
PSEL1
e
0, PSEL0e0 Odd Parity (if Parity enabled)
PSEL1e0, PSEL1e1 Odd Parity (if Parity enabled)
PSEL1
e
1, PSEL0e0 Mark(1) (if Parity enabled)
PSEL1e1, PSEL1e1 Space(0) (if Parity enabled)
PEN: This bit enables/disables Parity (7- and 8-bit modes
only).
PEN
e
0 Parity disabled.
PENe1 Parity enabled.
ENURÐUART RECEIVE CONTROL AND STATUS
REGISTER
RCVG: This bit is set high whenever a framing error occurs
and goes low when RDX goes high.
XMTG: This bit is set to indicate that the UART is transmitting. It gets reset at the end of the last frame (end of last
Stop bit).
ATTN: ATTENTION Mode is enabled while this bit is set.
This bit is cleared automatically on receiving a character
with data bit nine set.
RBIT9: Contains the ninth data bit received when the UART
is operating with nine data bits per frame.
SPARE: Reserved for future use.
PE: Flags a Parity Error.
PE
e
0 Indicates no Parity Error has been detected since
the last time the ENUR register was read.
PE
e
1 Indicates the occurrence of a Parity Error.
FE: Flags a Framing Error.
FEe0 Indicates no Framing Error has been detected
since the last time the ENUR register was read.
FE
e
1 Indicates the occurrence of a Framing Error.
DOE: Flags a Data Overrun Error.
DOE
e
0 Indicates no Data Overrun Error has been detect-
ed since the last time the ENUR register was
read.
DOE
e
1 Indicates the occurrence of a Data Overrun Error.
ENUIÐUART INTERRUPT AND CLOCK SOURCE
REGISTER
ETI: This bit enables/disables interrupt from the transmitter
section.
ETI
e
0 Interrupt from the transmitter is disabled.
ETIe1 Interrupt from the transmitter is enabled.
ERI: This bit enables/disables interrupt from the receiver
section.
http://www.national.com23