custom Teensy 3.1 pcb idea

Status
Not open for further replies.

oric_dan

Well-known member
I'm a little new to Teensy-ville, but not hardly a noobee. I decided to lay out my own custom pcb for the 3.1 module. I've seen some of the available BOBs, but want something more "permanent" and hard-wired. I do Arduinos a lot, and for some time have been wanting an Arduino UNO sized board with the power of the Teensy, and that could mount regular shields.

Basically the pcb layout is about 98% complete already, but I'm not sure about several pins. I did look all over the PJRC website, and did google searches,

1. the pcb Reset switch is tied to Program pin, with no external pullup.

2. D33 is not to be used for input [per a forum thread].

3. so far, A12 and A13 are not tied to anything - TBD.

4. every other I/O pin is tied to a header, and with series-protection Rs on
all the digital pins, and voltage-dividers on the ADC channels.

5. the power to Vin [module 28] can come from either the Vusb pin or the
5V, 1A regulator on the pcb, via a jumper.

6. I also have a 3.3V, 1A regulator on the pcb, which is NOT tied to the
module 3.3V; the module 3.3V is not used to power any pcb peripherals,
except the pullup-Rs on ADC 4,5, when used for I2C.

7. There are also 2/ea SOIC8 SPI chips for RAM or EEPROM, and an opAmp
for the DAC, plus a small proto area.

The question is, is there anything special about A12, A13, or any of the other pins besides D33 that needs some sort of special attention? Is there anything special I should know about mounting shields, other than the usual 5V to 3.3V issues.

Overall, there is too much going on with the processor for me to figure it all out myself. Thanks.
 

Attachments

  • tweensy-3.jpg
    tweensy-3.jpg
    168.8 KB · Views: 253
Last edited:
Thanks Mike, just the sort of info I was looking for. All of those pins have voltage-dividers on them, save A12,A13, which [along with 33] don't even have a home on the pcb.

Since you're resident both here and the Arduino world, do you foresee any great issues with plugging Arduino shields on here? Other than maybe the 5V shield issue? There wasn't room for the usual Arduino ISP header, but only the Ethernet shield uses it to my knowledge.

I do know that all of the digital pins on the 3.1 are 5V tolerant. I read your review on this other board:
https://www.tindie.com/products/freto/teensy-3-breakout-board-and-shield/
 
Last edited:
Bear in mind I'm a software guy, not a hardware guy, and I haven't actually used Arduino shields since moving to Teensy.

In theory, modern shields should cope with either 3.3v or 5v, but with Arduino shields, you see quite a few of the older shields that are 5v only. In looking at the shield documentation, check whether it is compatible with the Due.

I would imagine that you would need to know whether a pin is an output pin or an input pin, in terms of what level conversion to do. If you are doing level conversion on everything, you probably need to make sure it is fast enough for things like WS2812B or SPI protocols. Many of the i2c level converters are on the slow side, while others that are fast, seem to be one direction.
 
Thanks again. Since Paul has such extensive library support for Teensy, I figured many shields should work, especially that most 5V shield hardware will accept 3.3V input signals, and that Teensy is 5V tolerant coming the other way. If worse comes to worst, I have the proto area to wire stuff into.

I guess I'll just try it and see. I'm expecting my pcb design is gonna keep the Teensy alive, no matter what.
 
When Digistump came out with their DigiX (Due clone), they also made a shield to do level shifting: http://digistump.com/products/51.

I must admit to buying a DigiX and the shield during their kickstarter campaign, but I have not used it yet (and that was a year and a half ago). They use jumpers to say whether a pin is an analog or digital pin. The comments also say, the shifters don't have enough power to drive LEDs.

I keep looking around, but ultimately keep coming back to Teensys.
 
Last edited:
I'd recommend over-sizing the drills on 14 pads that mate with a header SMT soldered to the bottom side of Teensy 3.1. Placement of that header can vary slightly, so having those 14 holes larger can really ease frustration of assembly.

Level shift circuits have a lot of difficult trade-offs if they're bidirectional. Often they cause more harm than good, especially with a board like Teensy 3.1 that has 5V tolerant digital pins. I didn't see the specific level shifting circuit mentioned...
 
For better shield compatibility you might want to use the full Arduino R3 layout including the ICSP/SPI header and the two i2c pins (SDA SCL) next to AREF.
 
Mike, glad to hear you like the Teensys so much, and here I thought you were a hardcore Arduino [forum] guy. LOL.
---------------

