Teensy serial uarts voltage levels

Fluxanode

Well-known member
Do 5v ttl serial signals have to be level shifted to 3.3v before connection to the teensy serial ports?

I assume so but wanted to get confirmation.

Thanks,
 
Yes, for Teensy 4.1, 4.0, 3.6, LC. If you have a serial signal that transmits 5 volts, it needs to be shifted down to 3.3V before connecting to the receive pin because those Teensy models are not 5 volt tolerant.
 
I would personally consider using an isolator instead of simple level shifter. (Note, I am only a hobbyist myself, and I do recommend you do your own designs; showing mine only because they are so simple even a hobbyist like me can do them with freely available tools.)

Where a two-channel unidirectional level shifter like TXU0202 costs around USD $1 (at Mouser, Digikey, etc.), an isolator like TI ISO6721FBQDRQ1 costs under USD $2, does very much the same thing except with isolation, and requires only two additional 100nF supply bypass capacitors (see my simple design here, straight off the datasheet and thus feel free to reuse), that cost just cents. (Mouser sells you ten 100nF Samsung X7R CL21B104KACNNND in 0805 for 0.35€, for example.)

If you are not aware, the isolation means that no current passes over the isolator. On each side, there is one input and one output (for ISO6721FBQDRQ1). Each input and output is referenced to the VCC and GND on that side of the chip. One side can have say 3.3V signal levels, and the other side 5V. It does consume a little bit of power, maximum 37mW per side (under 7 mA at 5.5V, about similar to a small LED), and can do up to 50 Mbit/s (25 MHz 50% duty cycle signal) –– much more than say optoisolators based on actual LEDs ––, but as the power depends on the rate of transitions, it is usually much less, basically neglible.

When the other device is powered from a different supply than Teensy, this isolation becomes useful. It means you don't get surprise ground currents or current loops, which can even damage your Teensy and/or device. That can easily occur when you connect your Teensy to a desktop computer, and Teensy to a separately-powered thing like say a measurement device or a single-board computer.

When the other device is powered from the same supply, the isolator just wastes a bit of power, and acts like a level shifter. Then, TI TXU0202 level shifter (which I also use for UART stuff, much more robust/easy/reliable than any bidirectional level shifters!) is a better option. The circuit is almost the same for TXU0202 as it is for ISO6721, except that there is only one ground, and you need to pull the /OE signal to either VCC to enable the outputs: I recommend connecting it to the Teensy side VCC. The footprints and pinout differs, so the actual board is a bit different. I can draw up one if you want, but note that it can be cheaper to use TXU0204 (for 2+2 instead of 1+1 signal lines), though; this does leave two unidirectional signals unused so one can use e.g. RTS/CTS hardware handshaking if available, or perhaps an interrupt/notification line. I do have one for TXU0304, for SPI (3+1, maximum transfer rate 125 Mbps for 5.5V to/from 3.3V), which can be used for UART plus two outgoing signals from Teensy to that same device.

If you decide to create your own boards, do consider how you attach them. I always end up wishing I'd add a couple of ⌀ 2.5mm to 3.2mm for M2, M3, #2-56, or #4-40 screws, to my boards.
I even got an assortment of M2.5 nylon screws and standoffs (2.5mm or 0.098" hole) off Banggood for exactly this purpose.
 
Do 5v ttl serial signals have to be level shifted to 3.3v before connection to the teensy serial ports?

I assume so but wanted to get confirmation.

Thanks,

What you need for the level shifting are these. They were designed for serial port level shifting / use.
Breakout modules can be bought here as well as many other places.
I have used them without problem.
 
Is this the same for SPI inputs? If i have a ADC powered by 5V will I need to level shift the MISO and what about the CLK signal?
 
Chips that are not 5V tolerant are likely to be damaged or destroyed by 5V on any pin...
 
So the SPI levels will be different for 5v and 3.3v devices or is SPI at set predetermined voltage levels?
 
The details depend on the specific chip you're using and how it's powered.

But as a general rule of thumb, chips with SPI tend to output (MISO for slave mode, MOSI, SCK, CS for master mode) whatever power supply voltage you give them.

Some chips have a dedicated power pin just for the I/O, which is meant to allow you to power the internal circuitry of the chip from a different voltage. This is fairly common with audio chips using I2S, sometimes even having 3 power pins, for I/O, digital (typically lower voltage) and analog (sometimes higher voltage).

No universal standard applies. You should always read the chip's datasheet.
 
Back
Top