...the world's most energy friendly microcontrollers
2014-07-02 - Tiny Gecko Family - d0034_Rev1.20
194
www.silabs.com
BIT8DV in USARTn_CTRL can be used to specify the value of the 9th bit without writing to the transmit
buffer with USARTn_TXDATAX or USARTn_TXDOUBLEX, giving higher efficiency in multi-processor
mode, as the 9th bit is only set when writing address frames, and 8-bit writes to the USART can be used
when writing the data frames.
15.3.2.9 Collision Detection
The USART supports a basic form of collision detection. When the receiver is connected to the output
of the transmitter, either by using the LOOPBK bit in USARTn_CTRL or through an external connection,
this feature can be used to detect whether data transmitted on the bus by the USART did get corrupted
by a simultaneous transmission by another device on the bus.
For collision detection to be enabled, CCEN in USARTn_CTRL must be set, and the receiver enabled.
The data sampled by the receiver is then continuously compared with the data output by the transmitter.
If they differ, the CCF interrupt flag in USARTn_IF is set. The collision check includes all bits of the
transmitted frames. The CCF interrupt flag is set once for each bit sampled by the receiver that differs
from the bit output by the transmitter. When the transmitter output is disabled, i.e. the transmitter is
tristated, collisions are not registered.
15.3.2.10 SmartCard Mode
In SmartCard mode, the USART supports the ISO 7816 I/O line T0 mode. With exception of the stop-
bits (guard time), the 7816 data frame is equal to the regular asynchronous frame. In this mode, the
receiver pulls the line low for one baud, half a baud into the guard time to indicate a parity error. This
NAK can for instance be used by the transmitter to re-transmit the frame. SmartCard mode is a half
duplex asynchronous mode, so the transmitter must be tristated whenever not transmitting data.
To enable SmartCard mode, set SCMODE in USARTn_CTRL, set the number of databits in a frame to
8, and configure the number of stopbits to 1.5 by writing to STOPBITS in USARTn_FRAME.
The SmartCard mode relies on half duplex communication on a single line, so for it to work, both the
receiver and transmitter must work on the same line. This can be achieved by setting LOOPBK in
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 15.12 (p. 194)
. 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 15.12. USART ISO 7816 Data Frame Without Error
S
0
1
2
3
4
5
6
7
P
St op
St art or idle
St op or idle
ISO 7816 Fram e wit hout 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 15.13 (p. 195) . 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.
Summary of Contents for EFM32TG
Page 543: ......