Hello Fellow Freaks,
I'm using an Atmega328PB xplained-mini and connected a switch that breaks me out of the software, regardless of where it is.
Obviously, there is no non-maskable interrupt on this processor, so I just used a normal interrupt.
When the switch is pressed and debounced, I simply jump to address 0x0000.
I know I could use the Watchdog to Restart in the event the software hangs, but this gives me the ability to simply Restart the program at any time, even while it's running normally.
This works fine for my testing purposes and definitely NOT something I would leave in the finished product.
So here are the questions:
1. When a program restarts from address 0x0000, does the stack pointer get reset?
2. How do I pop the return address from the interrupt off the stack pointer before the jump in "C"?
3. If I jump to 0x0000 when using Debug Wire for debugging, am I going to leave a fuse in the wrong state, like cycling power would.
Thanks for your help and suggestions,