![](http://datasheet.mmic.net.cn/370000/UPD780076_datasheet_16740795/UPD780076_255.png)
255
CHAPTER 14 SERIAL INTERFACE UART0
User
’
s Manual U14260EJ3V1UD
14.4 Operation of Serial Interface UART0
This section explains the three modes of serial interface UART0.
14.4.1 Operation stop mode
Because serial transfer is not performed in this mode, the power consumption can be reduced.
In addition, pins can be used as ordinary ports. To set the operation stop mode, clear bits 7 and 6 (TXE0 and
RXE0) of ASIM0 to 0.
(1) Register to be used
Operation stop mode is set by asynchronous serial interface mode register 0 (ASIM0).
ASIM0 is set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears ASIM0 to 00H.
Address: FFA0H After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
ASIM0
TXE0
RXE0
PS01
PS00
CL0
SL0
ISRM0
IRDAM0
TXE0
RXE0
Operation mode
RxD0/P23 pin function
TxD0/P24 pin function
0
0
Operation stop
Port function (P23)
Port function (P24)
14.4.2 Asynchronous serial interface (UART) mode
This mode enables full-duplex operation wherein one byte of data after the start bit is transmitted or received.
The on-chip baud rate generator dedicated to UART enables communications using a wide range of selectable
baud rates. The communication range is between 1.2 kbps and 131 kbps (when operated at f
X
= 8.38 MHz). The
baud rate (39 kbps max. (when operated at f
X
= 1.25 MHz)) can be defined by dividing the input clock to the ASCK0
pin.
The UART baud rate generator can also be used to generate a MIDI-standard baud rate (31.25 kbps).
(1) Registers to be used
Asynchronous serial interface mode register 0 (ASIM0)
Asynchronous serial interface status register 0 (ASIS0)
Baud rate generator control register 0 (BRGC0)
Port mode register 2 (PM2)
Port register 2 (P2)
The basic procedure of setting an operation in the UART mode is as follows.
<1> Set the BRGC0 register (see
Figure 14-5
).
<2> Set bits 5 to 1 (PS01, PS00, CL0, SL0, and ISRM0) of the ASIM0 register and clear bit 0 (IRDAM0) to 0
(see
Figure 14-3
).
<3> Set bit 7 (TXE0) of the ASIM0 register to 1.
→
Transmission is enabled.
<4> Set bit 6 (RXE0) of the ASIM0 register to 1.
→
Reception is enabled.
<5> Write data to the TXS0 register.
→
Data transmission is started.
Caution Take relationship with the other party of communication when setting the port mode register
and port register.