![](http://datasheet.mmic.net.cn/280000/M38B40EDH-XXXXFP_datasheet_16089353/M38B40EDH-XXXXFP_38.png)
38
38B4 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
MITSUBISHI MICROCOMPUTERS
(2) Asynchronous serial I/O (UART) mode
The asynchronous serial I/O (UART) mode can be selected by clear-
ing the serial I/O2 mode selection bit (b6) of the serial I/O2 control
register (address 001D
16
) to “0”. Eight serial data transfer formats
can be selected and the transfer formats used by the transmitter
and receiver must be identical.
The transmit and receive shift registers each have a buffer (the two
buffers have the same address in memory). Since the shift register
cannot be written to or read from directly, transmit data is written to
the transmit buffer, and receive data is read from the receive buffer.
The transmit buffer can also hold the next data to be transmitted,
and the receive buffer can receive 2-byte data continuously.
Fig. 40 Operation of UART serial I/O2 function
Fig. 39 Block diagram of UART serial I/O2
O
r
E
e
P
E F
E
1
/
1
6
1
/
1
6
T
r
e
r
s
a
n
s
s
m
0
i
F
1
t
b
u
f
f
e
r
r
e
g
i
s
t
e
r
C
n
l
o
u
c
s
k
c
o
n
t
r
o
l
c
i
r
c
u
i
t
P
5
6
/
S
C
L
K
2
1
P
5
4
/
R
X
D
P
5
5
/
T
X
D
P
5
7
/
X
I
S
R
D
Y
2
/
S
C
L
K
2
2
“0
”
“1
”
1
/
4
“0
”
“1
”
N
1
/
2
X
C
I
N
“1
”
D
a
t
a
b
u
s
R
e
e
e
c
t
e
i
o
i
v
n
e
b
i
t
u
f
f
e
r
r
e
g
i
s
t
e
r
A
d
d
r
e
s
s
0
0
1
F
1
6
R
e
c
e
i
v
e
s
h
i
f
t
r
e
g
i
s
t
e
r
R
R
e
e
c
c
e
e
i
i
v
v
e
e
b
i
n
u
t
f
e
f
e
r
r
u
f
p
u
l
l
r
f
e
l
a
q
g
u
e
(
R
s
B
(
F
R
)
I
r
t
t
)
B
a
u
d
r
a
t
e
g
e
A
n
d
e
d
r
r
a
e
t
s
o
r
D
i
v
i
s
i
o
n
r
a
t
i
o
1
/
(
n
+
1
)
s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