Other Parts Discussed in Thread: C2000WARE
Tool/software: Code Composer Studio
Hi all,
I try to debug the demo program of "ecap_ex2_capture_pwm.c" based on C2000ware. But I found that the time stamps captured on EVENT1/2/3/4 are different. The debug information is just like below:
ECAP_setEventPolarity(ECAP1_BASE, ECAP_EVENT_1, ECAP_EVNT_FALLING_EDGE);
ECAP_setEventPolarity(ECAP1_BASE, ECAP_EVENT_2, ECAP_EVNT_RISING_EDGE);
ECAP_setEventPolarity(ECAP1_BASE, ECAP_EVENT_3, ECAP_EVNT_FALLING_EDGE);
ECAP_setEventPolarity(ECAP1_BASE, ECAP_EVENT_4, ECAP_EVNT_RISING_EDGE);
cap1Count = ECAP_getEventTimeStamp(ECAP1_BASE, ECAP_EVENT_1);
cap2Count = ECAP_getEventTimeStamp(ECAP1_BASE, ECAP_EVENT_2);
cap3Count = ECAP_getEventTimeStamp(ECAP1_BASE, ECAP_EVENT_3);
cap4Count = ECAP_getEventTimeStamp(ECAP1_BASE, ECAP_EVENT_4);
Based on the code above, I think that cap1Count shoud have the same time stamp value with cap2Count, cap3Count and cap4Count.
But cap1Count sometimes 4 more than other capture counters, or 4 less than other counters.(cap2Count/cap3Count/cap4Count).
I don‘t know what happened. Please help me with it.
Thanks!