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

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

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

跳至解决方案
1,375 次查看
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 ?

标签 (1)
0 项奖励
回复
1 解答
971 次查看
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 项奖励
回复
1 回复
972 次查看
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 项奖励
回复