CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

rtcc interrupt problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
edbfmi1



Joined: 18 Jul 2006
Posts: 98

View user's profile Send private message

rtcc interrupt problem
PostPosted: Wed Jun 25, 2008 2:04 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jun 25, 2008 2:28 pm     Reply with quote

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 will see the function that you need.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group