Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 19 of 19

Thread: Help with custom Teensy 3.2

  1. #1
    Senior Member
    Join Date
    Jun 2013
    Posts
    298

    Help with custom Teensy 3.2

    Hi,

    Iíve been using Teensys for the past few years in variety of products and projects. Currently my designs use custom PCBs with the Teensy footprint in them and I simply solder the Teensy on top of my boards. This method has served me well, but Iím running into issues with the micro USB connector not being durable enough, so I feel its time to take the next step and integrate the Teensy directly into my PCB.

    Being my first design, I was hoping experienced and wise eyes might help me avoid making rookie mistakes. To get me started, I read everything I could here:

    https://www.pjrc.com/store/ic_mkl02.html

    I decided to use this project to get me started.
    https://github.com/thewknd/teensy-bo...0board%20clone

    That design is for a 4-layer board, but mine will only be two layers. I started out by deleting everything from the schematic that my board wouldnít need. Next, I trash the board included in the project and just starting building my own from the schematic. Hereís what Iíve got so far. Itís a rough draft and I was hoping for some feedback and answers to questions to make sure Iím on the right track.
    Click image for larger version. 

Name:	pcb1.jpg 
Views:	165 
Size:	119.0 KB 
ID:	10022

    The first question is about my crystals. I havenít routed any signal under them and Iíve kept them pretty close to the main chip. The traces for the larger crystal are running under a bunch of other traces which are digital outputs. I just want to make sure thatís not a NO-NO.

    Click image for larger version. 

Name:	crystals.png 
Views:	238 
Size:	239.6 KB 
ID:	10023

    Related to this picture is the 220 ohm resistor array. The data sheet for these resistors say that each element is rated for 125Mw. At times, these will be shorted to ground and I just want to confirm that they can handle that. I believe I just need to calculate 3.3 / 220 = 0.015?

    Click image for larger version. 

Name:	power.jpg 
Views:	124 
Size:	165.5 KB 
ID:	10024

    The highlighted net here is the regulated 3.3 volts. Iíve connected it up as much as possible with 24 mil traces, but Iím worried that it might to be too long. Do I need to try to make it shorter? If I do, what components can I safely move toward the outside of the board?

    Because I will only be powering the device with USB, it looks like this BAT54 (R7) wonít be necessary. Can anyone suggest the appropriate replacement diode?

    Click image for larger version. 

Name:	diode.png 
Views:	120 
Size:	5.5 KB 
ID:	10025

    Thank-you in advance for any help or suggestions you can offer. I'm really looking forward to getting my first board up and running.

    Regards,
    Rob

  2. #2
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408
    FWIW, I would change a number of things because I am a bit retentive when it comes to PCB design.
    Click image for larger version. 

