FTM triger ADC through Trigmux and PDB for center aligned PWM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FTM triger ADC through Trigmux and PDB for center aligned PWM

241 Views
Kapila
Contributor II

Document Number: AN5303

In motor drive control for continuous ADC triggering FTM is used. The code is explained in AN5303.

However it is not clear from S32K RM how address or the MUX slected. 

Configure the TRGMUX module to trigger ADC0 by FTM0 through the PDB0 module by writing 0x16 to the SEL0 bit field in the TRGMUX_PDB0 register.

I could not understand how 0X16 is generated.

Thanks for explaining.

Regards,

Kanakaraju kappila 

0 Kudos
1 Reply

219 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @Kapila 

 /* Set FTM as a trigger source for PDB0 */
 TRGMUX->TRGMUXn[TRGMUX_PDB0_INDEX] = TRGMUX_TRGMUXn_SEL0(0x16);

If you refer to section 19.4.1.1 (TRGMUX memory map) of the S32K1xx Series Reference Manual, Rev. 13, you can see Table 19-1 (Select Bit Fields) provides the list of the trigger inputs of the TRGMUX and the corresponding value to selects as the output. So, as it is shown in the following image, the 0x16 corresponds to FTM0. 

VaneB_0-1706128502565.png

 

B.R

VaneB

0 Kudos