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 CCS Technical Support

12F675 invalid preprocessor directive with INT_RA4

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



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Aug 08, 2009 11:52 pm     Reply with quote

Here is the explanation:
There is only one "interrupt on change" interrupt. It's called #INT_RA.
But, each pin (GP0-GP5) can be individually enabled for the interrupt-on-
change feature. So the interrupt routine itself will always only have
#INT_RA above it. But in your code, for the enable_interrupts() and
disable_interrupts() functions, you should use INT_RA0 to INT_RA5 as
the parameter. See the example below:
Code:

#include <12F675.h>
#fuses INTRC_IO, NOWDT, NOMCLR, PUT, BROWNOUT
#use delay(clock=4000000)

#int_ra
void int_ra_isr(void)
{
int8 temp;

temp = input(PIN_A4); // Read pin to clear mismatch condition

}

//======================
void main()
{
// There is only one "INT_RA" interrupt.  Clear it.
clear_interrupt(INT_RA);

// Enable interrupt-on-change for pin A4 only.
enable_interrupts(INT_RA4);

enable_interrupts(GLOBAL);

while(1);
}
aruna1



Joined: 14 Oct 2008
Posts: 103

View user's profile Send private message

PostPosted: Sun Aug 09, 2009 1:21 am     Reply with quote

So interrupt code will only run for changes in A4? and it will not run even other pins are changing?
Thanks

edit:
i just checked its working
thanks PCM
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