CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

external interrupt on rb0

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Urs
Guest







external interrupt on rb0
PostPosted: Fri Nov 09, 2001 3:36 am     Reply with quote

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
PostPosted: Fri Nov 09, 2001 7:01 am     Reply with quote

:=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
PostPosted: Fri Nov 09, 2001 7:03 am     Reply with quote

:=:=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
PostPosted: Fri Nov 09, 2001 9:17 am     Reply with quote

:=:=:=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
PostPosted: Fri Nov 09, 2001 10:07 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group