Hi
I have used the CCP pin to do the falling edge detection. With the help of scope, I have found that sometimes it detects the rising edge instead. The input clock is about 1.6MHz. The code to configure the pin is as follows. Any suggestions to make it reliable? Or is there any specific requirement to the input clock?
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOL);
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER2);
GPIOPinConfigure(GPIO_PL4_T2CCP0);
GPIOPinTypeTimer(GPIO_PORTL_BASE, GPIO_PIN_4);
// configure the timer to capture falling edge once
TimerConfigure(TIMER2_BASE, TIMER_CFG_SPLIT_PAIR|TIMER_CFG_A_CAP_COUNT);
TimerControlEvent(TIMER2_BASE,
TIMER_A,
TIMER_EVENT_NEG_EDGE); // _BOTH_EDGES, _POS_EDGE
TimerLoadSet(TIMER2_BASE,
TIMER_A,
1);
TimerMatchSet(TIMER2_BASE, TIMER_A, 0);
Thank you,
-Hailin