EM78815
8-Bit Microcontroller
There are three modes in UART. Mode 1 (7 bits data) and Mode 2 (8 bits data) allow
the addition of a parity bit. The parity bit addition is not available in Mode 3. The
Figure below shows the data format in each mode.
1
2
3
4
5
6
7
8
9
10 11
UMODE
PRE
0
7 bits DATA
7 bits DATA
STOP
0
0
START
Mode 1
0
0
1
Parity STOP
STOP
START
8 bits DATA
8 bits DATA
0
0
1
1
0
1
START
START
Mode 2
Mode 3
Parity STOP
9 bits DATA
STOP
1
0
X
START
Fig. 9 UART Mode
In transmitting serial data, the UART operates as follows.
1. Set TXE bit of the UARTCON register to enable the UART transmission function.
2. Write data into the UART data buffer. Then start transmitting.
3. Serial transmit data are transmitted in the following order from UT (Port C7) pin.
(a) Start bit: output one “0” bit
(b) Transmit data: 7, 8 or 9 bits data are output from LSB to MSB
(c) Parity bit: output one parity bit (odd or even selectable)
(d) Stop bit: output one “1” bit (stop bit)
(e) Mark state: output “1” continues until the start bit of the next transmit data
4. After transmitting the stop bit, the UART generates a UART interrupt (if enabled)
5. UTBE bit will be set to 1
In receiving, the UART operates as follows:
1. Set the RXE bit of the UARTCON register to enable the UART receiving function.
The UART monitors the UR (Port C6) pin and synchronizes internally when it
detects a start bit.
2. Receive data is shifted into the UARTRx register in the order from LSB to MSB.
18 •
Product Specification (V2.4) 02.17.2006
(This specification is subject to change without further notice)