Quote Originally Posted by sougata
Hi,

You are turning on the LED3 in the interrupt routine and turning it off in the main loop. So technically it should work. Now consider this :

Your buttons are not debounced so it may quite happen that another rising edge is setting up your interrupt. Since you have the buttons pressed while in interrupt you are being able to detect it and light led1 and led2.

So introduce a pause inside your interrupt after turning on the LEDs and as soon as you inside the interrupt release the button. Then while getting out clear the interrupt flags. This might solve your problem.

Regards

Sougata
Hi Sougata,

If I enter any pause in the interrupt routine (I just tried it) I severelly impair the PWM loops, and this is another indication that the interrupt is being triggered constantly.

Here is the schematic:




Thanks


Pablo