Go Down

Topic: I2C Slave Repeated Start transactions are broken. (Read 2928 times) previous topic - next topic


I believe the following commit:

has broken I2C Slave Repeated Start transactions.

In particular, when the master sends a Start - Write - Repeated Start - Read - Stop, the Wire library doesn't create an even for the Read transaction.

It turns out that the twi_stop function has the following term in its write to TWCR: | _BV(TWSTO)

According to the ATmega128 datasheet, TWSTO should ONLY be used for master transactions, not for slave transaction.

I created a new version that adds a twi_stop_slv function that removes this particular term and also removes the wait for stop while function that follows it.

After this fix, everything is fine again.

This should be fixed.


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131