87
4958B–AUTO–11/10
Atmel ATA6285/ATA6286 [Preliminary]
At the beginning of a telegram, the SSI Control loads the transmit buffer into the shift register
and proceeds immediately to shift data out. At the same time, incoming data is shifted into the
shift register. This incoming data is automatically loaded into the receive buffer when the com-
plete telegram has been received. In that way data can be simultaneously received and
transmitted.
The system is double buffered in the transmit direction and double buffered in the receive direc-
tion. When receiving data, however, a received character must be read from the SSI Data
Register (T2MDR) before the next character has been completely shifted in. Otherwise, the first
byte is lost.
Before data can be transferred, the SSI must first be activated. This is performed by means of
the SSI enable control bit (T2SSIE in the T2MRB register). There are two combinations of SCLK
polarity with respect to serial data, which are determined by control bit (T2CPOL in the T2MRB
register). The SSI has three status flags (T2RXF, T2TXF and T2TCF) in the status register
(T2IFR) and additional three interrupt mask bits (T2RXIM, T2TXIM and T2TCIM) in the interrupt
mask register (T2IMR). The status of the SSI buffer registers shown by the T2TXF bit for the
transmit buffer register (TXD) and the T2RXF bit for receive buffer register (RXD). The T2TCF
bit indicates the present status of the serial communication.
Figure 3-35 shows an example of
transmit/receive operation from the SSI.
Figure 3-35. Example of Transmit/Receive Operation
For a serial data stream without a gap you must write T2MDR (TXD data) just after a
T2TXB-interrupt or after TXF-flag is set. For byte wise sending data you must write T2MDR
(TXD data) after a T2TXC-interrupt or after the T2TCF-flag is set.
LSB
MSB
LSB
MSB
3
0
1
2
54
76
3
0
1
2
54
76
3
0
1
2
54
76
LSB
MSB
Write T2MDR
(TXD data 3)
Write T2MDR
(TXD data 2)
Read T2MDR
(RXD data 1)
SCLK
(T2CPOL = 0)
SO/SI
T2SSIE
T2TXF
T2RXB
Interrupt
T2TXC
Interrupt
T2TXB
Interrupt
T2TCF
T2RXF
SCLK
(T2CPOL = 1)
Read T2MDR
(RXD data 2)
Read T2MDR
(RXD data 3)
Write T2MDR
(TXD data 1)