Kinetis clock tool makes broken code

cancel
Showing results for 
Search instead for 
Did you mean: 

Kinetis clock tool makes broken code

125 Views
anon-e5119c289a
Contributor I

Using the tool as a MKV11Z64xxx7. Configuring MCG for 16MHz crystal-driven oscillator, FEE mode with FRDIV=512, FLL *1280 to obtain 40MHz core, 20MHz bus/flash, and 16Mhz OSCERCLK for CAN bitrate. Tool generates code that hangs, MCG won't finish switching from FEI to FEE.

Tried making my own version based on the ref manual steps. Was able to get the oscillator going (based on scoping the crystal), and my code doesn't hang, but cannot get anything on OSCERCLK (always high) when routed to CLKOUT. Bus clock also appears to not be on the crystal source, in spite of the fact that my OSC and MCG registers match the proposed values provided by the tool. What's the secret here?

0 Kudos
2 Replies

55 Views
anon-e5119c289a
Contributor I

This fixes the problem, thank you. However, the documentation and clock tool (or errata) should be updated to indicate that OSCERCLK will not be generated when the oscillator is set to high-gain external crystal mode, and switching the FLL to OSCCLK source will fail.

0 Kudos

55 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi David,

Have you try to configure the OSC mode to “Using oscillator with external crystal (low power)”?

low power Clocks Tool.png

I only have the TWR-KV11Z75M board, the crystal on it is 10MHz. After configure the OSC mode to “Using oscillator with external crystal (low power)”, the PTC3 pin can output OSCERCLK waveform.

I attached "SDK_2.0_MKV11Z64xxx7_CLKOUT16MHz.zip" here.

I have test the project "10MHzCLKOUT" on TWR-KV11Z75M board. You can try to test the "16MHzCLKOUT" on your custom board.

test project.png

These two projects was generated by using "KSDK Project Generator(REV 2.3)" tool.

KSDK Project Generator.png

I also attach the files that generated by Clocks Tool and Pins Tool.

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos