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

Thread: Best practices for not frying a non-5v-tolerant Teensy

  1. #1
    Junior Member
    Join Date
    Dec 2017
    Posts
    3

    Best practices for not frying a non-5v-tolerant Teensy

    Hi everyone! First-time poster, long time lurker.

    I recently broke a Teensy 3.6, by replicating the habits I learned on the Teensy 2.0 and sending Vin to my breadboard rails. 5v came back to A0 through the potentiometer I was testing, and then I could smell burning plastic. No more Teensy 3.6. Thankfully, someone took pity on me and gave me a replacement.

    I'm a bit worried I'm going to make the same mistake again, because I want to get the Teensy to receive serial input from an Arduino Uno. I gather that sending the signal from the Uno's Tx pin straight into an Rx pin on the Teensy 3.6 will overload it, and I should not do that.

    I'm trying to learn about level shifting and voltage dividing and whatnot so that I have the tools I need, but I also wanted to ask here if there's a particular breakout board or component that people tend to use when they want to get any of the non-5v-tolerant Teensies to listen to an input signal from a 5v system.

    This feels like one of those questions that has a very obvious answer, but it's just not obvious to me because I lack the vocabulary or knowledge to make the right mental connections or do the right google searches.

  2. #2
    Member dauntless89's Avatar
    Join Date
    Jun 2017
    Location
    Cedar City, UT
    Posts
    50
    I don't know exactly what your project is, but it sounds like a simple voltage divider is all you need:

    https://www.allaboutcircuits.com/too...er-calculator/

    If necessary, I build my level-shifting into the voltage divider for analog inputs. I also like to protect those inputs by using two diodes, one connects from Ax to the 3.3v bus, the other connects from the ground bus to Ax, in those directions. This prevents any unexpected positive or negative voltage spikes from acting on the Ax pin.

  3. #3
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,869
    Not knowing project details ... Do you need to jump right to the T_3.6? You could start with a T_3.5 that has 5V tolerance on 'pins with digital I/O' capability. That would allow working toward the T_3.6 without having to smell that expensive {time&money} smell searching for the right shifter solution - and then be a smaller set of changes if any to use the T_3.6 when it is safely working.

  4. #4
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    1,907
    I use breadboards which have + and - rails on both sides. The - rails are connected together and to the GND pin. The + rail on one side is connected to Vin and the + rail on the other side is connected to +3.3V (where I had connected the hot end of the potentiometer).

  5. #5
    Junior Member
    Join Date
    Dec 2017
    Posts
    3
    Thanks everyone! This was extremely helpful. I'm going to learn how to use diodes to protect input pins, and do it to any pins that are taking in a signal from outside of the circuit.

    I don't fancy buying a 3.5 having already bought a 3.6 (I should have probably just bought a 3.5 in the first place, and now I'm determined to work with what I have), but this did remind me that I can at least test the serial input on one of my 2.0s, even if I can't do any of the audio library stuff with the information.

    After further googling using the language you all taught me on this thread, I decided to get one of these: https://shop.pimoroni.com/products/s...bi-directional
    Everything I read about it makes it sound like a very simple solution to the problem - are there caveats that I'm missing?

    One more question: when using the line in/out connectors on the Teensy Audio Board, do I need to be making similar considerations about the voltage of the other system? Or does the regulator on the Audio Board mostly handle it?

  6. #6
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    1,907
    The audio board can be connected without level conversion.

    BTW, these level converters as the one you linked in your previous post, are not ideal when it comes to high speed data transmission, since the used MOSFET transistors have an important gate-source capacitance which acts as a low pass filter.

    Perhaps not immediately, but very soon, you should consider moving all your stuff over to 3.3V, the 5V technology is totally outdated in industry electronic development and the 1.8V technology is already at the horizon!

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,363
    Quote Originally Posted by zoy View Post
    Everything I read about it makes it sound like a very simple solution to the problem - are there caveats that I'm missing?
    Yes, there are indeed many caveats with those level shifters.

    As a logic input, they also have a 10K pullup. That's similar to using pinMode(pin, INPUT_PULLUP) in Arduino. If what you need is INPUT (not pullup), these converters can't give it to you. They are permanently in pullup mode, which is fine for many uses, but not nearly as flexible as a normal digital pin.

    Their logic high output is very weak, because it's created by only a 10K resistor. Usually you can expect a digital output to be able to source several mA current, but with these you get almost none.

    The weakness of logic high output also means these converters are somewhat slow. How slow depends on the capacitive load they're trying to drive. Results also vary depending on the output impedance (or "strength") of whatever is driving their input side. For a short wire carrying a low speed signal from a strong source, usually not an issue. For driving a long cable or high speed signals like SPI, they're pretty much worthless.

    While the low-to-high output is slow, going from high-to-low is relatively fast. That's ideal for "open collector" protocols like I2C (SDA & SCL signals), but this asymmetry can be terrible for others. PWM waveforms in particular suffer, because the differing time can end up effectively distorting the PWM duty cycle. Single wire protocols like WS2812/NeoPixel LEDs also depend on pulse widths, which get pretty much ruined by these types of level shifters.

    Unfortunately the sites which sell these level shifters rarely mention these caveats. They sometimes give the impression this circuit is a cure-all, good for pretty much any level shifting needs. The truth is they do work well for lower speed signals when you don't need strong output. But many hobbyists have suffered much frustration from these level shifters due to the overly optimistic sale pitches on so many websites.

  8. #8
    Junior Member
    Join Date
    Dec 2017
    Posts
    3
    Thanks so much Paul! That really clears it up. Very glad to know what the deal is with these too-good-to-be-true level shifters!

Posting Permissions

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