
202
Specifications in this manual are tentative and subject to change
Clock-Asynchronous Serial I/O (UART)
Mitsubishi microcomputers
M30240 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
2.5.1.3 Error detection
In clock-asynchronous serial I/O mode, the errors that can be detected are shown in
Table 2.19 .Table 2.19:
Error detection
2.5.1.4 If an error occurs
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 “0002” (invalid 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
2.5.1.5 Functions selection
In UART operation, the following functions can be used:
(a) CTS/RTS function
The CTS function where 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 has gone to ‘H” while transmission/reception is in progress, transmission/reception stops at the
next data.
The RTS function informs an external IC that the RTS pin output level has changed to “L” when recep-
tion is ready. RTS returns to “H” at the falling edge of the transfer clock.
Type of error
Description
Flag “ON” when
How to clear the flag
Overrun error
This error occurs when the next data is
ready before the content of the UARTi
receive buffer register is read.
The next data is written to the UARTi
receive buffer register.
The UARTi receive interrupt request bit
does not go to “1”.
The error is
detected when
data is transferred
from the UARTi
receive register to
the UARTi receive
buffer register.
Set the serial I/O mode select bits to “0002”.
Set the receive enable bit to “0”.
Framing error
This error occurs when the stop bit falls
short of the set number of stop bits.
Set the serial I/O mode select bits to “0002”.
Set the receive enable bit to “0”.
Read the lower-order byte of the UARTi
receive buffer register
Parity error
With parity enabled, this error occurs
when the total number of 1’s in character
bits and the parity bit is different from the
specified number.
Error-sum flag
This flag turns on when any error
(overrun, framing, or parity) is detected.
When all error (overrun, framing and parity)
are removed, the flag is cleared.