Adding countToNanosecond to FreqMeasure

Status
Not open for further replies.

turtle9er

Well-known member
Hi,

I am working on a project where I need the nanosecond count that FreqMeasureMulti provides, however need to use pin 3 due to already made circuit board. Can I just add the same bit of code that does the nanosecond into freqmeasure.cpp? I guess another question is why can't we use pin 3 with FreqMeasureMulti. Are they not both using FTM clocks? Thanks in advance.
 
Thanks that is awesome. After asking the question I realized how easy it was to change. I does not matter anymore, but I am still interested why freqMeasureMulti can't use pin 3, but freqMeasure can only use pin 3. I tried to search for the answer but could not find it. Thanks again.
 
but I am still interested why freqMeasureMulti can't use pin 3, but freqMeasure can only use pin 3.

The pins depend on which of the hardware timers inside the chip are used. Some limited options are available to change timers in util.FreqMeasureCapture.h.

FreqMeasureMulti is hard-coded to use the FTM0 timer.

If you *really* want to dive into the details, the reference manual has all the details on these timers and the hardware config. But the info is very complex and a lot to read.
 
Status
Not open for further replies.
Back
Top