Reading of the current value of mcpwm capture timer

zwer97
Posts: 11
Joined: Wed Dec 25, 2019 5:43 pm

Reading of the current value of mcpwm capture timer

Postby zwer97 » Wed Dec 25, 2019 6:11 pm

Hi there
I'm using mcpwm_capture_signal_get_value() function to get the time, when capture of signal occured. Howewer, I also need to get in-between values of timer to know how much time has left after capture event. How is it possible? In MCPWM library there is no function to read current timer value. I tried to setup TIMER_0 (TIMER_GROUP_0) to measure this time, so in the isr handler function I read TIMER_0 value and than set it to 0, but it shows values with error +-15% in relation to capture signal. What is wrong with this?
Measured values:
Time between MCPWM captures TIMER_0 values
1451790 1520008
1602644 1508360
1646629 1758852
1539540 1564140
and so on..

Who is online

Users browsing this forum: No registered users and 266 guests