i2C BUG
Posted: Mon Sep 05, 2016 9:39 pm
Hi
Just found this I2c bug ( Arduino Mega 2560)
When Communicating with I2c using Hardware Channel 1 with most devices where you have standard protocol structure like
for example DS1307 it works Perfectly .
Init->Start -> Device Address+Write->Target Register-> Restart -> Device Address+Read-> Receive Byte ->Receive Byte->Receive Byte->Stop
So that is fine .
But i have this device that have a slightly different protocol structure to read from it you just transmit the following bytes and it
starts to send data .
Init->Start -> Device Address+Command->Register H-Address-> Register L-Address-> Number of bytes to receive -> RX->RX->RX ..... Stop
The Problem is that with the i2c Hardware Channel it receives the first byte and the MCU stops responding as if it had entered a loop .
also the data received is not correct .
Now when trying whit I2c Software mode all works Fine .
Just found this I2c bug ( Arduino Mega 2560)
When Communicating with I2c using Hardware Channel 1 with most devices where you have standard protocol structure like
for example DS1307 it works Perfectly .
Init->Start -> Device Address+Write->Target Register-> Restart -> Device Address+Read-> Receive Byte ->Receive Byte->Receive Byte->Stop
So that is fine .
But i have this device that have a slightly different protocol structure to read from it you just transmit the following bytes and it
starts to send data .
Init->Start -> Device Address+Command->Register H-Address-> Register L-Address-> Number of bytes to receive -> RX->RX->RX ..... Stop
The Problem is that with the i2c Hardware Channel it receives the first byte and the MCU stops responding as if it had entered a loop .
also the data received is not correct .
Now when trying whit I2c Software mode all works Fine .