i2C BUG

A forums to allow resolved bugs and problems with Flowcode v7 to be stored and marked as resolved.

Moderator: Benj

Post Reply
User avatar
Alan_37
Posts: 156
Joined: Sun May 01, 2016 8:36 pm
Contact:

i2C BUG

Post by Alan_37 »

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 .
Attachments
Hardware.jpg
(246.03 KiB) Downloaded 699 times
Software.png
(37.29 KiB) Downloaded 699 times

User avatar
LeighM
Matrix Staff
Posts: 2043
Joined: Tue Jan 17, 2012 10:07 am
Contact:

Re: i2C BUG

Post by LeighM »

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

User avatar
Alan_37
Posts: 156
Joined: Sun May 01, 2016 8:36 pm
Contact:

Re: i2C BUG

Post by Alan_37 »

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
Attachments
Read.png
(29.44 KiB) Downloaded 3654 times

Post Reply