atmega8 as twi-slave

hi,

i try to use the atmega8 as a slave-device on the twi (i2c) bus. i can send the slave-adress and the atmel reacts on it, but then it sends SCL to low and the bus is blocked. i have no idea whats the next step.

does anyone have a working slave-implementation (example-code)?

thanks

regards

olli

Reply to
Oliver Joa
Loading thread data ...

The ATMega8 is doing exactly what the datasheet says it will do. See the section called "Control Unit" starting on the bottom of page 167.

"As long as the TWINT Flag is set, the SCL line is held low. This allows the application software to complete its tasks before allowing the TWI transmission to continue."

So, the next step is to do whatever the TWI slave is supposed to do at this point. What you need to do probably depends on the R/W bit that came with the control byte.

Reply to
Gary Kato

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.