View previous topic :: View next topic |
Author |
Message |
Urs Guest
|
external interrupt on rb0 |
Posted: Fri Nov 09, 2001 3:36 am |
|
|
hello
ext_int_edge(edge) determines when the external interrupt is acted upon. (rising or falling) Is it possible to define both? An interrupt on rising and falling edge?
thanks urs
___________________________
This message was ported from CCS's old forum
Original Post ID: 1028 |
|
|
Eric Belanger Guest
|
Re: external interrupt on rb0 |
Posted: Fri Nov 09, 2001 7:01 am |
|
|
:=hello
:=ext_int_edge(edge) determines when the external interrupt is acted upon. (rising or falling) Is it possible to define both? An interrupt on rising and falling edge?
:=thanks urs
Hi,
I did the same thing in a project a few time ago. Just toggle the polarity detection bit in Option Register:
// Change the polarity of the detection on RB0
Option = Option ^ 0x40;
Be sure to add the following at the begining of your code:
#BYTE Option = 0x81
Hope this help,
Eric
___________________________
This message was ported from CCS's old forum
Original Post ID: 1031 |
|
|
Eric Belanger Guest
|
Re: external interrupt on rb0 |
Posted: Fri Nov 09, 2001 7:03 am |
|
|
:=:=hello
:=:=ext_int_edge(edge) determines when the external interrupt is acted upon. (rising or falling) Is it possible to define both? An interrupt on rising and falling edge?
:=:=thanks urs
:=
:=Hi,
:=
:=I did the same thing in a project a few time ago. Just toggle the polarity detection bit in Option Register:
:=
:=// Change the polarity of the detection on RB0
:=Option = Option ^ 0x40;
:=
:=Be sure to add the following at the begining of your code:
:=#BYTE Option = 0x81
:=
:=Hope this help,
:=
:= Eric
I forgot to mention you should do it in your EXTernalInterrupt Handler function!!!
___________________________
This message was ported from CCS's old forum
Original Post ID: 1032 |
|
|
Tom Theron Guest
|
Re: external interrupt on rb0 |
Posted: Fri Nov 09, 2001 9:17 am |
|
|
:=:=:=hello
:=:=:=ext_int_edge(edge) determines when the external interrupt is acted upon. (rising or falling) Is it possible to define both? An interrupt on rising and falling edge?
:=:=:=thanks urs
:=:=
:=:=Hi,
:=:=
:=:=I did the same thing in a project a few time ago. Just toggle the polarity detection bit in Option Register:
:=:=
:=:=// Change the polarity of the detection on RB0
:=:=Option = Option ^ 0x40;
:=:=
:=:=Be sure to add the following at the begining of your code:
:=:=#BYTE Option = 0x81
:=:=
:=:=Hope this help,
:=:=
:=:= Eric
:=
:=I forgot to mention you should do it in your EXTernalInterrupt Handler function!!!
If the input status is unknown at startup, you'll probably want to read the input level first in order to know what edge to select after startup, else you might never detect the first trigger.
Tom
___________________________
This message was ported from CCS's old forum
Original Post ID: 1035 |
|
|
Tomi Guest
|
Re: external interrupt on rb0 |
Posted: Fri Nov 09, 2001 10:07 am |
|
|
It would be better to use one of the portB.4-7 bits and use the port_B change IT. It is a "native" rising-falling edge detector.
:=hello
:=ext_int_edge(edge) determines when the external interrupt is acted upon. (rising or falling) Is it possible to define both? An interrupt on rising and falling edge?
:=thanks urs
___________________________
This message was ported from CCS's old forum
Original Post ID: 1036 |
|
|
|