Measure time between signals with MCPWM capture
Posted: Mon Feb 18, 2019 9:52 pm
Hello,
I am working on an RPM measure program, using Hall sensor input. How can I measure time between signals with the MCPWM capture function without using CPU time? The doc says this hardware unit is able to do it: "The hardware is able to detect the input signal’s edge and measure time between signals. ". However it makes only one timestamp for the last signal. Then the CPU has to run a task at every signal to store it in a value, before the next timestamp overwrites it. If the frequency of the signal is high, it is a high load for the CPU.
The unit should make timestamps for the last 2 signals, then when I need (more rare then the signal e.g. in every 0.1sec), I would take the actual 2 values, and calculate the different. Or it should calculate the signal different directly, and I would just take the value. Is it possible somehow?
Thanks
Laszlo
I am working on an RPM measure program, using Hall sensor input. How can I measure time between signals with the MCPWM capture function without using CPU time? The doc says this hardware unit is able to do it: "The hardware is able to detect the input signal’s edge and measure time between signals. ". However it makes only one timestamp for the last signal. Then the CPU has to run a task at every signal to store it in a value, before the next timestamp overwrites it. If the frequency of the signal is high, it is a high load for the CPU.
The unit should make timestamps for the last 2 signals, then when I need (more rare then the signal e.g. in every 0.1sec), I would take the actual 2 values, and calculate the different. Or it should calculate the signal different directly, and I would just take the value. Is it possible somehow?
Thanks
Laszlo