Hello, iv been working on my biggest project ever (600 lines of C' source code) with lots of functions.
I have an intermittent problem with program lockup in a certain part of my code after the MCU wakes up from hardware sleep mode via a pin change interrupt.
I have a sleep cycle function that handles powering down and doing house keeping when woken up.
I disable global interrupts right after sleep mode as my on/off button is software debounced only, the button ringing was causing the ISR to be called rapidly which i think was causing me some issues.
After all interrupts are disabled then i disable that pin change interrupt mask, only needed for waking up from sleep mode.
Anyways, iv been working away at removing my bug and I finally had the idea to at the end of functions or code portions to turn an led off to indicated the function was complete.
Using my new onboard tool to help me find bugs and clear sections of code. The atmel simulator helps me immensely, but it cant help me solve all my problems.
I do not yet have an ICE tool, but this simple LED indicator to help me test around my code was a light bulb moment for me.