286
CHAPTER 8 APPLICATIONS OF SERIAL INTERFACE
8.5 Interface in Asynchronous Serial Interface (UART) Mode
Serial interface channel 2 has two modes: asynchronous serial interface (hereafter referred to as “UART”) and
3-wire serial I/O modes.
Serial interface channel 2 is set by the following registgers:
Serial operating mode register 2 (CSIM2)
Asynchronous serial interface mode register (ASIM)
Asynchronous serial interface status register (ASIS)
Baud rate generator control register (BRGC)
Oscillation mode select register (OSMS)
UART using serial interface channel 2 is briefly described below.
The UART mode of serial interface channel 2 is to transmit or receive 1-byte data following a start bit and can
perform full-duplex operation.
The operations of UART communication are described below.
(a) Communication format
One data frame of transmit/receive data consists of a start bit, character bits, parity bit, and stop bit. The
character bit length, parity, and stop bit length in one data frame are specified by using the asynchronous serial
interface mode register (ASIM).
(b) Setting of baud rate
A UART dedicated baud rate generator is provided that can set a wide range of baud rates. A baud rate can
also be defined by dividing the clock input to the ASCK pin.
The transmit/receive clock for the band rate is generated by dividing the main system clock. The baud rate
generated from the main system clock can be calculated by the following expression. Table 8-10 shows the
relations between the main system clock and baud rate (at fx = 4.19 MHz).
f
[Baud rate] = [Hz]
2
n
×
(k + 16)
Remarks 1.
f
XX
: main system clock frequency (f
X
or f
X
/2)
2.
f
X
: main system clock oscillation frequency
3.
n : value set by TPS0-TPS3
(bits 4-7 of the baud rate generator control register (BRGC) (1
≤
n
≤
11)
4.
k : value set by MDL0-MDL3 (bits 0-3 of BRGC) (0
≤
k
≤
14)