ajbeavan 0 Posted April 24, 2013 Report Share Posted April 24, 2013 Hello, Can anyone tell me if there is a way to disable interrupts within a block of code so that a calculation can be done, without the possibility of the interrupt being actioned. eg using the XC8 compiler, could write.... di() digit=period/4096 ei() adam Quote Link to post Share on other sites
Reynard 0 Posted April 24, 2013 Report Share Posted April 24, 2013 Hi Adam, The direct method would be: intcon.GIE = 0; /* disable interrupts */ ... intcon.GIE = 1; /* ensable interrupts */ You could also use the "clear_bit(intcon, GIE)" and "set_bit(intcon, GIE)" macros. Cheers Reynard Quote Link to post Share on other sites
ajbeavan 0 Posted April 25, 2013 Author Report Share Posted April 25, 2013 Of course, thanks for the response... adam Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.