Input capture module in MK22FN512VLH12 Microcontroller

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Input capture module in MK22FN512VLH12 Microcontroller

567 Views
prasannanaik
Contributor III

Hi,

   I want to measure frequency of a signal (Range: 20 to 70 Hz) with resolution of 0.005 Hz. I was trying to use capture mode of K22f but it is 16 bit capture module. One of my colleague experimented with 16 bit capture and was not able to get the desired resolution due to the problem mentioned in the thread below:

Error in frequency measurement using capture inputs of LPC11U68 

Please suggest a method to measure the input frequency with the desired accuracy using MK22FN512VLH12 microcontroller. Also, please share reference code if possible. I have FREEDOM KINETIS K22F board for evaluation.

Thanks in Advance!!!

Best Regards,

Prasanna

Tags (1)
0 Kudos
1 Reply

415 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi Prasanna,

 

Because the period of the signal is too low, I would suggest if you're using the input capture FlexTimer:

  • Enable the overflow and the trigger interruption for the FlexTimer channel, this to know if the value was triggered by the pulse edge or to know if the timer overflows.
  • Set the double edge capture mode and compare both measurement, if you identify that are to different you could try a work-around or discard the measurement.
  • Reset the CNT (count value) every time the edge triggers.

 

Other approach could be using one of the edges of the signal as a trigger for a timer with a low period, the PIT or FTM module for example. And stop the signal when the interruption triggers again and catch the value. 

 

Hope it can help you.

 

Best Regards,

Alexis Andalon

0 Kudos