English
Language : 

SAM4L Datasheet, PDF (606/1185 Pages) ATMEL Corporation – ATSAM ARM-based Flash MCU
ATSAM4L4/L2
24.6.15.4 Receiver and Transmitter Control
See ”Manchester Encoder” on page 606, and ”Receiver Status” on page 576.
24.6.15.5
Character Transmission and Reception
When the Inhibit Non Acknowledge bit in MR (MR.INACK) is one, the SPI master will not send
pending THR values until CSR.RXRDY is zero. In SPI master mode, the slave select line (NSS)
is asserted low one bit period before the start of transmission, and released high one bit period
after every character transmission. A delay for at least three bit periods is always inserted in
between characters. In order to address slave devices supporting the Chip Select Active After
Transfer (CSAAT) mode, NSS can be forced low by writing a one to the Force SPI Chip Select
bit (CR.RTSEN/FCS). Releasing NSS when FCS is one is only possible by writing a one to the
Release SPI Chip Select bit (CR.RTSDIS/RCS).
In SPI slave mode, a low level on NSS for at least one bit period will allow the slave to initiate a
transmission or reception. The Underrun Error bit (CSR.UNRE) is set if a character must be sent
while THR is empty, and TXD will be high during character transmission, as if 0xFF was being
sent. An interrupt request is generated if the Underrun Error bit in the Interrupt Mask Register
(IMR.UNRE) is set. If a new character is written to THR it will be sent correctly during the next
transmission slot. Writing a one to CR.RSTSTA will clear CSR.UNRE. To ensure correct behav-
ior of the receiver in SPI slave mode, the master device sending the frame must ensure a
minimum delay of one bit period in between each character transmission.
24.6.15.6
Receiver Time-out
Receiver Time-outs are not possible in SPI mode as the Baud Rate Clock is only active during
data transfers.
24.6.16
Manchester Encoder/Decoder
Writing a one to the Manchester Encoder/Decoder bit in the Mode Register (MR.MAN) enables
the Manchester Encoder/Decoder. When the Manchester Encoder/Decoder is used, characters
transmitted through the USART are encoded in Manchester II Biphase format. Depending on
polarity configuration, selected by the Transmission Manchester Polarity bit in the Manchester
Configuration Register (MAN.TX_MOPL), a logic level (zero or one) is transmitted as the transi-
tion from high -to-low or low-to-high during the middle of each bit period. This consumes twice
the bandwidth of the simpler NRZ coding schemes, but the receiver has more error control since
the expected input has a transition at every mid-bit period.
24.6.16.1
Manchester Encoder
An example of a Manchester encoded sequence is the byte 0xB1 (10110001) being encoded to
10 01 10 10 01 01 01 10, assuming default encoder polarity. Figure 24-44 illustrates this coding
scheme.
Figure 24-44. NRZ to Manchester Encoding
NRZ
encoded
data
1
0
1
1
0
0
0
1
Manchester
encoded Txd
data
A Manchester encoded character can be preceded by both a preamble sequence and a start
frame delimiter. The preamble sequence is a pre-defined pattern with a configurable length from
42023C–SAM–02/2013
606