I am going to try and get this across without posting my code because it is rather lengthy.
I am using PCM 3.249
micro is a PIC16C71
using Picmaster Emulator
Problem I am having:
I am using the TMR0 timer and RB0 external interrupts for a "light dimmer" type design.
I have the GLOBAL interrupts disabled when I first go into the program while I do some initial house cleaning.
Also I have not enabled the TMR0 or RB0 interrupts.
After I am through with the "house cleaning"
I enable the RB0 interrupt and and then ENABLE GLOBAL interrupts.
Now for the problem.
While I am doing the "House Cleaning" the TMR0 rolls over and sets the TMR0 Interrupt Flag. (even though I did not enable it yet).
Now as soon as I ENABLE GLOBAL INTERRUPTS to look for the RB0 interrupt the program jumps to the TMR0 interrupt routine since the flag was set earlier.
Is there a way to clear the TMR0 interrupt flag before I do the GLOBAL INTERRUPT ENABLE?
Thanks
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Wed Jun 25, 2008 2:28 pm
Quote:
Is there a way to clear the TMR0 interrupt flag before I do the GLOBAL INTERRUPT ENABLE?
Download the CCS manual (June 2008 version):
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf
Look at the list of CCS functions in the section on "Processor Controls"
on page 142. (Page 154 in the Acrobat Reader).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum