Atmel Evaluation Kit for AT32uC3A0512, 32-Bit AVR Microcontroller Atmel ATEVK1105 ATEVK1105 Data Sheet

Product codes
ATEVK1105
Page of 826
238
AT32UC3A
24.13 Slave Mode
24.13.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).
24.13.2
Application Block Diagram
Figure 24-22.
Slave Mode Typical Application Block Diagram
24.13.3
Programming Slave Mode
The following fields must be programmed before entering Slave mode:
1. SADR (SMR): The slave device address is used in order to be accessed by master
devices in read or write mode.
2. MSDIS (CR): Disable the master mode.
3. SVEN (CR): Enable the slave mode.
As the device receives the clock, values written in CWGR are not taken into account.
24.13.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.
24.13.4.1
Read Sequence
In the case of a Read sequence (SVREAD is high), TWI transfers data written in the THR (TWI
Transmit Holding Register) until a STOP condition or a REPEATED_START + an address differ-
ent from SADR is detected. Note that at the end of the read sequence TXCOMP (Transmission
Complete) flag is set and SVACC reset.
Host with
TWI
Interface
TWD
TWCK
LCD Controller
Slave 1
Slave 2
Slave 3
R
R
VDD
Host with TWI
Interface
Host with TWI
Interface
Master
32058K AVR32-01/12