Trying to do FTM counter synchronization using hardware trigger 2 (FTMx_FLT0), but had no luck so far. I could generate PWM signals though external hardware trigger does not reset the FTM counter. I also noticed that the FTMx_SYNC[TRIG2] is always 0, even though it is set to 1 in the peripheral.c program generated by MCUxpresso Config Tool.
I also tried manually changing the peripheral register directly in MCUxpresso, but it did not work - it always stays at 0 (zero) level. Any help is appreciated.
You could refer to the application note Features of the FlexTimer Module
Chapter 3.11.4. Updating the FTM register with hardware control to get a general code example in bare-metal for configuration of the hardware trigger of FTM of Kinetis MCU´s.
The following code configures the PTB3 pin as FTM0_FLT0. The FTM0_FLT0 is the hardware triggering source TRIG2. Every rising edge of trigger source2 launches a new PWM cycle.
Please take a close look at the register level configuration, because of implementation
FTM could vary between your device. , you will need to make sure that the correct bits are enabled.
The bit for hardware trigger 2 is set successfully in the example.
Also, note that the pins for PWM and FTM0_FLT0 must be routed, setting its corresponding alternative, you can use MCUxpresso config tools for that, as you were doing it before.
I hope that this reference helps you out!
Have a great day,
Diego
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------