Paul, there aren't any level-shifters on the pcb, rather it's one of the things that Mike brought up in a previous post. I figure most 5V hardware will accept 3.3V as input, and your module digital pins are 5V tolerant, so I figure level-shifters weren't needed. In any case, I also have the proto area on D0..D13, and could wire in voltage-dividers or pullups as required for touchy levels going to shields.

Thanks for the comment about the over-size pad holes for the bottom header on the module. Hadn't thought of that. Actually, I had thought about staggering every other pad hole of the perimeter 28 by 0.005" using that common scheme for inserting headers temporarily into a board for programming purposes, etc. This, plus the fact that those hole sizes are .032", and 0.1" header pins are .025" on a side [or 0.035" diagonally].

Do you think this staggering scheme would hold the 3.1 module reliably enough for some "testing" use?

My main plan in general, and in order to avoid interference with shields above, is to actually hard-solder in the 3.1 module to the pcb, rather than use those Arduino female-style headers to plug in the modules. IE, make permanent installations.
---------------

For better shield compatibility you might want to use the full Arduino R3 layout including the ICSP/SPI header and the two i2c pins (SDA SCL) next to AREF.
Scary-looking guy [LOL], yeah I had thought about that, but decided what the heck. This is only really for my own use, and wasn't really planning to sell. And I don't think I've even seen a shield using those extra pins. It's also kind of a silly idea for Arduino to string the I2C [ADC 4,5] and Aref traces all the way across the digital areas of the boards. Very poor analog design.

Also, I had originally wanted to include the usual Arduino ISP header with the SPI pins in the usual place, but there was no good way to position the 3.1 module and still plug in the USB cable with it in there. You notice, the pcb is pretty well packed up. So, what the heck. If I ever plug in an Ethernet shield, I can cut off the 6-pin ISP header on the bottom side of the shield, and install 3 jumpers over to D11..D13 on top. Been there, done that already in the past.
 
Last edited:
Note, the reason they put the i2c traces in a standard position, is the Leonardo, Mega, and Due all have i2c on different pins. Lets see, the Leonardo (and Teensy 2.x for that matter, since it uses the ATmega32u4) moves the i2c bus to digital pins #2 and #3. The Mega and Due have another row of pins on the digital side where the i2c pins are #20 and #21. In a fit of insanity, the Arduino designers decided to hook up the 2nd i2c bus to the standard pins for the Due, which means if you get library code that has been ported to the Due and not the Teensy, you will see code like:

Code:
#ifdef __arm__
#define WIRE Wire1
#else
#define WIRE Wire
#endif

on the assumption that other arm platforms did the same thing. Now, since Adafruit and Sparkfun sell Teensy's, more of the libraries from them have Teensy support already in place. But in the past, I've had to manually make those changes. Now, it is more obvious if I use a Teensy 3.0 since it only has one i2c connection. If I use my Teensy 3.1's, they have 2 i2c connections, and I would be scratching my head why the i2c wasn't working.

In terms of microprocessors, I used to read this forum, the digispark forum, the adafruit forum, and the arduino forum (at work I have stretches of time when I'm waiting for builds to finish, so I catch up on the forums). However, recently they've made some changes to the arduino forum that makes the read new messages part unusable, so I rarely read it any more.

In terms of level shifting, sometimes I do it, sometimes not. If I'm laying out a breadboard for a teensy, I will put in level shifters for i2c. For neopixels (ws2812b's), I go back and forth. I generally only do 2 16 LED rings, and I carefully size the brightness of the neopixels so it uses about 75mA, which means I can feed it from the Teensy 3.3v power. Yeah, it is a little out of spec for the neopixels, but all of my neopixels will in fact run on 3.3v (the spec says 3.5-5.5v). However, I do have neopixels that will not work if I feed them 5v power (i.e. VIN from USB) and use 3.3v signals.

I do keep hoping the cost reduced Teensy that Paul has been hinting about eventually shows up. I bought some Adafruit Trinkets (5v so I don't have to do level shifting) to make a neopixel ornament for my family (alas, it didn't get made). I've been rewriting my basic neopixel patterns to eliminate all delay statements (each action called from loop checks if it is time to fire, so that eventually I can have multiple things going on at the same time). I decided to try it on the Trinket, and it is now bigger than 5k, so I have to get the shoehorn out.
 
Last edited:
Ha, I guess I'm about to start having to tradeoff what works for Arduino and what works for Teensy-Arm, just like you, :).

Code:
Code:
#ifdef __arm__
#define WIRE Wire1
#else
#define WIRE Wire
#endif
Of course, if you look in any .h or .cpp file in the core or libraries in Arduino-land, you find 1000s and 1000s of those darn #ifdef ... #endif things. Hard to make s.w. that supports so many different cpu architectures. Arduino-Centrale has a tough road to hoe [or is that mixing metaphors?].

