2008-11-23 09:13 PM
Generating Reset & I2C
2011-05-17 03:53 AM
After searching through the forums I've finally figured out how to trigger a software reset in my code (other than watchdog). My problem now is with the I2C bus always being set to busy whenever I come out of a reset and try to re-initialize the bus. So far my only solution to be able to clear the busy bit is to power down/up my device. I've tried DeIntI2C() library function, which does clear the busy bit, but as soon as I re-int the I2C, the bit is set again. This inherently causes my code to continuously reset due to wdt timeout every time I access the I2C bus. Any ideas?
2011-05-17 03:53 AM
Did you init the GPIO pins before taking the I2C out of reset?
2011-05-17 03:53 AM
yeah. on powerup i reset all the GPIO's before initializing any peripherials.
2011-05-17 03:53 AM
Any luck yet?
If not, try the following: - check if both CLK and DATA lines are high (assume you have a 4.7k pullup resistors to VCC) - apply the same code to second I2C module Good luck. Jan