Set FTM MOD in Config Tools FTM general configuration

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

Set FTM MOD in Config Tools FTM general configuration

1,258 Views
aberger
Contributor V

In MCUXpresso Config Tools, when an FTM peripheral is configured, the user is asked to specify the "Timer output frequency [Hz]" as an integer value. Since the FTM is a counter, not all output frequencies will be exact integers. It would actually be more helpful to be able to specify the count modulus, and have the config tool report the count frequency (in Hz, as a float). This way, there are no rounding errors in setting the MOD based on an integer frequency that might not be accessible.

Furthermore, it can be helpful for downstream calculations to set the MOD as a power of 2. For example, I would like to set the count MOD to 2^12 = 4096. On a 60 MHz system clock, this results in an FTM frequency of 14,648.4375 Hz. This is obviously non-integer, and thus not settable from within Config Tools. As a result, I have to manually add code to correct the FTM MOD outside of peripherals.c code generated by Config Tools.

Tags (3)
0 Kudos
Reply
1 Reply

809 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Andy,

Thank you for reporting this request. But the FTM component is based on the fsl_ftm driver API that is provided in the SDK. It is a limitation of the fsl_ftm driver, see the FTM_SetupPwm() function description.

We will process your request as opportunity for improvement of the fsl_ftm driver and FTM component API.

Best Regards,

Marek Neuzil