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

PIC12F629 INT_RAx Clarification Needed

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



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PIC12F629 INT_RAx Clarification Needed
PostPosted: Tue Jan 18, 2005 7:39 pm     Reply with quote

Hey there peoples,

I want to use A0,1,2,3 for Interrupt based input, do I need to have an ISR for each pin or can I group them with INT_RA collectively?

So in my code, I'd only need enable (INT_RA) and all pins set for input would be used or do I need enable (INT_RA | INT_RA0 | INT_RA1) and so on??

I'm going to poke around in the meantime and see if I can make some sense...

Thanks,

-Ben
[/b]
Ttelmah
Guest







Re: PIC12F629 INT_RAx Clarification Needed
PostPosted: Wed Jan 19, 2005 4:03 pm     Reply with quote

bkamen wrote:
Hey there peoples,

I want to use A0,1,2,3 for Interrupt based input, do I need to have an ISR for each pin or can I group them with INT_RA collectively?

So in my code, I'd only need enable (INT_RA) and all pins set for input would be used or do I need enable (INT_RA | INT_RA0 | INT_RA1) and so on??

I'm going to poke around in the meantime and see if I can make some sense...

Thanks,

-Ben
[/b]

The chip, doesn't actually have seperate interrupts for all these pins. Only GP2, actually has an interrupt directly connected. All the I/O pins, support driving the single 'interrupt on change' feature, which drives only one physical interrupt line. The individual 'interrupt' selections in the .h file, correspond to enabling this feature, and then setting the bit mask, to specify which bits should be looked at (otherwise changing a value on one of the other pins, will cause the event to trigger). You need to just enable the bit mask for the inputs you want to use (or'ing the constants does this), have a single INT_RA routine, which will need to check which input has _changed_ (remember these interrupts will trigger on any input change, not just a rising or falling edge like a normal interrupt). As part of this testing, you will need to read the port register to reset ready for the next change.

Best Wishes
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

Re: PIC12F629 INT_RAx Clarification Needed
PostPosted: Thu Feb 03, 2005 7:03 pm     Reply with quote

Ttelmah wrote:

The chip, doesn't actually have seperate interrupts for all these pins. Only GP2, actually has an interrupt directly connected. All the I/O pins, support driving the single 'interrupt on change' feature, which drives only one physical interrupt line. The individual 'interrupt' selections in the .h file, correspond to enabling this feature, and then setting the bit mask, to specify which bits should be looked at (otherwise changing a value on one of the other pins, will cause the event to trigger). You need to just enable the bit mask for the inputs you want to use (or'ing the constants does this), have a single INT_RA routine, which will need to check which input has _changed_ (remember these interrupts will trigger on any input change, not just a rising or falling edge like a normal interrupt). As part of this testing, you will need to read the port register to reset ready for the next change.


That answers my question... (I know about RA2 being the "INT" line like B0 is on other PICs..)

We'll see what happens from here! Wink

Thanks,

-Ben
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