![](http://datasheet.mmic.net.cn/30000/M30263F3AFP_datasheet_2358719/M30263F3AFP_173.png)
13. Serial I/O
page 156
9
2
3
f
o
7
0
2
,
5
1
.
b
e
F
0
.
2
.
v
e
R
0
2
0
-
2
0
2
0
B
9
0
J
E
R
)
T
6
2
/
C
6
1
M
,
B
6
2
/
C
6
1
M
,
A
6
2
/
C
6
1
M
(
p
u
o
r
G
A
6
2
/
C
6
1
M
13.1.2.5. TxD and RxD I/O Polarity Inverse Function (UART2)
This function inverses the polarities of the TXD2 pin output and RXD2 pin input. The logic levels of all
input/output data (including the start, stop and parity bits) are inversed. Figure 13.1.2.5.1 shows the
TXD pin output and RXD pin input polarity inverse.
Figure 13.1.2.5.1. TXD and RXD I/O Polarity Inverse
13.1.2.4. Serial Data Logic Switching Function (UART2)
The data written to the U2TB register has its logic reversed before being transmitted. Similarly, the
received data has its logic reversed when read from the U2RB register. Figure 13.1.2.4.1 shows serial
data logic.
Figure 13.1.2.4.1. Serial Data Logic Switching
Transfer clock
“H”
“L”
D0
D1
D2
D3
D4
D5
D6
D7
PSP
ST
TxD2
(no reverse)
“H”
“L”
TxD2
(reverse)
SP
ST
D3
D4
D5
D6
D7
P
D0
D1
D2
“H”
“L”
(1) When the U2LCH bit in the U2C1 register is set to "0" (no reverse)
(2) When the U2LCH bit in the U2C1 register is set "1" (reverse)
Transfer clock
“H”
“L”
NOTE:
1. This applies to the case where the CKPOL bit in the U2C0 register is set to "0"
(transmit data output at the falling edge of the transfer clock), the UFORM bit in the
U2C0 register is set to "0" (LSB first), the STPS bit in the U2MR register is set to "0"
(1 stop bit) and the PRYE bit in the U2MR register is set to "1" (parity enabled).
ST: Start bit
P: Parity bit
SP: Stop bit
(1) When the IOPOL bit in the U2MR register is set to "0" (no reverse)
(2) When the IOPOL bit in the U2MR register is set to "1" (reverse)
D0
D1
D2
D3
D4
D5
D6
D7
PSP
ST
SP
ST
D3
D4
D5
D6
D7
P
D0
D1
D2
D0
D1
D2
D3
D4
D5
D6
D7
PSP
ST
“H”
SP
ST
D3
D4
D5
D6
D7
P
D0
D1
D2
Transfer clock
TxD2
(no reverse)
RxD2
(no reverse)
Transfer clock
TxD2
(reverse)
RxD2
(reverse)
“L”
“H”
“L”
“H”
“L”
“H”
“L”
“H”
“L”
“H”
“L”
NOTE:
1. This applies to the case where the UFORM bit in the U2C0 register is set to
"0"(LSB first), the STPS bit in the U2MR register is set to "0" (1 stop bit) and the
PRYE bit in the U2MR register is set to "1"(parity enabled).
ST: Start bit
P: Parity bit
SP: Stop bit