LCD Type MCU
USR Register
The USR register is the status register for the UART, which can be read by the program to deter-
mine the present status of the UART. All flags within the USR register are read only.
b 7
P E R R
N F
F E R R
O E R R
R ID L E
R X IF
T ID L E
b 0
T X IF
U S R
R e g is te r
T r a n s m it D a ta R e g is te r E m p ty
1 : c h a r a c te r tr a n s fe r r e d to tr a n s m it s h ift r e g is te r
0 : c h a r a c te r n o t tr a n s fe r r e d to tr a n s m it s h ift r e g is te r
T r a n s m is s io n Id le
1 : n o tr a n s m is s io n in p r o g r e s s
0 : tr a n s m is s io n in p r o g r e s s
R e c e iv e R X R R e g is te r S ta tu s
1 : R X R r e g is te r h a s a v a ila b le d a ta
0 : R X R r e g is te r is e m p ty
R e c e iv e r S ta tu s
1 : r e c e iv e r is id le
0 : d a ta b e in g r e c e iv e d
O v e rru n E rro r
1 : o v e rru n e rro r d e te c te d
0 : n o o v e rru n e rro r d e te c te d
F r a m in g E r r o r F la g
1 : fr a m in g e r r o r d e te c te d
0 : n o fr a m in g e r r o r
N o is e F la g
1 : n o is e d e te c te d
0 : n o n o is e d e te c te d
P a r ity E r r o r F la g
1 : p a r ity e r r o r d e te c te d
0 : n o p a r ity e r r o r d e te c te d
Further explanation on each of the flags is given below:
·
TXIF
The TXIFflag is the transmit data register empty flag. When this read-only flag is
²0²,
it indicates
that the character is not transferred to the transmit shift registers. When the flag is
²1²,
it indi-
cates that the transmit shift register has received a character from the TXR data register. The
TXIF flag is cleared by reading the UART status register (USR) with TXIF set and then writing to
the TXR data register. Note that when the TXEN bit is set, the TXIF flag bit will also be set since
the transmit buffer is not yet full.
·
TIDLE
The TIDLE flag is known as the transmission complete flag. When this read-only flag is
²0²,
it in-
dicates that a transmission is in progress. This flag will be set to
²1²
when the TXIF flag is
²1²
and when there is no transmit data, or break character being transmitted. When TIDLE is
²1²,
the TX pin becomes idle. The TIDLE flag is cleared by reading the USR register with TIDLE set
and then writing to the TXR register. The flag is not generated when a data character, or a break
is queued and ready to be sent.
86
Home Index Bookmark Pages Text
Previous Next
Pages: Home Index