AnsweredAssumed Answered

Struggling to debug FTM0_CH0 on MKE02Z64

Question asked by Arti D on Jul 15, 2016
Latest reply on Jul 20, 2016 by Arti D
Branched to a new discussion

Hello All,

 

I have already working hour meter applicaiton on MKE02Z64 for our applicaiton. I am trying to add new feature, utilizing the PWM of the system. I took FREEDOM board sample code "FTM_EPWM_demo" For my applicaiton we are using FTM0CH0 I changed all the configuration to FTM0. below is the code.

While debugging after it successfully runs FTM_PWMInit(). It doesnt pass beyond this function  FTM_SetFTMEnhanced(FTM0); after first lne of this function it jumps to default_isr funciton in vectors.c

 

I am not able to understand whats wrong??? did I missed naythign while setting up. Please can some one help its kind a urgent. Thanks a lot

AD

 

    FTM_PWMInit(FTM0, FTM_PWMMODE_EDGEALLIGNED, FTM_PWM_HIGHTRUEPULSE);

 

    /* FTMEN enable */

    FTM_SetFTMEnhanced(FTM0);

    /* update MOD value */

    FTM_SetModValue(FTM0, 9999);

    /* set clock source, start counter */

    FTM_ClockSet(FTM0, FTM_CLOCK_SYSTEMCLOCK, FTM_CLOCK_PS_DIV1); 

    /* enable FTM0 interrupt in NVIC */

    NVIC_EnableIRQ(FTM0_IRQn);

    /* setup call back function for interrupt */

    FTM_SetCallback(FTM0, FTM0_Task);

    /* enable FTM0 overflow interrupt */

    FTM_EnableOverflowInt(FTM0);

Outcomes