I need read my AD inputs only in a specific part of a internal pwm signal. My pwm has a period of 1 ms and initial polarity=low. I know that's possible to synchronize the AD conversion with a internal signal, I want to measure just in the high level from pwm but I don't know how to execute the measure only in a specific part of the signal. can you help me?#MK22FX512VLH12 #processorexpert
Hi
The FTM initialization trigger and channel triggers can be used as PDB input trigger.
If you configure the FTM0 as Edge-Aligned PWM Low-true pulses(set Output on match), you can select FTM channel trigger.
Please refer the project attached. It is based on FRDM-K22F board with Processor Expert using KDS3.2.0.
The Processor Expert seems forget to configure FTMx_EXTTRIG register, so you need to manually add the following code.It is used to enable the generation of the channel trigger when the FTM counter is equal to the CnV register.
FTM_PDD_SetChannelTrigger0(FTM0_BASE_PTR,PDD_ENABLE); /* Enable the generation of the channel trigger when the FTM counter is equal to the CnV register. */
Best Regards,
Robin