|
|
View previous topic :: View next topic |
Author |
Message |
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
PIC12F629 INT_RAx Clarification Needed |
Posted: Tue Jan 18, 2005 7:39 pm |
|
|
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 |
Posted: Wed Jan 19, 2005 4:03 pm |
|
|
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: 1615 Location: Central Illinois, USA
|
Re: PIC12F629 INT_RAx Clarification Needed |
Posted: Thu Feb 03, 2005 7:03 pm |
|
|
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!
Thanks,
-Ben |
|
|
|
|
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
|