This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

TWI error recovery

I am developing a power aware TWI driver for 51822/422. All appears to work properly except when I simulate a bus fault by shorting SCL to ground or shorting SCL and SDA together. My timeout timer properly detects a failure and software sets about to re-initialize the TWI interface. After the fault, I disable TWI, and then go through all the same initialization routines that were used to make TWI work in the first place. After the fault it never issues a clock pulse or changes the status of anything in any of the TWI registers or events, GPIO config is all as it should be and both pins are high and stay that way. It appears as if the TWI hardware on the chip has locked up and can not be reset by software. Is there some way to reset TWI hardware to its reset state via software so we can recover from faults?

Parents
  • Unfortunately that solution in not practical in this situation. We are driving a LCD display with IIC and the product needs a bunch of diagnostic info displayed on cold boot. We were hoping to find a way to recover from occasional errors without having to go through the cold boot process by resetting just the TWI part of the chip and making recovery transparent to the end user.

Reply
  • Unfortunately that solution in not practical in this situation. We are driving a LCD display with IIC and the product needs a bunch of diagnostic info displayed on cold boot. We were hoping to find a way to recover from occasional errors without having to go through the cold boot process by resetting just the TWI part of the chip and making recovery transparent to the end user.

Children
Related