FTM Input Capture doesn't work stabile

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

FTM Input Capture doesn't work stabile

1,663 Views
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.

Labels (1)
0 Kudos
4 Replies

1,276 Views
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 Kudos

1,626 Views
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 Kudos

1,621 Views
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 Kudos

1,589 Views
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 Kudos