how to set two FTM in one project on use S32DS

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

how to set two FTM in one project on use S32DS

Jump to solution
1,954 Views
jinshuaixu
Contributor V

           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);
INT_SYS_EnableIRQ(FTM0_Ovf_Reload_IRQn);

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

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);

Labels (1)
Tags (1)
0 Kudos
1 Solution
1,482 Views
jinshuaixu
Contributor V

sorry to every one ,one friend remind me just now,and l have checked FTM1 CLOCK is not set,this is the reason of the problem,let us progress and come on together .

View solution in original post

0 Kudos
1 Reply
1,483 Views
jinshuaixu
Contributor V

sorry to every one ,one friend remind me just now,and l have checked FTM1 CLOCK is not set,this is the reason of the problem,let us progress and come on together .

0 Kudos