Page 1 of 1

How STOP int- interruption At some point

Posted: Mon Feb 26, 2018 9:51 am
by YSRAHMED
Gooood Day
I was connect Buzzer to B7 (pic16f877a )
so
I was connect pushbutton to D1 (as normal open pointes in sensor )
when
pushbutton is on -----> feed D1 with 0 ------> Buzzer Run :P
so
{ I using int B0 for Mute Buzzer(INT-interruption ) };
so
{ I was use Delay(10s )-----> for test the Mute Buzzer by interruption };
how :?:
{ can I stop the interruption at once When removing the BUZZER cause :?:

:D :D :D

Re: How STOP int- interruption At some point

Posted: Mon Feb 26, 2018 11:03 am
by Benj
Hello,

If your using a fixed delay then you can't really stop half way through even using an interrupt, unless you reset the chip or midify the program counter you will still be inside the delay when you leave the interrupt.

Instead of using a 10 second delay why not loop 100 times using a while icon and a 100ms delay. This way you can do additional checks in the loop to allow you to bail out early if needed.