SPI Level Shifter from 3,3V to 5V


Hi , im having an encoder with SPI which operates with 5V logic levels , but the SPI on the Jetson nano is only 3,3V so im not able to communicate with the encoder. Is there any way to convert the 3,3V and the 5V so that i can read the sensor with the jetson nano ?

Any common level shifter like the TXS0108E will work.

Thank you for the response
I have red that these are relative slow and not that reliable : Does anyone have any suggestions for level shifters? - #27 by snarky
The clock rate will be around 500kHz. Will a simple and relative cheap bidirectional logic converter be a solution for me. Does bidirectional mean that my singal will be converted in both directions , from encoder to jetson nano and from jetson nano to encoder ?
Thank you

Here are the data sheet and users guide for the TXS series level shifters.

I have no issues using this part in many applications with the Jetsons. In open-drain applications, whiich is typically what SPI is, the max data rate is 1.2 mb/s. If you want to be safe, get the TXB0108 which has a higher data rate and is the one actually used on the Nano devkit carrier board to translate CPU’s 1.8v to the 40 pin header at 3.3v.

Both of these devices have bi-directional pins. Here’s a diagram. In your case, 3.3v would be on the left and 5.0v on the right.

You’d use 4 of the 8 channels, 1 each for MOSI, MISO, CLK, CS. Being bi-directional means that the level shifter doesn’t care whether the signal is being generated on the A side or the B side. For I2C applications this is required because both the controller and the device use the same line to send data so if channel 1 was used for an I2C SDA signal, the controller would send data to A1 and it’ll come out B1, and the device would send data to B1 and it would come out A1. For SPI this isn’t really needed because the master would send data to A1 (MOSI) and it would come out B1 and the slave would send data to B2 (MISO) and it would come out A2.

TXS is only useful for I2C signals. For SPI and UART and general GPIO signals, you wan the TXB series. However, if you are doing I2C or another open-drain system, you DO want the TXS series of shifters. The TXB may oscillate or not translate correctly for I2C bus signals. Also, I2C bus is typically just 400 kHz, so the TXS will work fine for that.

The TXS actually does pretty well for SPI (push-pull). It’s max data rate with 3.3v <> 5v is about 60Mbps and I get a reliable 15Mbps out of it easily. Having said that, I use them because I had a bunch left over from an unrelated project. If you can find the TXB, go for it.

A simple buffer like the 74LCX125 is also a good alternative for push-pull arrangements but you can’t usually find them pre-mounted on breakout boards.

Thank you for your help, I will test the solution once i get the bidirectional level shifter and I will post the result here. It may take some time. The detailed information you provided was really helpfull for me.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.