And yeah, the latest changes to the Arduino forum browser interface is a total disaster. Drives my Android tablet totally bonkers. Talk about breaking stuff that "works".

Actually, I don't worry too much about level-shifting with I2C because the drivers are all "supposed" to be open-drain. On my other [custom] pcbs, I can select the voltage on the pullup-Rs as either 3.3V or 5V, and it seems to work ok with 3.3V chips on one end, and 5V chips on the other end, when it's set to 3.3V. You might try this and see if it works for you.

Re ... "cost reduced Teensy" ... you can buy these CN knockoffs of the STM32 Maple very cheaply, but leaflabs-Maple library support is just horrific. Teensy library support is like heaven in comparison. Paul has done a truly excellent job!

http://www.ebay.com/sch/i.html?_fro...RC0.H0.Xstm32+maple&_nkw=stm32+maple&_sacat=0

There is an on-going thread on the Arduino forum that is now up to [get this!!!] 79 pages, where the forum guys are basically doing leaflabs work for them. Sheesh.

http://forum.arduino.cc/index.php?topic=265904.0

[I just hope Paul isn't gonna 'knockoff' the Teensy 3.1 form-factor now that I've designed a pcb for it].
 
Last edited:
Actually, I don't worry too much about level-shifting with I2C because the drivers are all "supposed" to be open-drain. On my other [custom] pcbs, I can select the voltage on the pullup-Rs as either 3.3V or 5V, and it seems to work ok with 3.3V chips on one end, and 5V chips on the other end, when it's set to 3.3V. You might try this and see if it works for you.

I have a 16x2 i2c LCD that WILL NOT WORK unless I level shift it to 5v. But now that I have both 3.3v and 5v processors, I try to random stuff that works at both voltage levels. Whether it will work at 1.8v, I don't know, probably not.

Re ... "cost reduced Teensy" ... you can buy these CN knockoffs of the STM32 Maple very cheaply, but leaflabs-Maple library support is just horrific. Teensy library support is like heaven in comparison. Paul has done a truly excellent job!
Sure, I could go down various roads, to try and get something to work. However, I'm lazy. This is supposed to be a fun hobby. Trying to track down undocumented 'features' is more of a day job type operation.

At one point I did a cost calculation, that doing an ATmicro85 with raw chips (about $1 if you buy in small volumes) was still about $8 when you factored in USB plug, capacitors, buttons, protoboards, etc. which is the cost of a Trinket or Gemma.

I just hope Paul isn't gonna 'knockoff' the Teensy 3.1 form-factor now that I've designed a pcb for it].
Well the Teensy 3.1 should still be available, even if the cost reduced Teensy comes out (there will be a higher end Teensy coming out as well). I think the main thing about the cost reduced Teensy is eliminating the underneath pins. But until Paul announces it, it is just speculation.
 
Last edited:
Do you think this staggering scheme would hold the 3.1 module reliably enough for some "testing" use?

I've never actually tried the staggered pads scheme.

I do keep hoping the cost reduced Teensy that Paul has been hinting about eventually shows up.

It's coming, honest.

For such a seemingly simple board, it's taken a HUGE amount of work. A lot of that has been on improved hardware testing to get the PCB inspection cost down. It a tremendous amount of work nobody will ever see, except that we'll manage to get the price lower with all-USA manufacturing.

[I just hope Paul isn't gonna 'knockoff' the Teensy 3.1 form-factor now that I've designed a pcb for it].

I'm doing everything I can to keep the through-hole form factor as close to Teensy 3.1 as possible.

Some things won't be on the low-cost version. The 14 SMT pads on the bottom side go away. There's only 8 PWM pins. CAN bus disappears. Only some of the pins work with attachInterrupt. There's no internal reference, so you either use VCC or external AREF. There's no VBAT or RTC crystal location. There's no series diode with the input, but the PTC fuse is still there.

Probably the biggest feature people will miss is 5V tolerance. Sorry, that just isn't available in the low cost chips.

However, almost all the hardware peripherals are present. I2C, 3 Serial, SPI, Touch, 8 of the PWM, and the true analog DAC are still there, same pinout.

Also, put 1-signal a 3 to 5V buffer on the board, which drives a 5V copy of pin 17 onto the pad where VBAT used to be. It's intended for low cost board to be able to drive WS2812 / NeoPixel strips.
 
It's coming, honest.

