I am trying to find an elusive and intermittent bug in my code. I am fairly confident that the problem is somewhere in a routine where the MCU is interacting with other chips (so simulation will not really work for me). Unfortunately, that doesn't really narrow it down, as there are many such routines in the code. I do not have an on-chip debugger (only an AVRISP mk2). Is there a way to determine what instruction was executed last (program pointer?)?
Meaning, if my WDT trips, can I determine where in memory/code I was and print that out via the UART?