English
Language : 

SAM4L Datasheet, PDF (750/1185 Pages) ATMEL Corporation – ATSAM ARM-based Flash MCU
ATSAM4L4/L2
28.8.10
Identifying Bus Events
This chapter lists the different bus events, and how these affects the bits in the TWIS registers.
This is intended to help writing drivers for the TWIS.
Table 28-5. Bus Events
Event
Slave transmitter has sent a
data byte
Slave receiver has received
a data byte
Start+Sadr on bus, but
address is to another slave
Start+Sadr on bus, current
slave is addressed, but
address match enable bit in
CR is not set
Start+Sadr on bus, current
slave is addressed,
corresponding address
match enable bit in CR set
Start+Sadr on bus, current
slave is addressed,
corresponding address
match enable bit in CR set,
SR.STREN and SR.SOAM
are set.
Repeated Start received
after being addressed
Stop received after being
addressed
Start, Repeated Start, or
Stop received in illegal
position on bus
Data is to be received in
slave receiver mode,
SR.STREN is set, and RHR
is full
Data is to be transmitted in
slave receiver mode,
SR.STREN is set, and THR
is empty
Effect
SR.THR is cleared.
SR.BTF is set.
The value of the ACK bit sent immediately after the data byte is given
by CR.ACK.
SR.RHR is set.
SR.BTF is set.
SR.NAK updated according to value of ACK bit received from master.
None.
None.
Correct address match bit in SR is set.
SR.TRA updated according to transfer direction (updating is done one
CLK_TWIS cycle after address match bit is set)
Slave enters appropriate transfer direction mode and data transfer
can commence.
Correct address match bit in SR is set.
SR.TRA updated according to transfer direction (updating is done one
CLK_TWIS cycle after address match bit is set).
Slave stretches TWCK immediately after transmitting the address
ACK bit. TWCK remains stretched until all address match bits in SR
have been cleared.
Slave enters appropriate transfer direction mode and data transfer
can commence.
SR.REP set.
SR.TCOMP unchanged.
SR.STO set.
SR.TCOMP set.
SR.BUSERR set.
SR.STO and SR.TCOMP may or may not be set depending on the
exact position of an illegal stop.
TWCK is stretched until RHR has been read.
TWCK is stretched until THR has been written.
42023C–SAM–02/2013
750