For such a seemingly simple board, it's taken a HUGE amount of work. A lot of that has been on improved hardware testing to get the PCB inspection cost down. It a tremendous amount of work nobody will ever see, except that we'll manage to get the price lower with all-USA manufacturing.
Yep, I can imagine t takes a lot more skull sweat to engineer into smaller constraints (size, cost, etc.). I didn't mean to imply any by my comment, except I'll be in line to buy them when you make them available. If you do get it down to a smaller price point, it will mean I can actually dedicate Teensy's to specific projects, including soldering them to the board, rather than using breadboards, and such so I can change things around.

I'm doing everything I can to keep the through-hole form factor as close to Teensy 3.1 as possible.

Cool, I figured as much.

Some things won't be on the low-cost version. The 14 SMT pads on the bottom side go away. There's only 8 PWM pins. CAN bus disappears. Only some of the pins work with attachInterrupt. There's no internal reference, so you either use VCC or external AREF. There's no VBAT or RTC crystal location. There's no series diode with the input, but the PTC fuse is still there.

Probably the biggest feature people will miss is 5V tolerance. Sorry, that just isn't available in the low cost chips.

Well you have to leave some reason for people to buy the 3.1 (and whatever the bigger chip will be). Since most of my current stock of Teensys are still 3.0, I'm used to the restriction. And for i2c/neopixel I can do level shifting.

However, almost all the hardware peripherals are present. I2C, 3 Serial, SPI, Touch, 8 of the PWM, and the true analog DAC are still there, same pinout.

Also, put 1-signal a 3 to 5V buffer on the board, which drives a 5V copy of pin 17 onto the pad where VBAT used to be. It's intended for low cost board to be able to drive WS2812 / NeoPixel strips.
Cool, that will be a useful feature for those of us that do neopixels in wearable costumes. If you had a JST connector on the board (or at least VIN = 3.7v support), even better.
 
Mike, thanks for the info re some 5V LCDs won't work with 3.3V input signals. I guess the schmitt triggers are a little finacky. Some 5V Schmitt triggers don't trigger until the input is near 4V, I had this problem with PIC chips.

Paul, so the new board will still retain the DIP28 format, but just forego having all the extra I/O lines of the 3.1? Do you possibly have a pinout diagram for it somewheres?

For my part, I'm looking for more power [especially more RAM], and am going from Arduino to Teensy, etc, so the current 3.1 is most desireable.
 
In addition to 5V i2c LCD's, if you are talking straight communication, newer neopixels (ws2812b) tend to be finicky in that if you power them with 5v, you must signal them with close to 5v. So, on the Teensy, if you power the Teensy with USB and connect VIN to the neopixel power line, you must do a level converter for the data pin. If instead, you power the Teensy with a 3.7v lipo battery, it will work with a 3.3v signal.

While it is out of spec, I have found I can hook the Teensy 3.3v line to the neopixel and it will work (it won't be as bright but it will work). However, when doing this, you have to make sure the neopixel strand never draws more than 75mA or so. Note, if you do this with other microprocessors (particularly digispark), it will may fry the microprocessor. Adafruit's Trinkets and Gemmas are similarly protected. On the other hand, if you use 9v power like the Uno takes, you DO NOT want to use the VIN equivalent line.

I need to make some pictures to show how this can be done. It keeps coming back up.
 
I've not even heard of neopixels before, but just looked them up. I use rather mundane led displays. The display node for my home automation system has 14 regular and 2 RGB leds, all run directly off the pins of a 1284 chip. With the new hi-intensity devices, you only need run 2-5 mA into any Led, so 20 Leds need only 40-50 mA total current. Each Led signals the stats of one node in the automation system, via blinking or intensity modulation.

One good thing about my pcb layout is, if I need to, I can wire NPN or MOSFET transistors into the little proto area for driving more current. It also has the 1A 3.3V and 5V v-regs on board.

Wow, good thing you mentioned this. Because of possibility of putting transistor drivers in the proto area, I should change the traces to pins D0..D13 from 15 to 30 mils. Cool.
 
Last edited:
I've not even heard of neopixels before, but just looked them up. I use rather mundane led displays. The display node for my home automation system has 14 regular and 2 RGB leds, all run directly off the pins of a 1284 chip. With the new hi-intensity devices, you only need run 2-5 mA into any Led, so 20 Leds need only 40-50 mA total current. Each Led signals the stats of one node in the automation system, via blinking or intensity modulation.

Neopixels (ws2812b) go up to 60mA per LED, though I find max power is way too bright, and I tend not to do about 2-3mA per LED. They are chained together and there are strict timing requirements for the strand, which means if you have to level shift, you need shifters that can react fast enough.
 
Yeah, I'll bet they're bright. The leds I have are 3000-5000 mcd, and even with only 5 mA, they light up the front room at night, so I've cut them back to mostly 2 mA now. But they are mostly on 100% duty cycle. Really fancy displays are not my thing. If you have to time-multiplex them, then I guess you're stuck with higher currents.
 
Note, the ws2812B's have a microprocessor per LED. Each microprocessor does an internal PWM of the 3 colors. You don't need to have the Teensy endlessly refresh the display. But when you are programming neopixels, the communication channel is 800kHz, which is where the timing issue comes in.
 
Not to interject, but this is a reply to Paul's post about the low-cost teensy: Does it have the same built in capacitive sensor tech as the 3.0/3.1, or will we have to leverage the rather low-resolution (and often grumpy) Teensy 2/Arduino style capacitive sensor library?
 
Not to interject, but this is a reply to Paul's post about the low-cost teensy: Does it have the same built in capacitive sensor tech as the 3.0/3.1, or will we have to leverage the rather low-resolution (and often grumpy) Teensy 2/Arduino style capacitive sensor library?

I was also hoping to possibly see a tentative header pin out for the new board myself. How it might impact what I hook to the pins on my PCB layout. I guess it mainly means that D24..D33 go away, while most of the existing pins on the periphery remain the same (I hope). That would have little effect on my board design, and I could mount either 3.1 or the new module.
 
Last edited:
Regarding the upcoming low-cost Teensy.....

... I'll be in line to buy them when you make them available. If you do get it down to a smaller price point, it will mean I can actually dedicate Teensy's to specific projects, including soldering them to the board, rather than using breadboards, and such so I can change things around.

Actually, we're planning to send out (for free) a small/early batch to the top 20-some forum contributors. You'll certainly be on that list. ;)


