AnsweredAssumed Answered

When I use FTM PWM driver application resets

Question asked by Joseph Gundel on Jun 12, 2015
Latest reply on Jun 15, 2015 by Joseph Gundel

When I use the FTM PWM Hal Drivers my application resets.

 

I am using a K02.

 

I call a hardware init function which sets the pins

void configure_ftm_pins(uint32_t instance)

{

    switch(instance)

    {

        case 0:                         /*FTM0_CH0,1,4,5*/

            PORT_HAL_SetMuxMode(PORTD_BASE,0u,kPortMuxAlt4);

            PORT_HAL_SetMuxMode(PORTD_BASE,1u,kPortMuxAlt4);

            PORT_HAL_SetMuxMode(PORTD_BASE,4u,kPortMuxAlt4);

            PORT_HAL_SetMuxMode(PORTD_BASE,5u,kPortMuxAlt4);

            break;

        default:

            break;

    }

}

I then I do the following.

 

ftm_pwm_param_t ftmParam = {

          .mode                   = kFtmEdgeAlignedPWM,

          .edgeMode               = kFtmLowTrue,

          .uFrequencyHZ           = 240000,

          .uDutyCyclePercent      = 0,

          .uFirstEdgeDelayPercent = 0,

      };

      ftm_user_config_t ftmInfo;

      memset(&ftmInfo, 0, sizeof(ftmInfo));

 

      ftmInfo.syncMethod = kFtmUseSoftwareTrig;

       FTM_DRV_Init(FTM_INSTANCE, &ftmInfo);

 

       FTM_DRV_PwmStart(FTM_INSTANCE, &ftmParam, 0);

              // Issue a software trigger to update registers

       FTM_HAL_SetSoftwareTriggerCmd(g_ftmBaseAddr[FTM_INSTANCE], true);

 

 

My App imediately goes into reset.

 

Am I forgeting anything.

Outcomes