AnsweredAssumed Answered

how to set two FTM in one project on use S32DS

Question asked by jinshuai xu on Aug 7, 2017
Latest reply on Aug 7, 2017 by jinshuai xu

           l want to set two FTM in a project ,one FTM is period timer, another is PWM. if l just set one FTM in a project is no problem ,but when I set PWM and period timer in one project at the same time ,the problem occur.who can tell me how to initialize the FTM ,I am very thank you for you response.the next is my setting.


/* Initialize Flex Timer instance as simple timer */
FTM_DRV_Init(INST_FLEXTIMER1, &flexTimer1_InitConfig, &ftmStateStruct);

/* Install handler for the Timer overflow interrupt and enable it */
INT_SYS_InstallHandler(FTM0_Ovf_Reload_IRQn, &ftmTimerISR, (isr_t*) 0);

/* Setup the counter to trigger an interrupt every 100 ms */
FTM_DRV_InitCounter(INST_FLEXTIMER1, &flexTimer1_TimerConfig);
/* Start the counter */


FTM_DRV_Init(INST_FLEXTIMER2, &flexTimer2_InitConfig, &ftmStateStruct1);
FTM_DRV_InitPwm(INST_FLEXTIMER2, &flexTimer2_PwmConfig);
FTM_DRV_UpdatePwmChannel(INST_FLEXTIMER2, 1U, FTM_PWM_UPDATE_IN_DUTY_CYCLE, 0x4000, 0U, true);