AnsweredAssumed Answered

MK22FN1M0AVLH12 FTM2 Two clock gates?

Question asked by Matias Holsve on Jun 28, 2016
Latest reply on Apr 20, 2018 by Zhong Shen



I am using the MK22FN1M0AVLH12 in a project, and need to use all of the FTMs. Everything was fine until i tried to initialize the FTM2 with the FTM_Init() found in the KSDK. It was hardfaulting, with IMPRECISERR code. After looking through i suspected that there was something wrong with the clock, as i could not read the registers with the debugger when the FTM2 clock gate (SIM->SCGC6). When testing the other FTMs with the debugger i stumbled upon another FTM2 clock gate value in SIM->SCGC3, next to the FTM3 clock gate. When enabling this value, the FTM2 responded. I also looked in the datasheet (K22P64M120SF5V2RM) and both of these gate registry entries are listed, with the same description.


The KSDK clock driver is using the SCGC6 registry entry when enabling the FTM2. As this does not activate the clock for the FTM2, the system hardfaults. Changing the driver to enable the FTM2 value in SCGC3, the system works without hardfaulting.


Is this a fault in the driver, in the chip design or in the datasheet? Or maybe all of them.


Best regards
Matias Holsve