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 .
i2C BUG
Moderator: Benj
i2C BUG
- Attachments
-
- Hardware.jpg
- (246.03 KiB) Downloaded 699 times
-
- Software.png
- (37.29 KiB) Downloaded 699 times
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: i2C BUG
Hi
I've looked into this issue and it looks like this protocol is not supported by the AVR TWI peripheral.
A "Start, SLA+W" puts it into Master Write mode, and a "Restart, SLA+R" is needed to change that into Master Read mode.
I cannot see any way round that, as yet.
So looks like you will need to stick with the Software mode.
Leigh
I've looked into this issue and it looks like this protocol is not supported by the AVR TWI peripheral.
A "Start, SLA+W" puts it into Master Write mode, and a "Restart, SLA+R" is needed to change that into Master Read mode.
I cannot see any way round that, as yet.
So looks like you will need to stick with the Software mode.
Leigh
Re: i2C BUG
Hi LeighM
Good to know of this Limitation , The device is Atmel Crypto Memory it's very complicated and I'm not surprised
that it's not compatible .
Thanks for your time .
Alan
Good to know of this Limitation , The device is Atmel Crypto Memory it's very complicated and I'm not surprised
that it's not compatible .
Thanks for your time .
Alan
- Attachments
-
- Read.png
- (29.44 KiB) Downloaded 3654 times