Stepper-Motor-Controller icon indicating copy to clipboard operation
Stepper-Motor-Controller copied to clipboard

USI I2C Slave @ 8MHz talking to Arduino Wire Library - Protocol Error

Open jmount1992 opened this issue 6 years ago • 0 comments

Thanks for the USI I2C library, great help. However, I found when in USI I2C Slave mode that if your Microcontroller is running at 8MHz or lower you will need to reduce the Arduino's Wire Library default (100kHz) I2C SCL frequency. Else the timing in the ACK section can be a bit dicey.

To change the Arduino's Wire Library default I2C SCL frequency you need to call Wire.setClock(<SCL_FREQ>) where SCL_FREQ is anywhere between 31000L to 400000L (31kHz to 400kHz). See begin section here .

This was an extremely annoying bug to hunt down.

Hope this makes sense and helps others.

jmount1992 avatar Apr 04 '18 05:04 jmount1992