On the edge
After much mental meanderings about how to register one button press as one interrupt with timers and whatever, I had a chat with my friend Andrew up in Seattle. He wrote the book on this sort of stuff (literally). He suggested configuring the external interrupt to trigger on edge rather than level. So one more line to add in the main setup code:
// External Interrupt Mode for EINT0 is Edge Sensitive
EXTMODE = EXTMODE | 1;
and it all works. One button one interrupt, one counter incremented.
If you add this line after the VICIntSelect and the line from the previous posting in the interrupt routine to the previous project here, it should all work for you. The full project will be added to the download area shortly. Meanwhile hack and enjoy!


