Issue with clock on DIY Teensy

Status
Not open for further replies.

jgilbert

Member
Hi Teensy community -

After successfully getting a DIY teensy working for one of my hobbiest projects last year, I decided to try again and this time I've run into trouble. I was hoping someone could help shed some light on what I should do next to troubleshoot. I've narrowed things down to the crystal and re-populated the board a few times with fewer and fewer components until I could isolate the cause.

My design is based on the app-fruits Eagle schematic but the target design has many other extra peripherals (see attached files). However, in my test configuration to isolate my problem, I've only populated the MK20 chip itself plus the crystal and its capacitors and the LED/resistor. I'm feeding VCC from an external 3.3 regulator. I loaded the blink sketch, and compiled it without any changes. In this case, I can successfully upload new code to the MK20 chip using a JLink debugger using loadfile on the .HEX, but I cannot get the clock to start when I instruct the debugger to reset and go.

My first crystal attempt I am using a XC139CT-ND from digikey (ECS-160-8-30B-CKM), 16.000 Mhrz, 8pf SMD 50 ohm crystal and 0603 22pF caps. My caps are wired to ground and there is no ground plane although the whole area is under a vRestrict and just has crystal routing. There is no other signals on the board (naturally) other than the blinking LED (but it doesn't blink.) I've done a similar design for other 16Mhrz chips used in the SAMD21 and figured that would work to not have a ground plane. Probing at the crystal, I cannot see any activity other than a slight voltage on the crystal pins and some very slight ~20Mhrz oscillation that is only a few millivolts. I've also tried swapping the ECS crystal for 18pF PTH external crystal that was used on the T32 reference board and worked on my other design. Still nothing.

I recognize this design has no ground plane and that the caps are connected to ground, but is this really such a major consideration? Why would the MK20 chip be so sensitive to that? The Atmel arm chips are extremely forgiving about their crystals I've noticed which is why I decided to design it the way I did.

In any case, I'd appreciate some advice on how to further debug or diagnose. Is there anything I can do from the JLink prompt to force the crystal to start..?

Also, if the advice is to redesign the board, can someone verify what part number of crystal I should use and/or if I have correctly wired the crystal I have on there now..?

Screen Shot 2017-05-13 at 12.01.17 PM.jpg

The board layout:

Screen Shot 2017-05-13 at 12.20.53 PM.jpg

ZIP file of the Eagle stuff...

View attachment GM1101.zip

FYI: This is an open source / open hardware project- you can read more about what I'm trying to accomplish here:

https://hackaday.io/project/20470-makernet
 
The Teensy 3.x dont use any external capacitors for the 16MHz crystal, there are configurable internal capacitors inside the chip.
 
I have no idea... but what I would try to do:
- add a pullup resistor to Reset
- connect 3.3V to Vbat/pin 21 or solder the dual diode on the pcb





8rb44Ls.png
Teensy pins 3 and 4 are not UART TX/RX, they are CAN BUS TX/RX
 
I have no idea... but what I would try to do:
- add a pullup resistor to Reset
- connect 3.3V to Vbat/pin 21 or solder the dual diode on the pcb
View attachment 10584
Teensy pins 3 and 4 are not UART TX/RX, they are CAN BUS TX/RX

That nailed it. Thank you! I had neglected vBat. As soon as I connected it, it worked. Even worked with a 16mhrz PTH crystal that was hacked onto SMD pads. :) The previous version must have been a bad copy of the MCU or maybe got ESD damage along the way.

I realized the problem with the CAN bus too late (basically two days after I submitted to OSHPark. :( total brain fart on my end.

So per @mlu's advice, do I need to even bother with the external caps..?

Is there a recommended part number for a small crystal?
 
The Teensy core library sets the internal capacitor for a crystal with a load capacitance of 8-10pF. Is the load capacitance of your crystal higher, then use external capacitors. For a crystal with 18pF load capacitance, external 22pF caps are recommended.

Crystal for Teensy: https://forum.pjrc.com/threads/4115...eensy-3-2-uses?p=128797&viewfull=1#post128797
- NDK America NX3225SA https://www.digikey.com/product-detail/en/ndk/NX3225SA-16.000000MHZ-B3/644-1099-1-ND/1468360
- Epson TSX-3225 https://www.digikey.com/product-detail/en/epson/TSX-3225-16.0000MF18X-AC0/SER4070TR-ND/5260855
 
The Teensy core library sets the internal capacitor for a crystal with a load capacitance of 8-10pF. Is the load capacitance of your crystal higher, then use external capacitors. For a crystal with 18pF load capacitance, external 22pF caps are recommended.

Brilliant! thanks for the digikey numbers! Really appreciate the advice and help with this project.
 
Status
Not open for further replies.
Back
Top