GD32F20x User Manual
501
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 19-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
Comparing to the time 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 count 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 protocol
minus 12. The TC status is forced reset while the guard time counter is counting up. When
the counter reaches the programmed value, TC is asserted high.
During USART transmission, if a parity error event is detected, the smartcard may NACK the
current frame by pulling down the TX pin during the last 1 bit time of the stop bits. The USART
can automatically resend data according to the protocol by SCRTNUM times. An interframe
gap of 2.5 bits time will be inserted before the start of a resented frame. At the end of the last
repeated character the TC bit is set immediately without gardtime. The USART will stop
transmitting and assert the framing error status if it still receives the NACK signal after the
programmed number of retries. The USART will not take the NACK signal as the start bit.
During USART reception, if the parity error is detected in the current frame, the TX pin is
pulled low during the last 1 bit time of the stop bits. This signal is the NACK signal to smart
card. Then a frame error occurs in smart card side. The RBNE/receive DMA request is not
activated if the received character is erroneous. According to the protocol, the smart card can
resend the data. The USART stops transmitting the NACK and signals the error as a parity
error if the received character is still erroneous after the maximum number of retries specified
in the SCRTNUM bit field. The NACK signal is enabled by setting the NKEN bit in
USART_CTL2.
The idle frame and break frame are not applied for the Smartcard mode.
Block (T=1) mode
In block (T=1) mode, the NKEN bit in the USART_CTL2 register should be cleared to
Summary of Contents for GD32F20 Series
Page 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Page 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Page 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Page 385: ...GD32F20x User Manual 385 ...
Page 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...