248
UART
M
i
t
s
u
M
S
b
i
s
3
M
h
0
I
C
i
m
2
R
i
1
O
c
r
8
C
o
c
o
G
M
m
p
r
P
u
t
u
T
e
r
p
R
s
o
U
S
I
N
G
L
E
-
C
H
I
P
1
6
-
B
I
T
C
M
O
O
E
(4) How to deal with an error
When receiving data, read an error flag and reception data simultaneously to determine which error
has occurred. If the data read is erroneous, initialize the error flag and the UARTi receive buffer
register, then receive the data again.
To initialize the UARTi receive buffer register
1. Set the receive enable bit to “0” (disable reception).
2. Set the receive enable bit to “1” again (enable reception).
To transmit data again due to an error on the reception side, set the UARTi transmit buffer register
again, then transmit the data again.
To set the UARTi transmit buffer register again
1. Set the serial I/O mode select bits to “000
2
” (invalidate serial I/O).
2. Set the serial I/O mode select bits again.
3. Set the transmit enable bit to “1” (enable transmission), then set transmission data in the UARTi
transmit buffer register.
(5) Functions selection
In operating UART, the following functions can be used:
(a) CTS/RTS function
CTS function is a function in which an external IC can start transmission/reception by means of
inputting an “L” level to the CTS pin. The CTS pin input level is detected when transmission/reception
starts, so if the level is gone to“ H” while transmission/reception is in progress, transmission/recep-
RTS function is a function to inform an external IC that RTS pin output level has changed to “L” when
reception is ready. RTS regoes to “H” at the falling edge of the transfer clock.
When using clock-asynchronous serial I/O, choose one of three types of CTS/RTS functions.
CTS/RTS functions disabled
CTS/RTS pin is a programmable I/O port.
CTS function only enabled
CTS/RTS pin performs the CTS function.
RTS function only enabled
CTS/RTS pin performs the RTS function.
(b) Sleep mode
Sleep mode is a mode in which data is transferred to a particular microcomputer among those con-
nected by use of clock-asynchronous serial I/O devices.
(c) Data logic select function
This function is to reserve data when writing to transmit buffer register or reading from receive buffer
register.
The following are examples in which functions (a) to (c) are chosen:
Transmission WITH: CTS function, WITHOUT: other functions............................................... P254
Reception WITH: RTS function, WITHOUT: other functions .................................................... P258