Output compare mode setup using Flex timer module in KDS 1.2.0 ok to use?

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

Output compare mode setup using Flex timer module in KDS 1.2.0 ok to use?

Jump to solution
885 Views
chadwilliams
Contributor III

I have noticed in the reference manual for KDS1.2.0 page 559 it says:

The current Kinetis SDK driver only supports the generation of PWM signals. The input capture

and output compare will be supported in upcoming Kinetis SDK releases.

 

But in fsl_ftm_driver.c theres a function: FTM_DRV_SetupChnOutputCompare()

so that would indicate the functionality exists already. But there is no example code

to demonstrate output compare mode and Processor Expert doesn't allow me to

select Output Compare mode in the ftm driver component.

 

Output compare mode is necessary for driving motors etc so its an important feature

of many embedded microcontrollers.

 

Can anyone confirm FTM_DRV_SetupChnOutputCompare() does work ?

Labels (1)
0 Kudos
Reply
1 Solution
481 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Chad:

It seems the output compare mode is not yet fully implemented, only the PWM modes (Edge Aligned / Center Aligned / Combined).

However you can use that API you mention in the meantime. It lets you set a channel in output compare mode with a determined compare value and channel output mode (set on match, clear on match, toggle on match). Use the API FTM_DRV_Set_Clock() to change the counting frequency.

You still need to call the function FTM_DRV_Init() and FTM_DRV_Set_Clock() before calling the OutputCompare API, processor expert does it for you if you select "Auto initialization".

Regards!

Jorge Gonzalez

View solution in original post

0 Kudos
Reply
1 Reply
482 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Chad:

It seems the output compare mode is not yet fully implemented, only the PWM modes (Edge Aligned / Center Aligned / Combined).

However you can use that API you mention in the meantime. It lets you set a channel in output compare mode with a determined compare value and channel output mode (set on match, clear on match, toggle on match). Use the API FTM_DRV_Set_Clock() to change the counting frequency.

You still need to call the function FTM_DRV_Init() and FTM_DRV_Set_Clock() before calling the OutputCompare API, processor expert does it for you if you select "Auto initialization".

Regards!

Jorge Gonzalez

0 Kudos
Reply