Datasheet

Status Code
(TWSRn)
Prescaler Bits
are 0
Status of the Two-Wire Serial
Bus and Two-Wire Serial
Interface Hardware
Application Software Response Next Action Taken by TWI
Hardware
To/From
TWD
To TWCRn
STA STO TWINT TWEA
ACK or NOT ACK will be
received
0x10 A repeated START condition
has been transmitted
Load SLA+R 0 0 1 X SLA+R will be transmitted
ACK or NOT ACK will be
received
Load SLA+W 0 0 1 X SLA+W will be transmitted
Logic will switch to Master
Transmitter mode
0x38 Arbitration lost in SLA+R or
NOT ACK bit
No TWDR
action
0 0 1 X two-wire serial bus will be
released and not addressed
Slave mode will be entered
1 0 1 X A START condition will be
transmitted when the bus
becomes free
0x40 SLA+R has been transmitted;
ACK has been received
No TWDR
action
0 0 1 0 Data byte will be received and
NOT ACK will be returned
0 0 1 1 Data byte will be received and
ACK will be returned
0x48 SLA+R has been transmitted;
NOT ACK has been received
1 0 1 X Repeated START will be
transmitted
0 1 1 X STOP condition will be
transmitted and TWSTO flag
will be reset
1 1 1 X STOP condition followed by a
START condition will be
transmitted and TWSTO flag
will be reset
0x50 Data byte has been received;
ACK has been returned
Read data
byte
0 0 1 0 Data byte will be received and
NOT ACK will be returned
0 0 1 1 Data byte will be received and
ACK will be returned
0x58 Data byte has been received;
NOT ACK has been returned
Read data
byte
1 0 1 X Repeated START will be
transmitted
0 1 1 X STOP condition will be
transmitted and TWSTO flag
will be reset
1 1 1 X STOP condition followed by a
START condition will be
transmitted and TWSTO flag
will be reset
ATmega48PA/88PA/168PA
Two-Wire Serial Interface (TWI)
© 2018 Microchip Technology Inc.
Datasheet Complete
DS40002011A-page 289