
R8C/3GM Group
21. Serial Interface (UART0)
R01UH0284EJ0100 Rev.1.00
Aug 09, 2011
21.4
Clock Asynchronous Serial I/O (UART) Mode
The UART mode allows data transmission and reception after setting the desired bit rate and transfer data format.
Notes:
1. If an overrun error occurs, the receive data (b0 to b8) in the U0RB register will be undefined.
2. The framing error flag and the parity error flag are set to 1 when data is transferred from the UART0
receive register to the U0RB register.
Table 21.5
UART Mode Specifications
Item
Specification
Transfer data formats
Character bits (transfer data): Selectable among 7, 8 or 9 bits
Start bit: 1 bit
Parity bit: Selectable among odd, even, or none
Stop bits: Selectable among 1 or 2 bits
Transfer clocks
The CKDIR bit in the U0MR register is set to 0 (internal clock): fj/(16(n+1))
fj = f1, f8, f32, fC n = setting value in the U0BRG register: 00h to FFh
The CKDIR bit is set to 1 (external clock): fEXT/(16(n+1))
fEXT: Input from the CLK0 pin,
n = setting value in the U0BRG register: 00h to FFh
Transmit start conditions
To start transmission, the following requirements must be met:
- The TE bit in the U0C1 register is set to 1 (transmission enabled).
- The TI bit in the U0C1 register is set to 0 (data present in the U0TB
register).
Receive start conditions
To start reception, the following requirements must be met:
- The RE bit in the U0C1 register is set to 1 (reception enabled).
- Start bit detection
Interrupt request
generation timing
For transmission: One of the following can be selected.
- The U0IRS bit is set to 0 (transmit buffer empty):
When data is transferred from the U0TB register to the UART0 transmit
register (at start of transmission).
- The U0IRS bit is set to 1 (transfer completed):
When data transmission from the UART0 transmit register is completed.
For reception:
When data is transferred from the UART0 receive register to the U0RB
register (at completion of reception).
Error detection
This error occurs if the serial interface starts receiving the next unit of data
before reading the U0RB register and receive the bit one before the last
stop bit of the next unit of data.
Framing error
This error occurs when the set number of stop bits is not detected.
(2) Parity error
This error occurs when parity is enabled, and the number of 1’s in the
parity and character bits do not match the set number of 1’s.
(2) Error sum flag
This flag is set to 1 if an overrun, framing, or parity error occurs.