If you had a JST connector on the board (or at least VIN = 3.7v support), even better.

It's almost exactly the same form factor as Teensy 3.1, so no JST connector.


Paul, so the new board will still retain the DIP28 format, but just forego having all the extra I/O lines of the 3.1?

Yes, it's the same DIP28 form factor. The same 4 through hole pads, VUSB, AREF, A10, A11 are present along the top, and the same 5 are present on the right: DAC/A12, PROG, GND, VCC, 17-5V. The one difference is VBAT turns into 17-5V.

Do you possibly have a pinout diagram for it somewheres?

The diagram will be published when it's released. Or maybe when we ship those early ones. But really, there shouldn't be any great surprises. It's remarkably close in Teensy 3.1. A couple pins lose PWM and CAN bus isn't present. The 14 pads on the bottom are gone, and there's no RTC. Otherwise, the I/O is very close.

For my part, I'm looking for more power [especially more RAM], and am going from Arduino to Teensy, etc, so the current 3.1 is most desireable.

It'll still be a step up from Arduino Uno & Leonardo, with 64K Flash and 8K RAM. Cortex-M0+ is still faster than AVR for simple 8-bit data, and considerably faster for 32 bit integers, but it's not the big step up that Cortex-M4 is.

M0+ lacks the DSP extensions and many of the more powerful M3/M4 math instructions, so it can't do the heavy number crunching of the audio library.

Does it have the same built in capacitive sensor tech as the 3.0/3.1

Yes.

I was also hoping to possibly see a tentative header pin out for the new board myself. How it might impact what I hook to the pins on my PCB layout. I guess it mainly means that D24..D33 go away, while most of the existing pins on the periphery remain the same (I hope). That would have little effect on my board design, and I could mount either 3.1 or the new module.

Yes, every attempt has been made to keep the form factor and pinout compatible.

The main migration issue is lack of 5V tolerance and 2 of the pins lose PWM on the low cost board.
 
Cool. I can certainly put in a JST connector (or use onehorse's lipo mini-shield). I like how you are trying to keep the same pin layout for the majority of things.
 
Yes, it's the same DIP28 form factor. The same 4 through hole pads, VUSB, AREF, A10, A11 are present along the top, and the same 5 are present on the right: DAC/A12, PROG, GND, VCC, 17-5V. The one difference is VBAT turns into 17-5V.
Thanks a bunch Paul, that answers my most pressing questions, and seeing the actual pinout diagram is not really necessary. My Gerbers are already going out tomorrow, :). Even with 5V tolerance going away, the cktry on my board should still offer pretty good I/O pin protection.

Just to clarify, the new chip does or does not have a DAC? If so, this means it's on A12 rather than A14? In any case, A12 gets brought out to the periphery where A14/DAC goes on the 3.1.

And all in all, my layout looks like it's 100% compatible with the new module, so great.

Oh BTW, I assume you have no objections to my calling the pcb a "Tweensy-UNO", as it's in between a Teensy and an UNO?
 
Last edited:
Status
Not open for further replies.
Back
Top