FTM Input Capture doesn't work stabile

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

FTM Input Capture doesn't work stabile

2,187 次查看
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,800 次查看
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,150 次查看
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,145 次查看
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,113 次查看
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 项奖励
回复