User manual
...the world's most energy friendly microcontrollers
2012-04-24 - Giant Gecko Family - d0053_Rev0.96 461
www.energymicro.com
USARTn_CTRL or through an external connection. The TX output should be configured as open-drain
in the GPIO module.
When no parity error is identified by the receiver, the data frame is as shown in Figure 17.12 (p. 461)
. The frame consists of 8 data bits, a parity bit, and 2 stop bits. The transmitter does not drive the output
line during the guard time.
Figure 17.12. USART ISO 7816 Data Frame Without Error
S 0
1 2
3
4 5
6 7
P
Stop
Start or idleStop or idle
ISO 7816 Frame without error
If a parity error is detected by the receiver, it pulls the line I/O line low after half a stop bit, see
Figure 17.13 (p. 461) . It holds the line low for one bit-period before it releases the line. In this case,
the guard time is extended by one bit period before a new transmission can start, resulting in a total
of 3 stop bits.
Figure 17.13. USART ISO 7816 Data Frame With Error
S 0
1 2
3
4 5
6 7
P
Stop
Start or idle
Stop or idle
ISO 7816 Fram e with error
Stop
NAK
On a parity error, the NAK is generated by hardware. The NAK generated by the receiver is sampled
as the stop-bit of the frame. Because of this, parity errors when in SmartCard mode are reported with
both a parity error and a framing error.
When transmitting a T0 frame, the USART receiver on the transmitting side samples position 16, 17 and
18 in the stop-bit to detect the error signal when in 16x oversampling mode as shown in Figure 17.14 (p.
462) . Sampling at this location places the stop-bit sample in the middle of the bit-period used for the
error signal (NAK).
If a NAK is transmitted by the receiver, it will thus appear as a framing error at the transmitter, and the
FERR interrupt flag in USARTn_IF will be set. If SCRETRANS USARTn_CTRL is set, the transmitter
will automatically retransmit a NACK’ed frame. The transmitter will retransmit the frame until it is ACK’ed
by the receiver. This only works when the number of databits in a frame is configured to 8.
Set SKIPPERRF in USARTn_CTRL to make the receiver discard frames with parity errors. The PERR
interrupt flag in USARTn_IF is set when a frame is discarded because of a parity error.