You could also try calling I2C.Initialize( I2C#BootPin ) after calling VarBackup or VarRestore and before calling one of the other I2C routines. This will reinitialize the I/O pins and the EEPROM to a known state.
I tried that but once varbackup or varrestore is used the i2c routines stop working. Both routines never run at the same time. the i2c routines do not affect varbackup or varrestore. i2c is the only thing affected. some how varbackup and varrestore are setting something that disables i2c routines
If you're using other I2C drivers in the the same project you'll want to set all the pins used to inputs and set them to their "low" state so other cogs can use the pins. (I had this problem once when using a different driver to read a real time clock.)
I've added an "I2cEnd" method to some of my projects.
PUB I2cEnd
' Restore pins to original state so other cogs can use them.
outa[SCL]~
dira[SCL]~
outa[SDA]~
dira[SDA]~
I've found a lot of I2C drivers don't release the lines (hence my earlier warning).
I've added an "I2cEnd" method to some of my projects.
PUB I2cEnd
' Restore pins to original state so other cogs can use them.
outa[SCL]~
dira[SCL]~
outa[SDA]~
dira[SDA]~
I've found a lot of I2C drivers don't release the lines (hence my earlier warning).
That worked like a champ!!!! Thank all of you for your help. I'm back on track now :-) My program seems to be working great and I get to keep both eeprom programs.
Comments
I've added an "I2cEnd" method to some of my projects.
I've found a lot of I2C drivers don't release the lines (hence my earlier warning).
That worked like a champ!!!! Thank all of you for your help. I'm back on track now :-) My program seems to be working great and I get to keep both eeprom programs.