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

PIC12F635 interrupt_on_change question

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



Joined: 21 Feb 2004
Posts: 20

View user's profile Send private message

PIC12F635 interrupt_on_change question
PostPosted: Wed Mar 29, 2006 5:51 am     Reply with quote

HI,

12C635 provides an interrupt when selected pin/pins change state.

Ok, but, if i select 2 or more pins, how to understand what pin/pins
is effectively changed ?.
Take in mind what i have short pulse to detect, and then, when i read the whole port_a inside the interrupt function, the state of input pin can be changed again ...
any suggestion ??

thanks and regards

Mauro
Ttelmah
Guest







PostPosted: Wed Mar 29, 2006 6:09 am     Reply with quote

Basically you have answered yourself. You can't. The interrupt on change feature, is designed for jobs where the signal is expected 'in' a state for a reasonable time. It is ideal for things like scanning a keyboard, but not for grabbing a narrow pulse.
For edge change detection at high speed, you have to look at using a 'normal' interrupt input (remember you can toggle which edge this responds to, to make it work as an edge detector), or for high speed pulses, use a CTC.
If you need more edges thanyou can handle with this hardware, then instead, you need to consider an external hardware latch.
You can get the response time quite short (less than perhaps tn instruction times), by writing your own 'int global' handler - I have done this in the past for a quadrature decoder based on a small PIC, but you are never going to get very fast handling from the interrupt on change feature.

Best Wishes
Guest








PostPosted: Wed Mar 29, 2006 12:59 pm     Reply with quote

many thanks.

Mauro
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