Input capture module in MK22FN512VLH12 Microcontroller

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Input capture module in MK22FN512VLH12 Microcontroller

1,063件の閲覧回数
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

ラベル(2)
タグ(1)
0 件の賞賛
返信
1 返信

911件の閲覧回数
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 件の賞賛
返信