Name:	Board-7.2.jpg 
Views:	114 
Size:	157.7 KB 
ID:	10030
    This is the bottom half under a custom board. Note:
    1) only one PCB trace crosses another on the b side (that's the only crossing for the whole board)
    2) individual decoupling caps are close to each power pin
    3) Decoupling caps are between the power pin and the power supply
    4) Unbroken ground plane with exception of 1)
    5) No traces under the crystal, no ground power flows through crystal GND area (i.e. islanded other than stub connecting it to the GND pin under the MCU)
    6) Fat 0-Ohm jumper carries power over the MKL02 data lines, ditto for the RST signal.
    7) in this design, I sacrifice two I/O to bring power to the "inside" of the MCU. This is not necessary. Later designs simply use more jumper chips.

    I am a firm believer in creating power "grids" on one PCB side where power has multiple ways of getting from the source to the destination, with bulk storage chips sprinkled near high power-draw devices like SD cards. It also lessens the chance that a long trace will start to act like an antenna. The other PCB side is a unbroken GND plane. It ensures a good return path for all signals (see difference in behavior re: high speed vs. low speed signals in online EMI guides).
    Last edited by Constantin; 03-19-2017 at 01:51 PM.

  3. #3
    Senior Member Ben's Avatar
    Join Date
    Jul 2013
    Location
    Germany
    Posts
    401
    Have you tried using the exposed D+ and D- signals on the T3.2 bottom pads to attach a more durable usb port? maybe you can connect to them with a via cut in half on your mother board, like it is done here: https://oshpark.com/shared_projects/0T6ZdhhG (see last picture)

  4. #4
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408
    Saw your question re the crystal and you definitely violated the rules of engagement by running data lines across the crystal lines. Don't be silly. Buy the same chip as pjrc and put it in the same place. That allows you to drop the capacitors and you gain the benefit of a known good configuration.

    Messed up crystal lines is one of the main reasons that a custom teensy design will not work.

  5. #5
    Senior Member
    Join Date
    Jun 2013
    Posts
    298
    Thanks for the all the feedback. I realise my rough draft here is really rough, so I appreciate all the feedback I can use to make it better. Regarding the crystal, it's the one that was included in the schematic I started with. I'll look for the one PJRC uses. I really want to jettison anything that isn't needed, and if that lets me turf those capacitors, then that's awesome. Do you happen to know the part number? I'll post an update in a couple days.

    Any suggestions for the diode I was talking about?
    Last edited by yeahtuna; 03-19-2017 at 10:39 PM.

  6. #6
    Senior Member
    Join Date
    Nov 2012
    Posts
    273
    No diode needed, connect 3.3V to pin 21 (VBAT). Keep the capacitor close to the microcontroller pin.
    Last edited by HWGuy; 03-19-2017 at 10:55 PM.

  7. #7
    Senior Member
    Join Date
    Jun 2013
    Posts
    298
    I'd like to thank anyone who has provided me with their invaluable feedback. I've implemented as many of suggestions as I could, and I think I've managed to make significant improvements, but I still have some concerns.

    How do I make the ground plane islands in Eagle? I still need to research this.

    Are the crystals close enough? As I couldn't manage to find a part number for the QFN crystal on the PJRC boards, I just stuck with the one included in the reference board.

    What about that trace I have routed under the power lines inside the micro-controller footprint? Can I get away with doing that?

    Here are some pics:
    Click image for larger version. 

Name:	board2.jpg 
Views:	107 
Size:	131.7 KB 
ID:	10040Click image for larger version. 

Name:	n12.jpg 
Views:	84 
Size:	133.3 KB 
ID:	10041

  8. #8
    Senior Member
    Join Date
    Nov 2012
    Posts
    273
    polygon / ground plane in eagle 7.7:
    • select the Polygon tool
    • paint a polygon in the pcb designer
    • to connect it with an already existing signal, like GND: right click on the polygon border and select Name, enter the signal name (the polygon must include one pin or pad with the same signal)
    • right click on the polygon border and select Properties, set a value for Width. Must be higher than the minimum trace width. for oshpark 2 layer: >= 6 mil, 4 layer >= 5 mil
    • select Ratsnest to fill the polygon


    Crystals are close enough, Teensy 3.X 16 MHz crystal: https://forum.pjrc.com/threads/41152...l=1#post128797

  9. #9
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408
    FWIW, I use this crystal: http://www.digikey.com/product-detai.../644-1093-1-ND

    Here is a sample layout of the chip.
    Click image for larger version. 

Name:	Clipboard01.jpg 
Views:	112 
Size:	176.4 KB 
ID:	10044
    Note: VBAT and RegOut do not get decoupling caps, they don't need them.
    If you don't plan on using the ADC, you can skip the power-cleaning ferrite and all that also.
    You can see a grid of jumpers around the MCU to deliver power from all quadrants.
    The MKL02 is at the bottom. A simple pushbutton activates the thing.

  10. #10
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408
    FWIW, the above circuit uses a external voltage regulator, just like your layout. Note how there is a single signal on the b-plane, i.e. a little jumper under the MKL02. The rest of the board does the same thing.
    I used a vertical USB connector in this layout.

  11. #11
    Senior Member
    Join Date
    Jun 2013
    Posts
    298
    You board is so well laid out. Looks amazing. Do all those extra pours on the top layer help reduce noise?

    I realized that I don't need that RTC crystal, so that has made things a lot easier to deal with. I suspect I don't need that regulator either--at least not for this board. I have another similar one to do that will draw more power. I'll leave it in there for now, as I'm not exactly sure how to change the schematic to use the MPC's regulator.

    Here's where I'm at now. I've added that crystal and managed to get a ground plane for it. I've also sneaked a track through that resistor network for the digital outputs. Do you know if that's going to be okay?
    Click image for larger version. 

