I'm using part of freqMeasureMulti to measure time intervals without using flextimer. flextimer is a bit much for me to understand and this is work around that uses documented and tested commands. I use a 74HC4046 PLL chip and
"FREQMEASUREMULTI_MARK_ONLY -> A new value becomes available at each falling ramp and contains the time since the previous rising ramp. Thus, only the "high time" of the signal period is returned."
The 74HC4046 has 2 inputs and an output (pin 1) that goes high when the first input goes high and goes low when the second input goes high, an edge-triggered RS flip flop. Using freqMeasureMulti I can measure the time between first edge and second edge with resolution based on bus clock instead of 1 usec resolution. Compiling for 48 MHz gives a bus clock of 48 MHz. (72 MHz gives bus clock of 36 MHz).
In the past I also tried ARM_DWT_CYCCNT; and SYST_CVR; but I got occasional bad readings. As Paul mentioned in an earlier thread
"These interrupt approaches have many pitfalls, as we're seeing in this conversation. "
I think flextimer is a better approach for those who understand it. Just thought I'd mention this option.
"FREQMEASUREMULTI_MARK_ONLY -> A new value becomes available at each falling ramp and contains the time since the previous rising ramp. Thus, only the "high time" of the signal period is returned."
The 74HC4046 has 2 inputs and an output (pin 1) that goes high when the first input goes high and goes low when the second input goes high, an edge-triggered RS flip flop. Using freqMeasureMulti I can measure the time between first edge and second edge with resolution based on bus clock instead of 1 usec resolution. Compiling for 48 MHz gives a bus clock of 48 MHz. (72 MHz gives bus clock of 36 MHz).
In the past I also tried ARM_DWT_CYCCNT; and SYST_CVR; but I got occasional bad readings. As Paul mentioned in an earlier thread
"These interrupt approaches have many pitfalls, as we're seeing in this conversation. "
I think flextimer is a better approach for those who understand it. Just thought I'd mention this option.