View previous topic :: View next topic |
Author |
Message |
iyobor
Joined: 30 Mar 2004 Posts: 7
|
multiple interupts |
Posted: Sat Apr 10, 2004 5:16 am |
|
|
Hello everyone
Just moved ccs from picbasic and discovered that i can't use my PCM for 18F series.
In my project i used an 18F452 which had 3 ext interupts pins RB0-RB2
Does anyone know of any 16F series or 17C that have got this feature so that i can use PCM ?
Iyobor |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Sat Apr 10, 2004 9:50 am |
|
|
One way is to use PIC16F873/4/6/7 and use the RB0 interrupt and the two capture (CCP1 and CCP2) interrupts. |
|
|
iyobor
Joined: 30 Mar 2004 Posts: 7
|
|
Posted: Sat Apr 10, 2004 10:59 am |
|
|
Thanks Ali
But that is not an option for me as i am using one of the capture (CCP2) interrupts. To measure period in my program
iyobor |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Sat Apr 10, 2004 5:59 pm |
|
|
Let's say you have three interrupt sources 1,2 and 3, and you want to interrupt on rising edge. Connect sources 1 and 2 to RB0 via an OR gate, and connect sources 2 and 3 to CCP1 via another OR gate. When you get an interrupt, in the ISR you can check the flag bit of the other interrupt. If it is also set that means source 2 has interrupted. Otherwise the source is source 1 or source 3, depending on the ISR you are in. I think this method should work. |
|
|
iyobor
Joined: 30 Mar 2004 Posts: 7
|
|
Posted: Sun Apr 11, 2004 6:46 am |
|
|
Thanks Ali
It makes sense
Iyobor |
|
|
|