How STOP int- interruption At some point

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

Post Reply
Posts: 4
Joined: Mon Feb 26, 2018 8:46 am

How STOP int- interruption At some point

Post by YSRAHMED »

Gooood Day
I was connect Buzzer to B7 (pic16f877a )
I was connect pushbutton to D1 (as normal open pointes in sensor )
pushbutton is on -----> feed D1 with 0 ------> Buzzer Run :P
{ I using int B0 for Mute Buzzer(INT-interruption ) };
{ 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

User avatar
Matrix Staff
Posts: 14848
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd

Re: How STOP int- interruption At some point

Post by Benj »


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.

Post Reply