Jump to content

Recommended Posts

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

Link to post
Share on other sites

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

Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...