
GD32F403xx User Manual
410
width is less than 1 PSC clock. While it can detect a pulse by chance if the pulse width is
greater than 1 but smaller than 2 times PSC clock.
Because the IrDA is a half-duplex protocol, the transmission and the reception should not be
carried out at the same time in the IrDA SIR ENDEC block.
Figure 17-14. IrDA data modulation
Normal
tx frame
Stop
Start
1
0
0
0
0
0
0
1
1
1
1
Stop
Start
1
0
1
1
1
1
0
0
0
0
0
TX pin
Normal rx
frame
RX pin
The SIR sub module can work in low power mode by setting the IRLP bit in USART_CTL2.
The transmit encoder is driven by a low speed clock, which is divided f rom the PCLK. The
division ratio is configured by the PSC[7:0] bits in USART_GP register. The pulse width on
the TX pin is 3 cycles of this low speed period. The receiver decoder works in the same
manner as the normal IrDA mode.
17.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.
17.3.12.
Smartcard (ISO7816-3) mode
The smartcard mode is an asynchronous mode, which is designed to support the ISO7816-3
protocol. Both the character (T=0) mode and the block (T=1) mode are supported. 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 cleared in smartcard mode.
A clock is provided to the external smartcard through the CK pin after the CKEN bit is set.
The clock is divided from the PCLK. The division 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 mode, 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