Detecting rising edges and falling edges

Status
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.
 
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.
 
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.
Les.
 
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;
IFS1bits.IC7IF=0x00;
}

int main(void);
{
inputcapture_init();
while(1);
}
 
Don't you need to trigger the pin via IC7CON2 bits ICTRIG...

Also.. You have timer 3 selected.... I wonder if it needs turning on??
 
Okay! Which pin are you capturing?... More to the point... Which micro... I was assuming pic24
 
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.
 
Just a related question is it possible with a multi meter to know if a pin is either input or output or analog.

To a certain degree, but it would require a program writing to run on the device, not a passive test - plus external components.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…