View previous topic :: View next topic |
Author |
Message |
Sophi
Joined: 14 Jun 2005 Posts: 64
|
Is PortB the only place for a hardware interrupt? |
Posted: Sat Mar 11, 2006 4:43 pm |
|
|
Hi-
I'm using PICF877A and want to use 2 interrupts. Is Port B the only Port that supports hardware-based interrupts...as in if I push a switch, the software will interrupt.
My Port B is all used up.
Also- is there somewhere that has a list of all the PICF877A interrupts and describes them well. If you are going to direct me to the data sheet please tell me where exactly, I am lost in the 234 pages!
Thanks in advance!
SophE |
|
![](templates/subSilver/images/spacer.gif) |
dyeatman
Joined: 06 Sep 2003 Posts: 1924 Location: Norman, OK
|
|
Posted: Sat Mar 11, 2006 5:26 pm |
|
|
Why not try page 153 (Section 14.11) interestingly enough it is titled "Interrupts".... |
|
![](templates/subSilver/images/spacer.gif) |
Sophi
Joined: 14 Jun 2005 Posts: 64
|
|
Posted: Sat Mar 11, 2006 5:44 pm |
|
|
Thanks! Exactly what I needed.
*edit: and yes the title is very interesting
S |
|
![](templates/subSilver/images/spacer.gif) |
Sophi
Joined: 14 Jun 2005 Posts: 64
|
|
Posted: Sat Mar 11, 2006 8:15 pm |
|
|
After reading the interrupt section things are still not that clear. In the PIC877A.h file it has a list of interrupts that I can use. I am still looking for a more complete description of how they work so I can decide which ones to use.
Also it is not clear (at least not to me) whether or not PortB is the only port that supports an interrupt change on a pin.
Code: | #define GLOBAL 0x0BC0
#define INT_RTCC 0x0B20
#define INT_RB 0x0B08
#define INT_EXT 0x0B10
#define INT_AD 0x8C40
#define INT_TBE 0x8C10
#define INT_RDA 0x8C20
#define INT_TIMER1 0x8C01
#define INT_TIMER2 0x8C02
#define INT_CCP1 0x8C04
#define INT_CCP2 0x8D01
#define INT_SSP 0x8C08
#define INT_PSP 0x8C80
#define INT_BUSCOL 0x8D08
#define INT_EEPROM 0x8D10
#define INT_TIMER0 0x0B20
#define INT_COMP 0x8D40
|
Thanks for any help and your patience with me I have never used any interrupts-
SophE |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Mar 11, 2006 11:09 pm |
|
|
If you need an additional "interrupt on change" interrupt, the most likely
one would be the Comparator interrupt. The comparator is on Port A.
Look in section 12.0 in data sheet for the Comparator module, and
specifically look in section 12.6 on Comparator interrupts. |
|
![](templates/subSilver/images/spacer.gif) |
John P
Joined: 17 Sep 2003 Posts: 331
|
|
Posted: Sat Mar 11, 2006 11:38 pm |
|
|
You can use the capture/compare inputs as interrupts. That's pins 1 and 2 of port C. If all you want is an interrupt on a rising or falling edge (you do have to decide which) you can just respond to the interrupt and ignore the capture data.
But I'm always dubious about multiple interrupts. If you have lots of things generating them it's easy to get bogged down if everything happens at once. Would it be possible to use a repeating timer and poll the inputs you want to monitor? |
|
![](templates/subSilver/images/spacer.gif) |
Sophi
Joined: 14 Jun 2005 Posts: 64
|
|
Posted: Sun Mar 12, 2006 7:02 am |
|
|
Thanks JohnP and PCM!
SophE |
|
![](templates/subSilver/images/spacer.gif) |
|