I'm new to the Kinetis series, but not to microcontrollers in general.
I seem to be finding it really hard to achieve 'stable' settings in modules. i.e. configurations which don't immediately hard fault or "UsageFault"
For example...
The FTM setup seems pretty basic
With 3 channels set up for the R G B diodes of an RGBLED
The crash happens on the very first line of the FTM0_Init....
I have another demo project based on a different chip model with so far as I can tell identical FTM settings... The generated code for that one is different:-
void FTM0_Init(void)
{
/* SIM_SCGC6: FTM0=1 */
SIM_SCGC6 |= SIM_SCGC6_FTM0_MASK;
(void)(FTM0_SC == 0U); /* Dummy read of the FTM0_SC register to clear the interrupt flag */
...
...
Am I missing something? Should I expect these models to be this unstable?
I had another case where the UI didn't seem to "save" the changes I was making in the KSDK component... i.e. if I Generated Code right away, it worked.. but if I went back to the component, the change would be lost, and Generating Code again would give me something incorrect (which crashed)
Kris
Hello Kris,
Have you enable the FTM clock ? If not ,please enable it first like this :
/* SIM_SCGC6: FTM0=1 */
SIM_SCGC6 |= SIM_SCGC6_FTM0_MASK;
And if it still can not work well , please tell me the version of your KDS , and send your project to me ,
i will check the problem for you .
Hope it helps
Alice