AnsweredAssumed Answered

S32K144 FlexTimer settings for free running counter

Question asked by muhammadimranafzal on Jun 16, 2017
Latest reply on Jun 21, 2017 by muhammadimranafzal



I am trying to configure FlexTimer to use a free running counter. I have selected System clock as source of clock. please tell me if I am doing it right and how do i read the status of counter. or please share some code for this FTM configurations.


// FTM0
  FTM0[0].CNTIN = FTM_CNT_COUNT(0); /*initize counter with 0*/
  FTM0[0].MODE = FTM_MODE_WPDIS(1); /*write protection disabled */
  FTM0[0].SC = FTM_SC_CLKS(1); /* clock source selection: System clock*/
  FTM0[0].SC = FTM_SC_PS(3); /* Prescaler */
  FTM0[0].MODE = FTM_MODE_FTMEN(1); /* FTM enable*/