View previous topic :: View next topic |
Author |
Message |
maaply Guest
|
New data type and PORT B change interrupt isr |
Posted: Mon Jan 19, 2009 9:35 pm |
|
|
I have two doubt
1.) CCS will support for new data type ?
#typedef directive will it work?
2.) Is it possible to clear the RBIF bit inside the isr routine. because in simulator, i am not able to clear by software.
thanks
maaply |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jan 20, 2009 3:22 pm |
|
|
1. Is your question about #type or typedef ? They are two different
directives. The first one is special for CCS. The 2nd one is part of the
C language. If you have a question, post a test program that shows
the problem. (Post the code in this thread. Don't start a new thread
about it).
2. You can use the clear_interrupt(INT_RB) function. But CCS puts in
code at the end of the #int_rb isr to clear the RBIF interrupt flag. You
should not need to do it. If you have more questions, post your PIC
and your compiler version. Also post a test program that shows the
problem. |
|
|
Ttelmah Guest
|
|
Posted: Wed Jan 21, 2009 3:59 am |
|
|
RBIF, is set, when the PortB latch differs from the value on the pins. This is 'true', till you reset the PortB latch (by reading the port). You cannot clear the RB interrupt flag, till this is done.
Best Wishes |
|
|
Guest
|
|
Posted: Fri Jan 23, 2009 3:23 am |
|
|
Ttelmah wrote: | RBIF, is set, when the PortB latch differs from the value on the pins. This is 'true', till you reset the PortB latch (by reading the port). You cannot clear the RB interrupt flag, till this is done.
Best Wishes |
Thanks, But even i read the PORTB, I am not able to clear the RBIF bit. When control come out from isr, the bit cleared itself. Inside the RB_INT routine the RBIF is '1' always. I need to clear this flag inside the isr.
Or
Give any method, to find which pin got the interrupt signal.
Please help me.
Thanks |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Fri Jan 23, 2009 8:50 am |
|
|
Anonymous wrote: | Thanks, But even i read the PORTB, I am not able to clear the RBIF bit. When control come out from isr, the bit cleared itself. Inside the RB_INT routine the RBIF is '1' always. I need to clear this flag inside the isr. | If the RBIF bit gets cleared I can't think of a reason why you would want to change the behaviour and clear the bit a few microseconds earlier.
Quote: | Or
Give any method, to find which pin got the interrupt signal. | See the CCS provided example file EX_PBUTT.C in your compiler's directory. This example only detects button press or release but that's what you often want. It can easily be modified to detect both actions.
Other examples can be found by using the 'Search' function of this forum and searching for 'int_rb'. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Jan 23, 2009 2:08 pm |
|
|
Quote: | because in simulator, i am not able to clear by software. |
What is your simulator ? I suggest trying another simulator. |
|
|
|