making custom teensy 3 pcb

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
pts
 
Posts: 63
Joined: Tue Mar 26, 2013 3:55 pm

making custom teensy 3 pcb

Post by pts »

hi there,

long story short im looking how to make my own pcb using the arm cortex m4 chip that the teensy 3(.1) uses.

im fairly new to this pipeline, so i have some noob questions,

1. do i need to burn a bootloader onto the chip? if so how do i go about this? i read something about teensy running halfkey. if i was to just buy the cotex chip itself, how would i get this bootloader on it?

2. if its not quite realistic to get the bootloader on the chip, would it be plausible to desolder the chip from a teensy development board, and then resolder the chip to my own pcb?

3. what are the dangers of this concerning power? at times i will be plugged in to a USB and other times running off a 3.7v (4v max) battery. what concerns should i have and what resistors would i need?


thanks for any input. :)

User avatar
Franklin97355
 
Posts: 22873
Joined: Mon Apr 21, 2008 2:33 pm

Re: making custom teensy 3 pcb

Post by Franklin97355 »

You should ask over here http://www.pjrc.com/ They make the Teensy.

User avatar
paulstoffregen
 
Posts: 444
Joined: Sun Oct 11, 2009 11:23 am

Re: making custom teensy 3 pcb

Post by paulstoffregen »

pts wrote: 1. do i need to burn a bootloader onto the chip? if so how do i go about this? i read something about teensy running halfkey. if i was to just buy the cotex chip itself, how would i get this bootloader on it?
You buy this chip which has the bootloader.

http://www.pjrc.com/store/ic_mini54_tqfp.html

You can use a blank MK20 chip with this.

User avatar
pts
 
Posts: 63
Joined: Tue Mar 26, 2013 3:55 pm

Re: making custom teensy 3 pcb

Post by pts »

that link is exactly what im looking for! thank you for the enlightening!

can you inform me why/how i need the blank mk20?

User avatar
pts
 
Posts: 63
Joined: Tue Mar 26, 2013 3:55 pm

Re: making custom teensy 3 pcb

Post by pts »

From other posts it looks like the mk20 is used for the flash memory ? Is this correct ? If so are there another compatible options that are a tad physically smaller? My sketch doesn't need quite that much memory and needs to fit in a tight area

User avatar
cmagagna
 
Posts: 8
Joined: Sat Sep 21, 2013 11:37 pm

Re: making custom teensy 3 pcb

Post by cmagagna »

If you don't need all the I/O pins there's a 48-pin version of the MK20 that comes in various Flash & RAM memory sizes. Digikey shows 6 options but only the MK20DX128VLF5 is in stock; Mouser shows 12 versions with 5 in stock. You should verify with Paul Stoffregen that the Mini54 / Teensyduino will work with these chips; I've never tried.

Good luck!

User avatar
paulstoffregen
 
Posts: 444
Joined: Sun Oct 11, 2009 11:23 am

Re: making custom teensy 3 pcb

Post by paulstoffregen »

Only 2 chips are confirmed to work with the Mini54. They are MK20DX128VLH5 and MK20DX256VLH7 (64 pin LQPF packages). PJRC has never checked whether the Mini54 works any other versions of these chips. As far as I know, nobody else has tried this either. If you do, I hope you'll post a followup to let others know if it works or doesn't work.

The Mini54 chip will automatically detect which chip you've used and implement Teensy 3.0 or 3.1. I can tell you this detection is done by reading the registers that describe the memory size. It does not read the more specific device ID register that identifies the package/pinout, so there is at least a reasonable chance it might work on similar chips.

But if it doesn't happen to work with a different chip, you'll pretty much have to just scrap your PCB and try again. I'd recommend using MK20DX128VLH5 or MK20DX256VLH7.
Last edited by paulstoffregen on Tue Jan 21, 2014 8:03 am, edited 1 time in total.

User avatar
paulstoffregen
 
Posts: 444
Joined: Sun Oct 11, 2009 11:23 am

Re: making custom teensy 3 pcb

Post by paulstoffregen »

pts wrote:From other posts it looks like the mk20 is used for the flash memory ? Is this correct ?
The MK20 chip is the main processor you're programming. Your sketch from Arduino actually runs on the MK20 chip. It has the fast ARM processor, flash, RAM, USB, serial ports, I2C, SPI, timers, and everything else. While your sketch is running, the Mini54 sits there doing pretty nothing, other than waiting waiting for the moment you want to upload a new sketch.

The MK20 lacks a hardware bootloader feature similar to the Atmel AVR chips used on most Arduino products. When I first learned about these chips, almost 4 years ago (before they were actually selling), I knew they would be awesome for running Arduino sketches. They're so fast and they have all the stuff you normally use in Arduino, plus so much more. But the one thing they lack is the bootloader functionality that is the foundation of Arduino compatibility.

To solve that seemingly impossible limitation, I came up with a hack where the Mini54 takes control of the MK20 when it's time to upload a sketch. Conceptually it's pretty simple, the Mini54 just controls the MK20 and emulates the missing hardware bootloader functionality. That lets it work very nicely with Arduino. A lot of very difficult optimization went into making the upload go fast, since these chips have a lot of flash memory (just try uploading 256K of data to an Arduino Mega or Due to see the difference), but the concept is pretty simple. The Mini54 just adds the bootloader capability. It's not unlike how the ATmega328 chip lacks USB, so the 16u2 chip on Arduino Uno adds that missing feature.

Two really nice little extra features you get with the Mini54 are complete access to the entire MK20 chip and rapid startup. Normally a bootloader consumes part of the chip's memory. Usually it's a small part, but still a piece you can't use. The Mini54 lets you use the entire MK20 chip. Many bootloaders have to delay the board's startup. It's only a few seconds on modern Arduino boards, but it's still a pretty noticeable delay from when you apply power until you own code actually runs. Since MK20 chip is entirely dedicated to your own sketch, it starts running your code as quickly as possible, limited only by the MK20's own reset sequence which is very fast.

Whew, this message turned out longer than I'd planned, but hopefully this gives you a solid idea of what the Mini54 does and why it's needed to make these MK20 chips work so well with Arduino.

User avatar
westfw
 
Posts: 1919
Joined: Fri Apr 27, 2007 1:01 pm

Re: making custom teensy 3 pcb

Post by westfw »

So the mini54 isn't connected to USB at all?
It just senses reset, loads a bootloader into the MK20 RAM and runs it (from RAM) (using JTAG?) (Um, neat. I think. What's freescale thinking, not providing any bootloader-like functionality?)

User avatar
paulstoffregen
 
Posts: 444
Joined: Sun Oct 11, 2009 11:23 am

Re: making custom teensy 3 pcb

Post by paulstoffregen »

Yes, pretty much. A full schematic is available here:

http://www.pjrc.com/teensy/schematic.html

User avatar
cstratton
 
Posts: 294
Joined: Wed Sep 29, 2010 3:52 pm

Re: making custom teensy 3 pcb

Post by cstratton »

westfw wrote:What's freescale thinking, not providing any bootloader-like functionality?
They probably expect people to use SWD, which is more or less the standard for working with ARM Cortex MCUs.

That said, factory serial or USB bootloaders are nice for devices where end users might occasionally change the program, without wanting to have even a <$10 SWD adapter on hand.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”