Much easier to use portb.0 interrupt for a single button.
Your program only has to restart and take no special action or remember nothing?
Then why an interrupt at all?
Why not check the button in your main routine and then reset variables and restart the main loop on the button push?
Better still, enable MCLR in config settings and use a reset button to reset the chip at hardware level.
Then all of your variables are cleared, and your program restarted for free (no code space used).




Bookmarks