|
|
View previous topic :: View next topic |
Author |
Message |
ik1wvq
Joined: 21 Feb 2004 Posts: 20
|
PIC12F635 interrupt_on_change question |
Posted: Wed Mar 29, 2006 5:51 am |
|
|
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
|
|
Posted: Wed Mar 29, 2006 6:09 am |
|
|
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
|
|
Posted: Wed Mar 29, 2006 12:59 pm |
|
|
many thanks.
Mauro |
|
|
|
|
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
|