Atmel ARM-Based Evaluation Kit AT91SAM9N12-EK AT91SAM9N12-EK Data Sheet

Product codes
AT91SAM9N12-EK
Page of 1104
732
SAM9N12/SAM9CN11/SAM9CN12 [DATASHEET]
11063K–ATARM–05-Nov-13
39.10.7 Read Write Flowcharts
The flowchart shown in 
 gives an example of read and write operations in Slave mode. A polling or interrupt
method can be used to check the status bits. The interrupt method requires that the interrupt enable register (TWI_IER)
be configured first.
Figure 39-33. Read Write Flowchart in Slave Mode
Set the SLAVE mode:
SADR + MSDIS + SVEN
SVACC = 1 ?
TXCOMP = 1 ?
GACC = 1 ?
Decoding of the 
programming sequence
Prog seq
OK ?
Change SADR 
SVREAD = 0 ?
Read Status Register
RXRDY= 0 ?
Read TWI_RHR
TXRDY= 1 ?
EOSACC = 1 ?
Write in TWI_THR
END
GENERAL CALL TREATMENT
No
No
No
No
No
No
No
No