atmega8 as twi-slave

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View

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)?




Re: atmega8 as twi-slave
Quoted text here. Click to load it

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.

Site Timeline