Custom Teensy Startup Question

Status
Not open for further replies.

madmattd

Well-known member
I've got somewhat similar behavior to this timely thread, but I didn't want to clutter that thread up with my potentially different issue.

I've made my first custom Teensy-based board (versus daughter-boarding one on), using the MKL04 purchased from Paul and a blank MK20DX256VLH7. Schematic of the Teensy section should match Paul's for the T3.2, but I've included it here in case someone sees something I missed.
Teensy_Schematic.jpg

And the relevant board layout as well. The USB trace lengths match within a very small margin (I forget exactly, but we're talking a couple thousandths of an inch). The crystal was given it's own ground island connected to pin 31, with a via on the other side of said pin connecting to the main ground pours.
Teensy_Board.jpg

The behavior I see is the following:
Fresh power-up: Reset is low, with brief pops up to about 2.8V every ~50us (see screencap). Program is high at 3.28V.
ResetPinRAW.jpg
When I short the program header (I don't have a button, but you can see the program and ground pins on the header near the MKL04 above), reset goes to 0V until I release the button, then goes high to 3.225V for a while (~110ms on the trace below), then goes low, pulses again at the 50us interval for a few cycles (15 in the trace shown), then stays low for a while (seems to vary, but several hundred ms), before returning to high and staying there until I power cycle the whole shebang.
ResetPinPressRelease.jpg

At no time does Windows (Win10) ever show any sign of seeing the device (no ding-dong, no pop up, never appears in device manager that I can find, attempting to program via the Arduino IDE does not ever see the board, etc).

I don't have access to a proper oscilloscope, just this Saleae Logic 8 logic analyser, which seems to have no luck probing the crystal (I'm guessing too much capacitance?). The crystal I used was a TSX-3225.

Any thoughts?
 
Last edited:
Couple of comments:
Overall, this looks like a pretty good layout. For example: you isolated the crystal well, ran a guard ring around it on top and also no signals underneath. However, there are a few nearby signals like the 3.3V power bus and the RX3/Tx3 line that pass pretty close.
USB connections look OK.
Bootloader connections look OK.
Not crazy about feeding chips power without putting the de-coupling cap between the power source and the pin, but Pauls designs do the same thing and work.
I don't attach the GND of the decoupling cap to the guard ring around the crystal but Paul does, so that seems to work also.
No separate AGND signal traces makes me wonder why you bothered with the ferrites and so on. If the ADC is not being used, you can drop all that. (ADC should still get power, but decoupling, and so on is not required).
Not happy with some signals being routed right under power lines in parallel - RX3 and TX3 for example. Can lead to EMI issues.
Unless you are expecting to use this device as a USB master, you can simply GND the USB ID line at the USB connector. You still want to connect PTA6 on the bootloader and PTA1 on the MK20, however.
So that's it for the connections.

For a comparison, here is my section under the MK20 where I routed my signal lines to the bootloader chip. Note the use of two surface mount jumpers to bring power and the reset signal to the bootloader chip, without breaking the GND plane under the thing. I have a ground plane fetish.
Bottom.gif

The pulses, IIRC are the MK20 heartbeat, indicating the chip is live. I wonder if the MKL04 has a loose connection, bad solder, etc. I would double-check those joints.
Also, I would check the continuity between the two chips' pins using the Ohm-meter portion of a DMM (NOT the beeper, which will kill your chips!).
 
Last edited:
Not crazy about feeding chips power without putting the de-coupling cap between the power source and the pin, but Pauls designs do the same thing and work.
Never thought of doing it that way, though it makes some sense. Something I'll keep in mind in the future.

I don't attach the GND of the decoupling cap to the guard ring around the crystal but Paul does, so that seems to work also.
On mine the decoupling cap GND does not connect to the guard ring, I kept them entirely separate. I see from the screenshot that it looks like it does, but it actually doesn't (I also checked on the physical boards and confirmed this). Though I thought I cleaned up the messy ring edge that can be seen in the below zoom-in...
Crystal.PNG

No separate AGND signal traces makes me wonder why you bothered with the ferrites and so on. If the ADC is not being used, you can drop all that. (ADC should still get power, but decoupling, and so on is not required).
No, I am not using any analog features, but I also didn't really know what the ferrites and such were for, so I just copied the components as a just-in-case. So you're saying I could omit both ferrites, R4, and C10, C11, C12?


Not happy with some signals being routed right under power lines in parallel - RX3 and TX3 for example. Can lead to EMI issues.
Yea, I got sloppy on a few of those. At the moment though, I have not installed any peripheral chips, so those lines are not doing anything. Serial3 is connected to a GPS chip, so the good news is that it is a slow connection (9600 baud, though I will try to run ~57600 if I can) I hadn't noticed the 3V3 signal under the fringe of the guard ring before, whoops. I was trying to keep everything away there, and almost did it... The guard ring was done late in the game, I'm blaming that :)

