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 ?
解決済! 解決策の投稿を見る。
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
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