Name:	board3.jpg 
Views:	80 
Size:	104.8 KB 
ID:	10061Click image for larger version. 

Name:	board4.PNG 
Views:	84 
Size:	144.7 KB 
ID:	10062

  12. #12
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408
    Quote Originally Posted by yeahtuna View Post
    You board is so well laid out. Looks amazing. Do all those extra pours on the top layer help reduce noise?
    I don't have the means to test that. The hope is yes. I like to give GND multiple vias from each polygon in case the board house screws up and one of them isn't connected.

    You can eliminate the two via lines in the bottom of the board. Run a power line to the left of the USB connector down to the MKL04. Then you don't need the via at 7 o'clock relative to the MCU.
    Similarly, you can eliminate the via on the right of the MKL02 by running the two data lines under the pushbutton switch.
    I would not be changing the sizes of your data lines. Keep them consistent and within spec re: the board house (check via DRU file).
    Crystal looks much better and omission of RTC helps.

    What's the benefit of your signal traces to the DK1799 connections. Why one signal via RN network, the other direct? What is a DK1799B connector?
    Re-arranging signal lines on the MCU could very well eliminate the need for the two vias up there.
    Last edited by Constantin; 03-21-2017 at 06:19 PM.

  13. #13
    Senior Member
    Join Date
    Jun 2013
    Posts
    298
    About an hour after posting that, I realised the exact same thing in regards to routing that data line under the push button. Here's the final version. Now it's time to do some shopping! Thank-you so much for your guidance Constantin. While my wife wasn't so pleased with the amount of time I had to put into this, I certainly pleased with the result.

    I'll let you know how it all goes down when I get the boards from OSHPark in a few weeks from now. As for the signal / power traces, that a secret!

    Regards,
    Rob
    Click image for larger version. 

Name:	board6.jpg 
Views:	107 
Size:	95.2 KB 
ID:	10082
    Last edited by yeahtuna; 03-22-2017 at 01:11 PM.

  14. #14
    Senior Member
    Join Date
    Jun 2013
    Posts
    298
    It turns out a made mistake with connecting one of the traces to the wrong pin. Unfortunately I already ordered the boards, so it's not going to be totally functional. To be honest, if works at all I'm be quite pleased.

    I'll comment a tiny bit on those dual traces. At times the analog / digital traces pins will be set to INPUT_PULLUP, giving me a tiny little resistor that I can turn on and off.

    Rob

  15. #15
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408
    Best of luck. I hope that the resistances you're looking for are consistent enough from channel to channel to be useful.

  16. #16
    Senior Member
    Join Date
    Jun 2013
    Posts
    298
    So I'm now starting to think about panelization in an effort to properly dimension my boards to ensure high yield and ease of fabrication.

    Because of the irregular shape, I realize that I need some tab routing. I'm just not sure how little of it I can get away with. On the sides of the panels there will be 9mm assembly rails. Is acceptable if the routing cuts into this about 1.25 mm (radius of the routing bit). I've attached an image of what I'm hoping to achieve.

    Attachment 10122Click image for larger version. 

Name:	panel setup.PNG 
Views:	95 
Size:	190.7 KB 
ID:	10123
    Last edited by yeahtuna; 03-26-2017 at 03:48 PM.

  17. #17
    Senior Member
    Join Date
    Jun 2013
    Posts
    298
    Opps. I guess I'll need an extra 2.5mm top and bottom for routing there as well....Updated.
    Last edited by yeahtuna; 03-26-2017 at 03:49 PM.

  18. #18
    Senior Member
    Join Date
    Jun 2013
    Posts
    298
    Looks like the top and bottom routing spacing is not needed as the panels will be routed out anyways.

  19. #19
    Senior Member
    Join Date
    Jun 2014
    Posts
    244
    First work on the fuctionality of your board. Panelization is the very last step and requires communication with the board house, negotiating vscore pricing etc. etc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •