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 CCS Technical Support

individual isr for each ioc pin

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



Joined: 25 Mar 2008
Posts: 2

View user's profile Send private message Send e-mail

individual isr for each ioc pin
PostPosted: Tue Mar 25, 2008 3:52 pm     Reply with quote

hi everyone!

i'll try to be direct:
i need something like

#int_rb0
void rb0_change () { ... }

#int_rb1
void rb1_change () { ... }

but since this is not implemented (the preprocessor directives does not exists) i would like to know some hints about a better alternative for this situation.
im working on a high time precision application, so im trying to avoid checking which pin triggered the interrupt. any help would be useful.
Ttelmah
Guest







PostPosted: Tue Mar 25, 2008 4:05 pm     Reply with quote

You have to either check the pins, or use the separate hardware interrupts (depending on the processor involved). The answer is not magic, and there is no magic solution, you need to look at the chip's data sheets, and find one that offers what you want.
A lot of the later 18F chips, have three separate interrupts, as well as the generic 'change' interrupt. However these are edge triggered in one direction, not 'change' sensitive. You can simulate a 'change' function, by reprogramming the active direction in the handler.
Seriously though, testing the pins, only involves a couple of instructions. Given that the overhead of the handler itself is typically over 50 instructions, this is minor.
Other thoughts. You can use the CCP interrupts, as two more interrupts. Again only on one edge though.

Best Wishes
RLScott



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

Re: individual isr for each ioc pin
PostPosted: Tue Mar 25, 2008 4:30 pm     Reply with quote

x_berzerker wrote:
hi everyone!

i'll try to be direct:
i need something like

#int_rb0
void rb0_change () { ... }

#int_rb1
void rb1_change () { ... }

but since this is not implemented (the preprocessor directives does not exists) i would like to know some hints about a better alternative for this situation.
im working on a high time precision application, so im trying to avoid checking which pin triggered the interrupt. any help would be useful.

Don't confuse precision with latency. It is possible to carefully figure out exactly how many cycles it will take to determine that a particular pin has caused an interrupt. You will still know exactly when that pin changed state. It just may be 27 cycles later by the time you figure it out.

Robert Scott
Real-Time Specialties
x_berzerker



Joined: 25 Mar 2008
Posts: 2

View user's profile Send private message Send e-mail

PostPosted: Tue Mar 25, 2008 4:35 pm     Reply with quote

i forgot to mention it. im using 16F886.
unfortunately, apparently the things cant be more direct than checking the trigger pins.
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