Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
478
/
631
Figure 22-21 Break detection and framing error detection in LIN mode
Smartcard mode (ISO7816)
USART supports smart card protocol. The smart card interface supports the asynchronous smart card protocol defined
in the ISO7816-3 standard.
Through the USART_CTRL3.SCMEN bit, you can choose whether to enable smart card mode. When using smart
card mode, USART_CTRL2.LINMEN, USART_CTRL3.HDMEN, USART_CTRL3.IRDAMEN, these bits should
be kept clear.
In smart card mode, the USART can provide a clock through the CK pin. The system clock is divided by the prescaler
register to provide the clock to the smart card. The CK frequency can be from f
CK/
2 to f
CK
/62, where f
CK
is the
peripheral input clock.
In smart card mode, 0.5 and 1.5 stop bits can be used when receiving data, and only 1.5 stop bits can be used when
sending data. So 1.5 stop bits are recommended as this avoids configuration transitions.
In smart card mode, the data bits should be configured as 8 bits, and the parity bit should be configured.
When a parity error is detected by receiver, the transmit data line is pulled low for one baud clock cycle at the end of
the stop bit as NACK signal(If USART_CTRL3.SCNACK is set). This NACK signal will generate a framing error
on the transmit side (transmit side is configured with 1.5 stop bits).
When the transmitter receives a NACK signal (framing error) from the receiver, it does not detect the NACK as a
start bit (according to the ISO protocol, the duration of the received NACK can be 1 or 2 baud clock cycles).
In these examples, we suppose that LINBDL=1(11-bit break length),WL=0(8-bit data)
Break occurring after an Idle
:
RX line
RXDNE/FEF
LINBDF
frame1
frame3
1 frame time
Idle
frame2
1 frame time
Break occurring while a data is being received
:
frame2
RX line
RXDNE/FEF
LINBDF
frame1
1 frame time
frame2
1 frame time
frame3