cancel
Showing results for 
Search instead for 
Did you mean: 

I2C again...

carlo2
Associate II
Posted on May 09, 2003 at 12:27

I2C again...

2 REPLIES 2
carlo2
Associate II
Posted on May 09, 2003 at 06:06

I find a strange thing.

If i short circuit SCL and SDA together and then, for example, I send the slave address, if i make a wait loop for the end of the operation like this :

while(!(I2CSR1 & EVNT_FLG)), it doesn't exit, so the program crash.

I think that it could be a problem, because if i have an E2prom like slave i have to load my data and i have to manage all error situation, and a short circuit between SDA and SCL is one of this.

If I put SCL or SDA to GND or Vcc everything is ok.

I solve the problem using a timeout timer, but it is a workaround more than a solution.

I accept help...
stephanie
Associate II
Posted on May 09, 2003 at 12:27

Instead of doing an infinite loop, use the watchdog or a timeout routine for instance waiting for a long time and then if the event does not happen , that means that there is a problem: so a reset can be launched (through the WDG) or a s/w management. can be especially created for this case.