Datasheet
to switch between Slaves, Master Transmitter mode and Master Receiver mode without losing control of
the bus.
Table 23-3. Status Codes for Master Transmitter Mode
Status Code
(TWSR)
Prescaler
Bits are 0
Status of the 2-wire Serial
Bus and 2-wire Serial
Interface Hardware
Application Software Response Next Action Taken by TWI
Hardware
To/from
TWDR
To TWCRn
STA STO TWINT TWEA
0x08 A START condition has been
transmitted
Load SLA+W 0 0 1 X SLA+W will be transmitted;
ACK or NOT ACK will be
received
0x10 A repeated START condition
has been transmitted
Load SLA+W
or
0 0 1 X SLA+W will be transmitted;
ACK or NOT ACK will be
received
Load SLA+R 0 0 1 X SLA+R will be transmitted;
Logic will switch to Master
Receiver mode
0x18 SLA+W has been transmitted;
ACK has been received
Load data
byte or
0 0 1 X Data byte will be transmitted
and ACK or NOT ACK will be
received
No TWDR
action or
1 0 1 X Repeated START will be
transmitted
No TWDR
action or
0 1 1 X STOP condition will be
transmitted and TWSTO Flag
will be reset
No TWDR
action
1 1 1 X STOP condition followed by a
START condition will be
transmitted and TWSTO Flag
will be reset
0x20 SLA+W has been transmitted;
NOT ACK has been received
Load data
byte or
0 0 1 X Data byte will be transmitted
and ACK or NOT ACK will be
received
No TWDR
action or
1 0 1 X Repeated START will be
transmitted
No TWDR
action or
0 1 1 X STOP condition will be
transmitted and TWSTO Flag
will be reset
No TWDR
action
1 1 1 X STOP condition followed by a
START condition will be
transmitted and TWSTO Flag
will be reset
Atmel ATmega644A [DATASHEET]
Atmel-42716C-ATmega644A_Datasheet_Complete-10/2016
271