AnsweredAssumed Answered

ftm_hal_set.... dont works for me

Question asked by Alexey Usoltsev on Nov 26, 2015
Latest reply on Nov 27, 2015 by Alexey Usoltsev

HI!

I've got a problem with KSDK and FTM_HAL.

I want to set PWM with KSDK but fails to do it. After that I've added fsl_ftm driver and succeed to run 1 channel. The problem is I can't execute ftm_hal_set commands.

For example(simpliest main) :

 

  /* Write your code here */

  /* For example: for(;;) { } */

  FTM_HAL_SetWriteProtectionCmd(FTM0_BASE_PTR,false);

 

//  FTM0_MODE &=  ~FTM_MODE_FTMEN_MASK;//unable mod update

 

  FTM0_MOD=1000;

  FTM_HAL_SetMod(FTM0_BASE_PTR,1050);

 

  FTM_HAL_SetChnCountVal(FTM0_BASE_PTR,CHAN3_IDX,600);

  uint16_t cnt=FTM_HAL_GetChnCountVal(FTM0_BASE_PTR,CHAN3_IDX);

  while(1)

  {

  }

 

Without  FTM0_MODE &=  ~FTM_MODE_FTMEN_MASK (commented in the code)  FTM_HAL_SetMod(FTM0_BASE_PTR,1050) and FTM0_MOD=1000 do nothing since write to it is protected. But why FTM_HAL_SetWriteProtectionCmd(FTM0_BASE_PTR,false) do nothing?

Also FTM_HAL_SetChnCountVal(FTM0_BASE_PTR,CHAN3_IDX,600) dont changes CHnV: cnt!=600(according to FTM_HAL_GetChnCountVal(FTM0_BASE_PTR,CHAN3_IDX) and the info on my oscilloscope).

 

Are there any examples of usage of bare FTM_HAL without driver? Controller is mkv10z32.

 

Best regards,

Alexey,

Outcomes