English
Language : 

ATMEGA168PA_14 Datasheet, PDF (197/326 Pages) ATMEL Corporation – ATMEL 8-BIT MICROCONTROLLER WITH 4/8/16/32KBYTES
Table 22-4. Status codes for Master Receiver Mode
Status Code
(TWSR)
Prescaler
Bits
are 0
Status of the 2-wire
Serial Bus and 2-wire
Serial Interface Hardware
Application Software Response
To TWCR
To/from TWDR STA STO TWINT TWEA Next Action Taken by TWI Hardware
0x08
A START condition has
been transmitted
Load SLA+R
SLA+R will be transmitted
0
0
1
X
ACK or NOT ACK will be received
0x10
A repeated START
Load SLA+R or
0
0
1
X SLA+R will be transmitted
ACK or NOT ACK will be received
condition has been
transmitted
Load SLA+W
0
0
1
X SLA+W will be transmitted
Logic will switch to Master Transmitter mode
No TWDR action or 0
0
1
X 2-wire serial bus will be released and not
0x38
Arbitration lost in SLA+R or
NOT ACK bit
addressed slave mode will be entered
A START condition will be transmitted when the
No TWDR action
1
0
1
X bus becomes free
0x40
SLA+R has been
No TWDR action or 0
0
1
transmitted;
ACK has been received No TWDR action
0
0
1
0 Data byte will be received and NOT ACK will be
returned
Data byte will be received and ACK will be
1 returned
0x48
SLA+R has been
No TWDR action or 1
0
1
X Repeated START will be transmitted
transmitted;
No TWDR action or 0
1
1
X STOP condition will be transmitted and TWSTO
NOT ACK has been
flag will be reset
received
STOP condition followed by a START condition
No TWDR action
1
1
1
X will be transmitted and TWSTO Flag will be reset
0x50
Data byte has been
Read data byte or 0
0
1
received;
ACK has been returned
Read data byte
0
0
1
0 Data byte will be received and NOT ACK will be
returned
Data byte will be received and ACK will be
1 returned
0x58
Data byte has been
Read data byte or 1
0
received;
Read data byte or 0
1
1
1
X Repeated START will be transmitted
X STOP condition will be transmitted and TWSTO
Flag will be reset
NOT ACK has been
returned
STOP condition followed by a START condition
Read data byte
1
1
1
X will be transmitted and TWSTO Flag will be reset
ATmega48PA/88PA/168PA [DATASHEET] 197
9223F–AVR–04/14