Datasheet
208
ATtiny828 [DATASHEET]
8371A–AVR–08/12
19.5.2 TWSCRB – TWI Slave Control Register B
z Bits 7:3 – Res: Reserved Bits
These bits are reserved and will always read as zero.
z Bit 2 – TWAA: TWI Acknowledge Action
This bit defines the slave's acknowledge behavior after an address or data byte has been received from the master.
Depending on the TWSME bit in TWSCRA the Acknowledge Action is executed either when a valid command has been
written to TWCMDn bits, or when the data register has been read. Acknowledge action is also executed if clearing
TWAIF flag after address match or TWDIF flag during master transmit. See Table 77 for details.
Table 77. Acknowledge Action of TWI Slave
z Bits 1:0 – TWCMD[1:0]: TWI Command
Writing these bits triggers the slave operation as defined by Table 78. The type of operation depends on the TWI slave
interrupt flags, TWDIF and TWASIF. The Acknowledge Action is only executed when the slave receives data bytes or
address byte from the master.
Table 78. TWI Slave Command
Bit 76543210
(0xB9) – – – – – TWAA TWCMD1 TWCMD0 TWSCRB
Read/Write RRRRRR/WWW
Initial Value 0 0 0 0 0 0 0 0
TWAA Action TWSME When
0 Send ACK
0 When TWCMDn bits are written to 10 or 11
1 When TWSD is read
1 Send NACK
0 When TWCMDn bits are written to 10 or 11
1 When TWSD is read
TWCMD[1:0] TWDIR Operation
00 X No action
01 X Reserved
10
Used to complete transaction
0 Execute Acknowledge Action, then wait for any START (S/Sr) condition
1 Wait for any START (S/Sr) condition