Input capture module in MK22FN512VLH12 Microcontroller

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Input capture module in MK22FN512VLH12 Microcontroller

636 次查看
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

标记 (1)
0 项奖励
回复
1 回复

484 次查看
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 项奖励
回复