Atmel Xplained Pro Evaluation Kit ATSAM4E-XPRO ATSAM4E-XPRO Data Sheet

Product codes
ATSAM4E-XPRO
Page of 1506
SAM4E [DATASHEET]
Atmel-11157D-ATARM-SAM4E16-SAM4E8-Datasheet_12-Jun-14
842
36.7.5 Slave Mode
36.7.5.1 Definition
The Slave Mode is defined as a mode where the device receives the clock and the address from another device
called the master.
In this mode, the device never initiates and never completes the transmission (START, REPEATED_START and
STOP conditions are always provided by the master).
36.7.5.2 Application Block Diagram
Figure 36-25. Slave Mode Typical Application Block Diagram
36.7.5.3 Programming Slave Mode
The following fields must be programmed before entering Slave mode:
1.
TWI_SMR.SADR: The slave device address is used in order to be accessed by master devices in read or write 
mode.
2.
TWI_CR.MSDIS: Disable the master mode.
3.
TWI_CR.SVEN: Enable the slave mode.
As the device receives the clock, values written in TWI_CWGR are ignored.
36.7.5.4 Receiving Data
After a Start or Repeated Start condition is detected and if the address sent by the Master matches with the Slave
address programmed in the SADR (Slave Address) field, SVACC (Slave Access) flag is set and SVREAD (Slave
Read) indicates the direction of the transfer. 
SVACC remains high until a STOP condition or a repeated START is detected. When such a condition is detected,
EOSACC (End Of Slave Access) flag is set.
Read Sequence
In the case of a Read sequence (SVREAD is high), TWI transfers data written in the TWI_THR (TWI Transmit
Holding Register) until a STOP condition or a REPEATED_START + an address different from SADR is detected.
Note that at the end of the read sequence TXCOMP (Transmission Complete) flag is set and SVACC reset.
As soon as data is written in the TWI_THR, the TXRDY (Transmit Holding Register Ready) flag is reset, and it is
set when the internal shifter is empty and the sent data acknowledged or not. If the data is not acknowledged, the
NACK flag is set. 
Note that a STOP or a repeated START always follows a NACK.
Write Sequence
Host with
TWI
Interface
TWD
TWCK
LCD Controller
Slave 1
Slave 2
Slave 3
R
R
V
DD
Host with TWI
Interface
Host with TWI
Interface
Master