GD32VF103 User Manual
341
16.3.11.
Half-duplex communication mode
The half-duplex communication mode is enabled by setting the HDEN bit in USART_CTL2.
The LMEN, CKEN bits in USART_CTL1 and SCEN, IREN bits in USART_CTL2 should be
cleared in half-duplex communication mode.
In the half-duplex mode the receive line is internally connected to the TX pin, and the RX pin
is no longer used. The TX pin should be configured as output open drain mode. The software
should make sure that the transmission and reception process never conflict with each other.
16.3.12.
Smartcard (ISO7816-3) mode
The smartcard mode is an asynchronous mode, which is designed to support the ISO7816-3
protocol. The smartcard mode is enabled by setting the SCEN bit in USART_CTL2. The
LMEN bit in USART_CTL1 and HDEN, IREN bits in USART_CTL2 should be reset in
smartcard mode.
A clock is provided to the external smart card through the CK pin after the CKEN bit is set.
The clock is divided from the PCLK. The divide ratio is configured by the PSC[4:0] bits in
USART_GP register. The CK pin only provides a clock source to the smartcard.
The smartcard mode is a half-duplex communication protocol. When connected to a
smartcard, the TX pin must be configured as open drain, and an external pull-up resistor will
be needed, which drives a bidirectional line that is also driven by the smartcard. The data
frame consists of 1 start bit, 9 data bits (1 parity bit included) and 1.5 stop bits. The 0.5 stop
bit may be configured for a receiver.
Figure 16-15. ISO7816-3 frame format
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
0.5 bit
1 bit
S
S
ISO 7816-3 frame without parity error
ISO 7816-3 frame with parity error
P
P
Character (T=0) mode
Compared to the timing in normal operation, the transmission time from transmit shift register
to the TX pin is delayed by half baud clock, and the TC flag assertion time is delayed by a
guard time that is configured by the GUAT[7:0] bits in USART_GP. In Smartcard mode, the
internal guard time counter starts counting up after the stop bits of the last data frame, and
the GUAT[7:0] bits should be configured as the character guard time (CGT) in ISO7816-3