Please somebody tell me, does ccs have any function to check if interrupt flag bit is set? If yes what is it?
Which of these is correct: clear_interrupt(INTF) or clear_interrupt(INT_EXT) ?
Both will compile with PCM compiler.
What does the statement if(INTCON&(INTF)) mean?
My regards to all.
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Sat Mar 24, 2012 6:13 pm
Quote:
Does ccs have any function to check if interrupt flag bit is set?
Download the CCS manual and view it:
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf
Open up the Table of Contents window on the left side of the screen.
Click on this section: BUILT-IN-FUNCTIONS
Print those 4 or 5 pages. Then anytime you need a function, just look for
it in the list. For interrupts, look in the section on "Processor Controls".
You see the functions listed below. Read the manual and see if one of
them will tell you if the interrupt flag is set for the specified interrupt:
Which of these is correct: clear_interrupt(INTF) or clear_interrupt(INT_EXT) ?
This one is correct:
Code:
clear_interrupt(INT_EXT);
Quote:
What does the statement if(INTCON&(INTF)) mean?
That code is from the SourceBoost or Hi-Tech compiler, or some other
compiler. You won't normally see that in CCS. They are testing if
the External interrupt flag is set in the INTCON register. CCS does have
a function to do this. It's in the list that I posted earlier in my reply.
But normally, you don't need to test if an interrupt is active in CCS.
It's only needed in special situations.
ERICOO
Joined: 13 Jun 2011 Posts: 14 Location: NIGERIA
Posted: Wed Apr 18, 2012 2:08 pm
Thanks a lot PCM PROGRAMMER you solved my problems.
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