Unless you are expecting to use this device as a USB master, you can simply GND the USB ID line at the USB connector. You still want to connect PTA6 on the bootloader and PTA1 on the MK20, however.
So that's it for the connections.
Probably not going to use USB master (and iirc it isn't enabled on the Teensy side yet anyway), but I threw the connection in just in case.

The pulses, IIRC are the MK20 heartbeat, indicating the chip is live. I wonder if the MKL04 has a loose connection, bad solder, etc. I would double-check those joints.
Also, I would check the continuity between the two chips' pins using the Ohm-meter portion of a DMM (NOT the beeper, which will kill your chips!).
According to what I've read posted on the forums here, I was encouraged with the pulsing and everything else, but the lack of any sort of recognition on the PC side was sad. Joints all looked really solid when I checked them last night (under a high-power microscope), but I'll give it another look. And I'll check those continuities (I assume you mean the MKL04 to MK20 pins). BTW thanks for the Eagle lib for the Teensy chips, I could have made the files but yours removed one extra layer of stuff for me to screw up :) And thanks for the pointers on the layout. I'm getting better with each layout I do, but I'm still a rookie at this.
 
Last edited:
Looks like you are using the super size MKL04. In my designs I use the 4 mm x 4 mm QFN version which has a bottom thermal pad the I solder to the board GND. Probably not an issue if you are seeing the 50 ms pulse.

I had trouble when I first started making these and found, among other things, that the cheap (and old) K20s I bought from China were likely defective. Since I started using new ones from Mouser or Digikey I have never had a problem.
 
Looks like you are using the super size MKL04. In my designs I use the 4 mm x 4 mm QFN version which has a bottom thermal pad the I solder to the board GND. Probably not an issue if you are seeing the 50 ms pulse.

I had trouble when I first started making these and found, among other things, that the cheap (and old) K20s I bought from China were likely defective. Since I started using new ones from Mouser or Digikey I have never had a problem.

Yes, I used the TQFP instead of the QFN. I could have handled it, as this board and prior iterations of it has 3 sensor chips in the same 3mm X 3mm 0.5mm pitch but I'm not that strapped for space, and I'm hand-placing all these chips for hot plate reflow, so anything to make my life easier, and less likely to go wrong!

This MK20 was fresh out of the sealed bag from Mouser. I buy almost all my components from Mouser or Digikey for that exact reason. I get them quicker, and know what I'm getting vs. China.
 
You can drop FB1, FB2, C10(? the 2.2uF), R4. I would keep C12, C11 in case that helps with stability but VSSA can go to GND and VREF-H/VCCA can go to 3.3V.

As far as the crystal goes, I connect my GND to the decoupling cap on the outside, while connecting the guard ring and the GND for the crystal on the inside - see the image above.

Are you using a 8pF, 16MHz crystal like one of these: http://www.digikey.com/product-sear...=0&page=1&quantity=0&ptm=0&fid=0&pageSize=500

PS: Going forward, please save the schematics in a PNG or GIF format to make them readable.
 
Last edited:
Are you using a 8pF, 16MHz crystal like one of these: http://www.digikey.com/product-sear...=0&page=1&quantity=0&ptm=0&fid=0&pageSize=500

PS: Going forward, please save the schematics in a PNG or GIF format to make them readable.

All the screenshots I uploaded were PNGs (.jpg is crappy for reading text, which I assume is your point too) that's how they are saved on my computer and I assumed that's how they would upload, but your comment made me check, and sure enough they're .jpg on here. Weird. More interesting is the later picture I uploaded from a different computer did come in as a PNG. I tried uploading again to this post (same computer as the OP), and they're coming in as .jpg despite being .png on the hard drive. Odd, probably something with my browser settings on this particular computer, I'll dig into that later.


I used a 9pF crystal, as I read on Paul's store page for the MKL04 that the spec was for 8-10pF. I used this part, I linked it in my OP but it's kinda buried in there. Perhaps the ESR I used (60Ohm) is too low?


I checked the resistance between all MK20<->MKL04 pins (the actual pins on the chip, and not the solder pad, so as to check the solder connection at the same time). All are connected well, resistance of ~0.2Ohms. Same on the USB traces (of course there's a 30Ohm resistor in there, but continuity is good from jack to pin).
 
I also put the logic analyzer on the USB lines, and did a couple plug/unplugs. The first image is where I plugged in and unplugged the board 3 times. The second is a zoom-in of the voltage peak following an insertion of the USB cable. Peak voltage is ~1.1V. (Saved these as .gif, they also ended up as .jpg somehow. Double weird).

USB 3 Connections.jpg
USB Connection.jpg
 
Is that D+ or D- or the VUSB?

Is there perhaps a short on the board causing the polyfuse to blow?

Both.

Re-did the recording, with D+ on Ch4, D- on Ch5, and 3V3 from the regulator (downstream of the polyfuse) on Ch6, to see how stable that voltage is (quite).

USB Connections.jpg

Zoom-in:
USB connection Zoom.PNG
 
Last edited:
And you grounded prog at least once prior to sticking in the USB port? Apologies if this is a obvious question! (Of course you did. Never mind)

Do you see activity on the lines between the mk20 and the mkl04 once you hit prog?
 
And you grounded prog at least once prior to sticking in the USB port? Apologies if this is a obvious question! (Of course you did. Never mind)

Do you see activity on the lines between the mk20 and the mkl04 once you hit prog?

No, ask the stupid questions. I think I had before, but anyway I grounded it, then connected power, then released. No change, including on the logic scanner.

I didn't leave myself nice test points for the SWD pins like I did the USB and reset, but I was able to hold a probe onto the pin while grounding (and releasing a half second or so later) the program pin. The first plot is PTA0 of the MK20 (though held on the PTB0 of the MKL04 since those pins are much bigger!). The second is PTA3 (pin 15/PTA7 of the MKL04). My understanding is that PTA0 is the clock line, and the PTA3 is the data? Since I didn't have test points, I was hand-holding the probe on the pin (carefully!), so I couldn't get both in one go, and thus a logic decode. Tomorrow I can get some small wires soldered onto these pins, I don't have good wire (or a good fine tip iron) here at home, but can use stuff we have at work. Still, there is obvious communication, so that seems good?

SWD_CLK.jpg
SWD_DATA.jpg

EDIT: Alright, I managed to get a simul-trace of both pins, and get a decode. I'm not familiar with SWD, but it looks like it was programming a register with some handshaking on either side, then moving on to the next, etc. This picture likely won't be legible since I'm sure the PNG will get squashed to a jpg...
SWD.jpg
 
Last edited:
Seems like good news. Ie the mkl04 is live and attempting to program the mk20.

Are you sure you have continuity from the end of your USB cable to the mk20 d+ and d- , i.e. is this a known good cable?

Is there perhaps another CPU to try this in? i.e. maybe your computer is having a hard time enumerating this board?
 
Last edited:
Seems like good news. Ie the mkl04 is live and attempting to program the mk20.

Are you sure you have continuity from the end of your USB cable to the mk20 d+ and d- , i.e. is this a known good cable?

Is there perhaps another CPU to try this in? i.e. maybe your computer is having a hard time enumerating this board?

Definitely a good USB cable, I've used it to program other boards recently, and I checked the continuity from computer end to MK20 just to be sure. And I've tried on 2 completely different computers, no dice :( I'm wondering if the MK20 is a dud or this crystal is no good, the MKL04 is pretty clearly working.
 
Are you sure you hooked up the mk20 with the right orientation? Desoldering that chip and soldering on a new one is not impossible.

However, I would start with trying to drag solder all the mk20 pin connections while using a dry (but tinned) iron. I use a oblong tip for this. Ditto on the crystal connections. Heat it from the side.

If that doesn't work, I'd either reflow a new board or extract the mk20 and put in a new one. However, I'd first investigate that pin 1 in your design is at pin 1 on your PCB. That is, is the mk20 aligned properly?

Also, re examine all pins. If one of your pins got shorted or grounded, all sorts of bad stuff can happen. Again, use the DMm in ohmmeter mode, not the beeper. I'd check for shorts between the pins and GND as well as 3.3V bus. Lastly, check for shorts between adjacent pins. Bad stuff can happen on underside, where it isn't necessarily visible.
 
Last edited:
Yes, Pin 1 (dimple on the chip) lines up with the pin 1 indicator on the footprint (yours from the V1.0 lib) - that is, the dimple is to the left as viewed like in my OP. Similarly the MKL04 is oriented properly. This was in fact the first thing I checked when nothing happened on startup (learned that lesson the hard way a while back!)

I re-checked all pins on all components very carefully under the microscope. Honestly, all joints looked outstanding, nothing even approaching a bridged connection between any pins (including under/behind, which was of course harder to check), nice fillets on all passives and solid-looking joints on all uC pins. I did do as you suggested and touch-reflowed each pin on the MK20 with a soldering iron and the crystal, just to be sure. Still no shorts that I can see, no jumpers, nothing. And still nothing from the computer upon plugging in.

I guess I'll build up a second board tonight and reflow that, and see if there's a better result :confused:
 
For me, it looks like the connections to the crystal are not correct / the footprint for the crystal is wrong:

cry.png

See Constantin's post #2 for a correct footprint.
 
Last edited:
For me, it looks like the connections to the crystal are not correct / the footprint for the crystal is wrong:

View attachment 6830

See Constantin's post #2 for a correct footprint.

For crying out loud...do you have any idea how many times I double-checked that when making the footprint.... lmao. I checked for myself too, and there's no question I got it backwards. Must have flipped the thing mentally, most datasheets for ICs seem to do that, I bet that's what I did... That must be the problem. Later this afternoon I'll see if I can jury-rig this one in place for now, as I don't have a smaller crystal "in stock" to try rotating as Constantin suggested.
 
Well, I pulled off the crystal, spun it 90 degrees, and re-soldered it on. The pads did align such that it would work, though part of the crystal's pads did overhang the PCB's pads. Still no joy, but replacing the crystal altogether did work (maybe I didn't solder the original back on well, or I damaged it). Until/unless I need more boards made, I'll just place the crystal turned 90 degrees, and it should reflow fine.

Either way, I plugged it in and as soon as I grounded/released the program pin, Windows woke up and saw it. Programs successfully with a Serial echo sketch, and re-programs afterwards (without the button press) nicely.

THANK YOU so much Constantin for your patience and help diagnosing the signals (it was very instructive learning and seeing all the choreography first-hand), and of course thank you HWGuy for finding my goof! Have a virtual drink on me, both of you!
 
That's what we're here for. Have been helped more times than I can count. Best of luck with your design.
 
I'm also having crystal issues on a prototype and I'm hoping y'all can help.

I've tried a few pcbs. Some never work, some work for a while then stop completely. They all have the reset pulses and correct signals from the MINI54 to the MK20 but won't start oscillating after hitting program. Sometimes they will randomly start working again a day or two later.

While examining one of my working ones I accidentally probed one of the crystal's pins and it stopped working permanently.

I've built other devices using the MK20 and MINI54 tan and they haven't had anywhere near this many issues.
The crystal is a 520-160-8-30B-CKM.

Obviously soldering is the most likely culprit but after a lot of testing it seems everything is well connected, especially the crystal.

Capture.PNG


Thanks!
 
Last edited:
I'm not a big fan of the mess of vias, crossed high frequency lines etc between the mk20 and the minitan boot loader chip. For me, working with the smaller DFN version of the minitan was much easier. So I'd consider that.

I am also perplexed re your grounding regimen for the crystal. Relying on a via in a pad is bad practice and why not simply connect the top layer GND pads to the top layer GND and from there to the GND pin at #31 or whatever it is? Then have no vias to the layer below, no potential ground currents from other sources, etc. Seems like a much easier implementation!

Lastly, I wonder to what extent routing some of your signals could simply be improved by using alternate pin assignments for the likes of serial2, i2c and so on.
 
I am also perplexed re your grounding regimen for the crystal. Relying on a via in a pad is bad practice and why not simply connect the top layer GND pads to the top layer GND and from there to the GND pin at #31 or whatever it is? Then have no vias to the layer below, no potential ground currents from other sources, etc. Seems like a much easier implementation!

The via-in-pad for the crystal jumped out at me too. Further, Paul's 2-layer routing recommendation for the crystal is to ground it to its own little ground plane that grounds right to the adjacent MK20 pin (pin 31), similar to what you can see in the earlier pictures in this thread by both myself and Constantin (just keep in mind I had the pinout on the crystal wrong). See Paul's comments on the bootloader chip page under "Crystal Guidelines".
 
Thanks for your responses.

I am also perplexed re your grounding regimen for the crystal...
I had tried it that in a previous version of the board. For this one I tried removing the ground plane underneath it as I had seen that mentioned elsewhere.
I did this under that assumption that it was the crystal itself, not the connection between the chips that was an issue. But that's probably wrong.

..alternate pin assignments..
I'm already doing that unfortunately. Since I'm using almost every pin I don't havea lot of wiggle room.


I'll try another board with Paul's exact crystal recommendations and no crossed lines between the MINI54 and MK20.

Anything else?
Thanks again!
 
Status
Not open for further replies.
Back
Top