0xC8 is called Last data byte status in Atmel's TWI's Slave transmitter mode, but what does it really mean? If TWEA==0 is for the Master receiver, then a Data byte in TWDR has been transmitted; NOT ACK has been received: 0xC0 status should be received.
Looks like the guy who wrote the application note for Atmel even had no idea what this status is.
#define TWI_STX_DATA_ACK_LAST_BYTE 0xC8 // Last data byte in TWDR has been transmitted (TWEA = ??; ACK has been received and it's treated as an error code instead, what a shame!
case TWI_SRX_ADR_DATA_NACK: // Previously addressed with own SLA+W; data has been received; NOT ACK has been returned case TWI_SRX_GEN_DATA_NACK: // Previously addressed with general call; data has been received; NOT ACK has been returned case TWI_STX_DATA_ACK_LAST_BYTE: // Last data byte in TWDR has been transmitted (TWEA = ??; ACK has been received case TWI_BUS_ERROR: // Bus error due to an illegal START or STOP condition TWI_state = TWSR; //Store TWI State as error message, operation also clears noErrors bit TWCR = (1<<TWSTO)|(1<<TWINT); //Recover from TWI_BUS_ERROR, this will release the SDA and SCL pins thus enabling other devices to use the bus break; 