I am new to PWM using FTM. I have worked a bit on KSDK 1.3.0 and FRDMK64F board.
In K64 certain gpio pins can be configured as dedicated PWM pins as per manual.
However, there is no specific example of PWM generation on a pin with a specific period and duty cycle available in KSDK 1.3.0.
In demo_apps there is bubble_level_ftm, but it is not using the PWM pin and neither generating a prefixed duty cycle.
I just want to generate pulses on PWM pin of a desired period and duty cycle.
I thought the following flow of functions was good enough:
|ftmParam.uFirstEdgeDelayPercent = 0;|
|// Enable FTM module and generate PWM|
|memset(&ftmInfo, 0, sizeof(ftmInfo));|
|ftmInfo.syncMethod = kFtmUseSoftwareTrig;|
|FTM_DRV_SetClock(BOARD_FTM_INSTANCE, kClock_source_FTM_SystemClk, kFtmDividedBy1);|
|FTM_DRV_PwmStart(BOARD_FTM_INSTANCE, &ftmParam, BOARD_FTM_CHANNEL);|
But this is not working. Kindly let me know where I am wrong.