So, after long time I might found another issue / missing base functionality: It seems, that the slave transmit for TWI on AVR does push the TWI data register correctly onto the SDA line.
Situation:
Master sends data to slave (address 0x80).
Slave can read it and prints it on UART.
signal in Master TWDR, Slave TWDR and SDA is correct
Master sends request for data to slave (address 0x81).
Slave gets TWSR = 0xA8: "Own SLA+R has been received; ACK has been returned"
(video 9:17)
Slave set TWDR = 0x63
(video 9:28)
Slave get into state TWSR = 0xB8: "Data byte in TWDR has been transmitted; ACK has been received"
(video 12:23)
data on SDA line = 0x00 , not like TWDR = 0x63 ...
Sources:
The code stems from here and uses Peter Fleurys TWI Lib.
Situation:
- two 328mega are connected via TWI (with 10kOhm Pullups)
- Master and its Uart / Mcu Monitor on the right.
- Slave and its Uart / Mcu Monitor on the left.
(video 9:17)
(video 9:28)
(video 12:23)
Sources:
- c code, hex and simu: here
- Video (shows also the PCs of both AVRs, speed slowed down to see single steps)
The code stems from here and uses Peter Fleurys TWI Lib.