FTM Input Capture doesn't work stabile

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

FTM Input Capture doesn't work stabile

2,179件の閲覧回数
alihanc_caliska
Contributor I

Hi all,

I am using twr-kv58f220m board and trying to use FTM module as input capture. I am trying SDK example ftm_input_capture and add some things. I want to read period of my input signal and my signal is 50Hz and 50kHz PWM respectively. I am reading in console very unstable values. Also I cannot write to CnSC register properly. I am watching this register but I cannot change any bit. I cannot use neither ICRST bit nor CHF bit. 

My modified code is attached and output file is also attached. I am waiting for your urgent helps.

Thanks in advance.

ラベル(1)
0 件の賞賛
返信
4 返答(返信)

1,792件の閲覧回数
alihanc_caliska
Contributor I

Hi all,

After a long time I'm here again. The solution that is recommended from @FelipeGarcia isn't working as I want. The problem is that ICRST bit in CnSC register. This bit can never sets, always zero. So the counter doesn't reset. If you know the solution please let me know too.

I solved this issue by using different expression.

Sincerely..

0 件の賞賛
返信

2,142件の閲覧回数
FelipeGarcia
NXP Employee
NXP Employee

Hi,

Sorry for the late reply. Just to understand, to do have the same issue when using the example without modification?

Best regards,

Felipe

0 件の賞賛
返信

2,137件の閲覧回数
alihanc_caliska
Contributor I

Hi,

I tried without modification. In this case, just one result I can have for every loop. When I run the program without modification again I take so unstabile result. I apply  50Hz signal but result sometimes 4ms sometimes 15ms but never 20ms.

Best regards.

0 件の賞賛
返信

2,105件の閲覧回数
FelipeGarcia
NXP Employee
NXP Employee

Hi,

I have this file with few modifications to measure higher frequencies, you can adapt it to your code. Please not that for lower frequencies you will have to modifies as this will not work correctly.

Best regards,

Felipe

0 件の賞賛
返信