External Crystal on Teensy LC with MCUXpresso IDE

Status
Not open for further replies.

gdefoest

New member
Hi all,

I have been working on creating an HelloWorld project with MCUExpresso IDE on the TeensyLC.
I am able to make the LED blink with the internal 4MHz oscillator but when changing to the external 16MHz crystal I could not make it work.
From the datasheet of the MKL26 MCU I can see:
Constraints.png

It looks like for fast crystals the internal caps cannot be used and PCB caps needs to added on the PCB which is not the case as seen in the TeensyLC schematic:
schematic_lc.gif

This is how I configured to used the external 16MHz crystal:
NotWorking.jpg

Is it sure no external caps needs to be used for the TeensyLC crystal?
Anybody able to make the external crystal work?
Something special to configure?

I attached the working project with internal oscillator if anybody needs.

Thanks to all of you in advance!

Guillaume
 

Attachments

  • MKL26_HelloWorld.zip
    686.2 KB · Views: 163
I think it’s mainly to ease people’s life that Paul created the Teensyduino plugin for the Arduino IDE. The Teensyduino core files handle (among others) the boot process and the startup hardware configuration. Since these are automatically included during compilation, Teensy users never struggle with x-tal oscillator startup problems, they simply select the desired CPU speed (and USB configuration) in the IDE’s menu and that’s it.

Since there is excellent Teensy support for the widespread Arduino IDE (and for Eclipse, PlatformIO, VisualCode), why would one struggle with a bare metal approach in an unsupported environment like MCUXpresso?
 
NXP's documentation is littered with wrong info, essentially copy-and-paste errors from other chips.

The KL26 chips do indeed have the internal capacitors.

And just to echo what Frank and Thierry already said, you can find working code in Teensyduino's core library. We know this code works well. It's been used by many thousands of people.

You really should not expect anyone here to thoroughly review your ground-up bare metal code.
 
Thanks to all of you for your input.
Ow I did not expect this about the NXP docs...

My plan is to use the Teensy LC HW as a starting point to learn ARM and the other NXP MCUs (not only the MKL26Z64) this is why I am pushing to use the MCUExpresso :)
I checked the Core Library but was not able to locate where the Clock Init is done in the TeensyLC (I think it was in the Teensy3 folder).
Can you point me to a more specific location?
Also, how did you generate that clock/caps

Thanks in advance!
 
With a quick global (search of) TeensyDuino installed source files in ...\hardware\teensy\avr\cores\teensy3\kinetis.h this comes up:
Code:
#elif (F_CPU == 48000000)
// ...
#elif (F_CPU == 24000000)
//...

Perhaps that will lead to desired answers in ...\hardware\teensy\avr\cores\teensy3\mk20dx128.c:
Code:
#elif F_CPU == 48000000
// ...
#elif F_CPU == 24000000
// …

Compared to the SDK - everything here is single minded and functional and refined to get the Teensy up and running for a defined environment.

If you want an idea of what it takes to get one of these things running read Paul's scattered Teensy4 NXP 1052 - and current Beta - posts that go back some 14+ months when it was sitting on his desk - he got Beta boards out some 5-6 weeks ago - and those boards have a mix of caps on the crystals to test the best doc's he could get under NDA and after. Development is ongoing with 9 releases of software updates and hardware revs yet to come.
 
Last edited:
Status
Not open for further replies.
Back
Top