View previous topic :: View next topic |
Author |
Message |
martint88
Joined: 11 Feb 2011 Posts: 5
|
Interrupt-On-Change on PIC16F1933 |
Posted: Fri Feb 11, 2011 10:04 am |
|
|
Hello,
I need to use the interrupt on change of this chip. It has different flags for the change of each pin in Portb. My problem is I cant find out how to write the isr for each pin. I cant find the preprocessor directive to do so.
I'm using it on RB0, so it first tried #int_RB0 but that doesn't compile.
Is it possible to use this feature?
Thank You |
|
|
ALPL
Joined: 29 Mar 2009 Posts: 30
|
INT on change RB |
Posted: Fri Feb 11, 2011 11:16 am |
|
|
Hi, you have to use #INT_RB (for port B-pins) for your interrupt routine and then check in the interrupt routine which pin has changed its state. There is no extra #INT_RB0, etc for each single pin.
BR
ALPL |
|
|
martint88
Joined: 11 Feb 2011 Posts: 5
|
|
Posted: Fri Feb 11, 2011 11:32 am |
|
|
Thank you for the help.
Is there any way to check the IOCBF register without using ASM? |
|
|
ALPL
Joined: 29 Mar 2009 Posts: 30
|
IOCBF |
Posted: Fri Feb 11, 2011 11:42 am |
|
|
Yes, you can - just add following statement at the beginning of your code (after the #include ...):
#byte IOCBF = 0x396 // located in bank 7
Then later in your code you can aread/write IOCBF like a normal variable. |
|
|
martint88
Joined: 11 Feb 2011 Posts: 5
|
|
Posted: Fri Feb 11, 2011 11:51 am |
|
|
Thank you very much |
|
|
|