Skip to main content
Visitor II
May 9, 2003
Question

I2C again...

  • May 9, 2003
  • 2 replies
  • 871 views
Posted on May 09, 2003 at 12:27

I2C again...

    This topic has been closed for replies.

    2 replies

    carlo2Author
    Visitor II
    May 9, 2003
    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...
    Visitor II
    May 9, 2003
    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.