![](http://datasheet.mmic.net.cn/30000/M30260M3A-XXXGP-U5_datasheet_2358673/M30260M3A-XXXGP-U5_165.png)
13. Serial I/O
page 151
8
2
3
f
o
5
0
2
,
5
1
.
r
a
M
0
.
1
.
v
e
R
0
1
0
-
2
0
2
0
B
9
0
J
E
R
)
T
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
P
SP
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: 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)
Note: 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
D0
D1
D2
D3
D4
D5
D6
D7
P
SP
ST
SP
ST
D3
D4
D5
D6
D7
P
D0
D1
D2
D0
D1
D2
D3
D4
D5
D6
D7
P
SP
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”