Clock-Synchronous Serial I/O
Mitsubishi microcomputers
M30201 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
248
2.5.1 Overview
Clock-synchronous serial I/O carries out 8-bit data communications in synchronization with the clock. The
following is an overview of the clock-synchronous serial I/O.
(1) Transmission/reception format
8-bit data
(2) Transfer rate
If the internal clock is selected as the transfer clock, the divide-by-2 frequency, resulting from the bit
rate generator division, becomes the transfer rate. The bit rate generator count source can be se-
lected from the following: f1, f8, f32, and fC. Clocks f1, f8 and f32 are derived by dividing the CPU’s main
clock by 1, 8, and 32 respectively. Clock fC is derived by dividing the CPU’s sub clock by 1 respec-
tively.
Furthermore, if an external clock is selected as the transfer clock, the clock frequency input to the CLK
pin becomes the transfer rate.
(3) Error detection
Only overrun error can be detected. Overrun error is an error that occurs when the next data is made
ready before the reception buffer register is read.
(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 UART0 receive buffer
register, then receive the data again.
To initialize the UART0 receive buffer register
1. Set the receive enable bit to “0” (disable reception).
2. Set the serial I/O mode select bit to “0002” (invalid serial I/O).
3. Set the serial I/O mode select bit.
4. Set the receive enable bit to “1” again (enable reception).
To transmit data again due to an error on the reception side when external clock is selected, clear the
UART0 transmit buffer register, then transmit the data again.
To clear the UART0 transmit buffer register
1. Set the port P52 (CLK0 pin) direction register to “0” (input mode).
2. Set the port P50 (TxD0 pin) direction register to “0” (input mode).
3. Set the internal/external clock select bit to “0” (internal clock).
4. Checking complection of transmission (no data present in transmit register).
5. Set the internal/external clock select bit to “1” (external clock).
6. Set the port P50 (TxD0 pin) direction register to “1” (output mode), then set transmission data in the
UART0 transmit buffer register.
2.5 Clock-Synchronous Serial I/O