I’ve been having issues with a P1, I2C Port Expander (MCP23017), and I2C display, where communications are messed up (display misprints, and port expander randomly turns on the incorrect pins).
This issue pointed me towards task switching being at the heart of the problem. I added atomic blocks to limited I2C code, and it seems to have resolved the issues. However…
I’ve been running an application watchdog in my firmware, and it’s no longer working now that I’m using atomic blocks.
So, my question:
After Atomic Blocks have disabled interrupts and thread switching, how do they reenable them? And would an application watchdog be reenabled?