Forum

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
i2c massive reading - I2C0 module doesn't respond
2016 年 06 月 09 日
14:18:36
pongraczi
Hungary
Moderator
Forum Posts: 20
Member Since:
2015 年 02 月 11 日
Offline

Hi,
I use lubuntu with the 86duino_linux_sdk to read from a cypress io expander chip.
Nothing fancy, but polling frequently.
The software compiled with "Arduino.h", Wire.h. Basically it is working

The problem is, after several hours of running, the following problems appear and I have no idea, how to reset the i2c completely when this kind of problem happens:

1st case, after some hours of running:
arbitration loss for I2C bus
I2C0 module doesn't respondInit fail: I2C is working now
I2C0 module doesn't respondInit fail: I2C is working now
I2C0 module doesn't respondInit fail: I2C is working now
I2C0 module doesn't respondInit fail: I2C is working now
I2C0 module doesn't respondInit fail: I2C is working now

2nd case, after the problem above, the software stopped by Ctrl+C and restarted, it started well, but on init it detected an issue as seen below:
I2C's SDA is LOW, we try to repair itRepair completed

So, do you have idea, how to reset the i2c bus reliable in this case, without need to restart the software?
I try this at this moment:
if(ERROR_HAPPENED_DURING_I2C_ACTION)
{
printf("Error in write.
",);
i2c_Reset(0);
Wire.begin();
}

At this moment this software is running and I have to wait to this problem occur to see the result.
Thanks!
István

2016 年 06 月 09 日
21:08:19
pongraczi
Hungary
Moderator
Forum Posts: 20
Member Since:
2015 年 02 月 11 日
Offline

Ok, it seems, the following workaround handle this issue and can reset the bus and continue working, without exiting:

#include
.......
if(PROBLEM_OCCURED)
{
printf("Problem
");
i2c_Reset(0);
Wire.begin();
}

Here is the log:
root@86duino:~/Desktop/86duino_LANDrive/vex_i2c01# ./86duino
I2C's SDA is LOW, we try to repair itRepair completedCypress input: 1000000, Read bytes: 1, TTC: 3
Cypress input: 1000000, Read bytes: 1, TTC: 5
Cypress input: 1000000, Read bytes: 1, TTC: 2
receive no ACK after transmittingmust start a correct transaction before writing dataError in write: 4
arbitration loss for I2C busInit fail: I2C is working nowError in write: 4
Init fail: I2C is working nowCypress input: 0000110, Read bytes: 1, TTC: 2
Cypress input: 1000000, Read bytes: 1, TTC: 2
Cypress input: 1000000, Read bytes: 1, TTC: 2

Above you can see only 3 read input values to avoid messing up the screen.
So, when i2c bus dies, the reset can bring it up again and continue working.

Cheers,
István

Forum Timezone: Asia/Taipei

Most Users Ever Online: 66

Currently Online:
2 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Dinosaur: 27

leutenecker: 13

mrZagg: 10

lukeross: 8

tomka: 8

smeezekitty: 8

hippy: 8

Ekkehard: 8

UIdahoCIT: 8

blaxxun: 7

Member Stats:

Guest Posters: 0

Members: 1509

Moderators: 14

Admins: 5

Forum Stats:

Groups: 2

Forums: 10

Topics: 238

Posts: 1079

Newest Members: Carol Chou, Kai-Jung Chou, 1789, RegLiu, ameerawwad, asmanko, nekotwingo, ttronic, Davidpag, zaskia12

Moderators: Glaux: 70, uaa: 11, guigra: 17, asian55: 22, Android_Lin: 208, bcarroll: 12, cucubutter: 84, recycled-air: 12, stevemork: 16, zerozaber: 52, pongraczi: 20, George Andrews III: 56, poto: 11, garpastym: 20

Administrators: eveshih: 1, anthony: 31, viky6: 0, roboard: 135, hcl: 0