Re: PIC12F1572 External Interrupt constant firing
You are correct and it's better to do it via a Timer too. Here is why;
In this case the circuit is very simple when the switch is triggered, turn an LED on or off. The user can decide by means of a jumper. If the jumper is switched the user will need to reset the circuit. Otherwise the LED will not reflect the correct state (based on jumper setting) until a reset or the next time the switch triggers an interrupt. Although not a huge deal not ideal for smooth operation.
This problem goes away if a timer is used since the Timer check will constantly be setting the LED to the correct state based on the (jumper setting). When the switch is hit the LED will be changed.
Since this circuit is simple and all that has to be done is flip an LED and a few other very simple commands (all to be done at the same time) do I even need an interrupt at all? Why not just use the main loop and skip the timer all together? Is there a down side to that? The chip will be set to 4 Mhz so there are no concerns of delay if the switch is pressed while it's in mid loop.