Hello to everyone,
i have a strange problem with a kinetis k12d microcontrollers, i'm trying to configure FTM0 peripherals with a desiderate frequency of 1kHz, to check correct frequency settings i toggle a pin in the FTM0 interrupt function and see it with oscilloscope. the result is a wrong frequency of 135 kHz, this may be due to wrong settings of MOD and PRESCALER register but i noted that if i change them the frequency result don't change the output frequency looks like indipendent of MOD and PRESCALER settings. I set the FTM0 as follow:
SIM_SCGC6|=SIM_SCGC6_FTM0_MASK;
FTM0_CNTIN = FTM_CNTIN_INIT(0);
FTM0_MOD= 10000 - 1;
FTM0_SC|= FTM_SC_TOIE_MASK | FTM_SC_CLKS(1)|
FTM_SC_PS(0) | FTM_SC_TOIE_MASK;
I set the bus frequency to 25 Mhz
have someone some idea about the problem ?
thank you