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

Thread: 5V Teesny 4.1

  1. #1

    5V Teesny 4.1

    Hello, the speed, pins and ram of the Teensy 4.1 is incredible. All of my peripherals are 5v though (LCD, Rotary Encoders with push switches, RGB LEDs + more. I'd happily make the jump from an Arduino Mega to a teensy 4.1 if only it was 5volt.

    Is there anyway to get something like the 4.1 but with 5v logic at the pins? Or some sort of piggy back giant level shifter shield?

    What's the best solution to this? Keeping 5v but getting speed/ram/pins of the 4.1?

    Keep up the amazing work, and thanks!

    Steve

  2. #2
    Senior Member
    Join Date
    Apr 2013
    Posts
    1,938
    The boring answer is to buy all new peripherals, on a practical front high performance devices are always going to be fussier on power supply, ESD, pin drive capability and all these similar things so moving from a mega to any current gen device is going to have some thought involved. On the practical front many devices do not care on the voltage (buttons and basic encoders), others will tolerate 3.3V operation (most LCDs, but not most 2/4 line character ones). As a general rule devices that are input only can be connected up 'just to see' and in many cases can be made to work, anything that outputs back to the micro controller needs some careful data sheet reading before being plugged into a Teensy and will probably need some form of voltage divider. I2C is a headache since bi-directional level converts are very hit and miss though in some cases you can setup the pullups to 3.3V only and have 3.3 and 5V devices connected to the single bus (since it is a pulldown bus). Not necessarily what you want in something mission critical without some research.

    The LED strips may be the biggest obstacle in switching. They need very fast swinging drive signals so right way involves devices like that included on the Teensy LC, the prop shield or the the OCTOWS 8 channel shield. The ugly method is the cut off the first pixel and power it with diodes at ~4V and use it as an intermediate step between 3.3 and 5v logic.

  3. #3
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    8,219
    The good news is, for most things, level shifters are not needed, and today most periphals can work with 3.3V. The rotary encoders you mentioned for example.
    There are many replacements for the old 5V LCDs, too - like OLEDs.

    I see 1.8V on the horizon.. so maybe it's the time to put 5V periphals away.

  4. #4
    Senior Member manicksan's Avatar
    Join Date
    Jun 2020
    Location
    Sweden
    Posts
    264
    Your could use simple levelshifters as this one
    https://www.sparkfun.com/products/12009
    There is also special ics that make that possible.

  5. #5
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    8,219
    Quote Originally Posted by manicksan View Post
    Your could use simple levelshifters as this one
    https://www.sparkfun.com/products/12009
    These are incredible slow, but work good for some things - a few 100kHz.
    For fast IO, they are not usable.

  6. #6
    Senior Member fdaniels's Avatar
    Join Date
    Oct 2020
    Location
    Ostwestfalen, Germany
    Posts
    101
    Encoders and Pushbuttons will work without any problem with 3,3V. Most LCD and almost all OLED work with 3,3V, too. LEDs work perfectly with 3,3V, you just need to adjust the current limiting Resistor. Although i never have seen this recently (OK, i just have experience with 4 different suppliers) some WS2812bs and the like are reported to need +5V level.
    So if you design something new, theres no problem at all. If you are looking for a drop in replacement, well you will need that giant levelshifter shield.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,951
    Quote Originally Posted by StevenMartin View Post
    What's the best solution to this?
    The "best" solution is to get used to using 3.3V signals.

    Seriously, if you look around almost no microcontrollers other than old 8 bit AVR and PIC use 5V. Pretty much everyone switched to 3.3V a long time ago.

    Most of the newer generation addressable LEDs are designed to accept 3.3V signals, even though 5V allows better noise margin. Almost all modern displays use 3V only signals, and shields with those displays for Arduino Uno & Mega have 5-to-3V level shifters. The same is true for SD cards, motion sensors, ethernet chips and virtually every chip designed in the last 25 years (well, except 1.8V only is becoming a thing lately....) Most of those peripherals you mentioned probably can use 3.3V.

    A board Teensy 4.1 running at 5V just isn't ever going to exist. The modern silicon processes (65nm, 40nm, 28nm) that make fast microcontrollers run on lower voltages, because the transistor channel lengths and gate insulation are so small. On Teensy 4.1, almost all the logic inside the chip actually runs at 1.1V or 1.15V or 1.25V. It gets converted up to 3.3V or 1.8V inside the chip at the pins, but fundamentally these modern parts with excellent performance run on lower voltages. Supporting higher voltages increases cost and in many cases just isn't possible for over 3.3V due to the physical design of modern silicon processing.

  8. #8
    There is the detail: you come from the AVR-5V environment. The teensy 4.1 you must use it with another approach, you must use an intermediate chip if you want to continue using the components you already have.

    Shield way you wish won't find it, you have to create that path. A good chip is the SN74AHCT125N, you can connect servo motors, 5V addressable leds, 5V LCD. You will necessarily sacrifice some speed, but you can control them as usual.

    Consider some external source to handle the 5V power.

  9. #9
    Senior Member
    Join Date
    Mar 2016
    Posts
    318
    Yes, microcontrollers are all 3.3V these days. You've got to learn to live with it. While most peripherals can be had in 3.3V versions and a lot (almost all) new peripheral chips are 3.3V (or less) only, there are still some things that want 5V. In the machine control area, there are many devices that are spec'd for 5V or higher so learning to interface to them is part of the job. I like the AHCT and HCT logic families for output and LVC family (5V tolerant) for input.

    AHCT and HCT logic running at 5V will see a high on input of 2.5V or higher. You run it at 5V and it will accept 3.3V logic signals. The 74AHCT125 is a good one though I prefer the AHCT541 which is set up in a bus configuration with all 8 inputs on one side of the chip and all 8 outputs on the other. There are one input (1G) versions (74AHCT1G125, for example) of this if 8 is too many. SMD only and pretty small (get used to it, that's the world of 2021). Relatively fast, can easily handle 10 MHz.

    For input, LVC is nice because you can run it at 3.3V and is 5V tolerant. It is fairly fast too. The 74LCV1G125 is similar to the 74AHCT125. There 2 input versions - LVC2Gxxx - also.

  10. #10
    I'd have to agree with Paul. I made a similar switch from Arduino stuff some 3 years ago and never looked back. I never really understood how a goofy form factor of an UNO or Mega could be used for any production (or permanent) application. As you find memory, speed, etc. are just too limiting with Arduino stuff.

    Even though most of my projects are based on a 3.2 (5V tolerant), I still only use 3.3 devices. It will be a bit of a pain redoing projects, but once you are done, you will have a much better solution.

  11. #11
    Thank you, everyone! The product/project I mentioned is my first venture into both electronics and programming. So I'm coming into it super fresh. I originally started with a Mega clone as it came as a hobbyist starter kit then kind of built my project around the controller.

    It does mean essentially starting again and replacing my hardware but from all of the great responses (thanks for those!) it looks like starting fresh from 3.3v will 'eventually' give me everything I want.

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,951
    Quote Originally Posted by StevenMartin View Post
    It does mean essentially starting again and replacing my hardware
    I believe you may have missed the part where some, possible most or maybe even all, of your hardware probably works perfectly fine with 3.3V signals.

    Even those ancient HD44780 small LCDs work fine with 5V power and 3.3V signals, if you use them in the simplest write-only way where the RW signal connected to GND (and Arduino's default LiquidCrystal library just keeps that pin at logic low if you do connect it - only the special "fast" versions of that library actually use it, for only rather modest speedup)

    Change is painful. But seriously, don't throw out perfectly good hardware before you even try to see if it would work!
    Last edited by PaulStoffregen; 02-09-2021 at 01:19 PM.

  13. #13
    I'm not experienced in electronic design, but I've been curious about using Teensy 4.x in retrofit applications with 5V devices, including SPI. NXP's latest level shifters support 5V to either 3.3V or 1.8V and operate up to 2 Mbps open drain or 20 Mbps push-pull. The 8-bit version is NTS0308EPWJ at $1.50 quantity one. Is this a simple solution or are there pitfalls in level shifting?

  14. #14
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,951
    There are always possible pitfalls with automatic bidirectional level shifting. Remember, every datasheet is a sales pitch designed to get you to buy the chip. They will almost always gloss over any gotchas, like noise or crosstalk falsely triggering the direction detection logic.

    For protocols like SPI and addressable LEDs, use unidirectional buffer chips (if translating the voltage truly is necessary).

  15. #15
    Quote Originally Posted by PaulStoffregen View Post
    For protocols like SPI and addressable LEDs, use unidirectional buffer chips (if translating the voltage truly is necessary).
    Thank you. I'm glad I asked.

  16. #16
    Member
    Join Date
    Dec 2016
    Location
    Wales
    Posts
    98
    I think it's worth pointing out that the teensy 3.5 and 3.2 are 5V tolerant, that means while they output 0-3V3, they won't be damaged by a 5V input on their digital pins. Think of it as an input-only level shifter if that helps. Say after you look through your modules, some are happy with 3v3 logic, but some can only output (send to the teensy) 0-5V: then you can use the Teensy3.5.
    You might find that you can use a Teensy3.5 for this project, and move towards 3v3 logic so you can use a Teensy4.1 in the future.

  17. #17
    Senior Member manicksan's Avatar
    Join Date
    Jun 2020
    Location
    Sweden
    Posts
    264
    I would ask the threadstarter
    what specific devices are you gonna use?
    Just to clarify some things

Posting Permissions

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