If I use this module generate code,the clock was not 80M,and this was 100M.But if Iuse the a new “MBD_S32K14x_Config_Information” module from S32K library ,the clock was 80M,but the LED result wasn't right.
Hi binqin,
The processor works @80MHz or @112MHz
The initialization for the System Clock is computed starting from the CPU frequency value and sets the appropriate timers with the pre-computed value.
So there is no problem that you see the
/* Initialize system timer */
UpdateSystickConfig(10000000);
Furthermore, i do not understand what you say by "the clock was 80M,but the LED result wasn't right."
I've tested the application and the LED is controlled correctly based on the PIT settings: 500ms and 250ms respectively
These are the oscilloscope wave-forms.
(upper signal) CH1 = RED LED @500ms changing rate
(lower signal) CH2 = BLUE LED @250ms changing rate
As you can see the results are OK.
Can you share what you are seeing ?
Hope this helps!
Daniel
Hi Daniel,
I've found the result was right.Is this module display 80M wrong?But the generated code was 100M right?
Regards,
Tony
Hi binqin,
There is nothing wrong. The processor is set to work @80MHz but the UpdateSystickConfig() is using the
Frequency->Ticks transformation, to set the RVR register to 10 000 000 ticks. This will in set up the MCU to operate at 80MHz.
Best regards,
Daniel