• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Detecting rising edges and falling edges

Not open for further replies.
I am finding a very typical issue that in input capture i am not detecting the rising edges this i am saying because i dont get input capture interrupts . I am giving feedback of pulse input from one of the port pins back to input capture module. In software i am toggling the port based on some external condition. My doubt is if the software is busy running some other applications it may miss this event. Can i connect a capacitor from port pin to input capture and make it slow rising so that it detects the edges. Please suggest.

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
The CCP module works independent to the rest of the chip.... If you set the CCP to catch a rising edge, it wont miss...
BUT!! if you are only capturing a single rising edge, why use the CCP module.... The int pins can do this..
No not a single rising it is a continuous frequency signal. Not able to get a single input capture interrupt is happening. i am using PIC micro controller. But i am getting the input capture inputs in debug mode. Very confused. Please suggest. That is the behavior is as expected in debug mode but i flash it as standalone it does not work.

Les Jones

Well-Known Member
Most Helpful Member
Have you configured the interrupt on change to interrupt on the correct edge ? Are you clearing the interrupt on change bit at the end of your interrupt handler routine ?
Edit. Forget this post. I did not read your original post properly. I thought you were using interrupt on change.
Please post a more-complete description of your problem, including (at best) schematic, software environment/version.
There is all manner of false or unhelpful advice possible otherwise
This is my code. The full program is big one i have showing here only input capture alone.

void inputcapture_init(void)
IC7CONbits.ICM = 0x03;
IC7CONbits.ICI = 0x00;
IC7CONbits.ICTMR = 0x00;
IFS1bits.IC7IF = 0x00;
IEC1bits.IC7IE = 0x01;

void __attribute__((__interrupt__)) _IC7Interrupt(void)
inputcapture_u8 = TRUE;
ic7_buffer_u16 = IC7BUF;

int main(void);
Thank you able to solve the issue. In debug mode the input capture pin was configured by default as input hence working. In flashing mode the pin was configured as analog input and not working. Need to write a line to actually configure as digital input.
Not open for further replies.

Latest threads

EE World Online Articles