SPI between peripheral 3.3V as read only and ARDUINO 5V

Hello everyone!

I am working on a project that requires communicating via SPI with the MAX31855 IC, which is responsible for reading a K-type sensor.

The MAX31855 communicates with the microcontroller via SPI specifically, it is a read-only device.

It has CLK, CS, and SDO pins (with SDO connected to the MISO pin of the Arduino ATmega328P). The MAX31855 is a 3.3V IC, while my Arduino operates at 5V. I designed my circuit and PCB using a Texas Instruments TSX0108E (or TSB0108E) IC between them.

Only after made the PCB did I discover a number of issues with using this IC as a voltage level shifter for SPI communication... right here on the forum, there are several reported cases of malfunctions in this type of application.

Upon closer analysis of my application, I have a question: Since the MAX31855 is read-only—meaning the Arduino's MOSI pin isn't connected (implying the Arduino acts as the "slave" in this context) — could I connect it directly to the Arduino? Is there any risk of damage? The signal coming from the MAX31855 is 3.3V and enters the Arduino (which is powered at 5V)... so there wouldn't be a 5V signal feeding back into the MAX31855, right? If this is feasible, I could simply use a jumper connection between the Arduino and the MAX31855, avoiding the need for the TSX0108E or TSB0108E.

I think CLK and CS comes from Arduino... and this is a problem, right?

Thanks for Any help!

What about SCK ?

Yep exactly. Mind you nothing that a simple voltage divider wouldn't be able to fix. Using 3x 1K per pin will probably work.

Thanks!

Yep! But I already have the PCB with TSX0108E. I will try work this soluction before make a revision in a PCB.

Only the SO signal
What about SCK an CS?

If you are doing a redesign, you may consider using the schematic of the widely used Adafruit module as a reference:

I used one of these modules connected to a 5 V Arduino mega board for years in an application where reliability is critical (glass annealing kiln), without any problems at all.

I think I can do that in the current PCB. Thanks!!

The TI TSx parts are bi-directional level shifters. All of the SPI lines are uni-directional, so those chips aren't really the right ones even if they kinda work. Also, the MAX data sheet says its clock pin is an input, which I think means the 328P is the master.

You definitely need to reduce the 328P's 5V outputs down to 3.3V. Coming the other way, it's possible you could just directly connect the MAX data output to the MISO pin. Most of the time this works ok, but if this is an official product, you probably want to look at something a bit more uptown. Edit: Actually, the Adafruit module just connects DO directly to MISO, so it's very likely that will work reliably.

I'd suggest you look at the 74LV1Tnnn series of buffer chips. These are uni-directional single-gate buffers designed specifically for voltage translation. You can use them to translate up or down. The 74LV1T34 is the regular buffer, and the 74LV1T125 is the same but with an active-low ENable pin for the output. You would need that if you have more than one SPI device in the system.

So you could use two of the '34 chips for the 328P outputs, powered by the 3.3V supply, and one '34 or '125 for the MAX data out, powered from the 5V supply, with the 328P's CS output controlling the EN pin. These LV1T parts are basically just plain non-inverting buffers, with very tolerant inputs. But they are fast, and don't draw much current.

That's a bad design.

I got. perfect.

This project it is a PCB to replace a solution in my Weller iron station.

I will read the iron sensor (K type) with MAX and control a TRIAC to on/off the heater according to the sensor...

I`m just have a PCB comes from China... To use the '34 solution I need redesign and buy new pcbs...

In the first moment I choose the TI TSx solution because the size of TSSOP20 it is a good option to lower space in the PCB.... It is not a good option.. I can see only now..

The diodes like the Adafruit module it is possible soldering in the TSx PAD without a lot of problem... But I can`t soldering the '34 solution... I will try soldering a diode with pull-up resistor.. Will be a "pig" job but will work better than TSx solution for while..

I check in the software to make a revision in my PCB with '34 solution to keep the final project according.

Thanks!

I know that... But to save a PCB it is acceptable.

Next time don't make a PCB until you have a working tested circuit built on protoboard or similar, at least on breadboard(s).

One 5V->3.3V converter is the 74HC4050 with 6 channels on 16 pins.

It's small, cheap and able to level 2 SPI ports (3 lines ea).

BUT you could cut 2 traces and wire 2 voltage dividers to your PCB and then every time you solder, you'll be reminded of this. That's got some value right there!

Only if it works reliably.
A voltage divider would work better

This isn't the kind of solution I want to waste time prototyping, especially given the TSSOP20 package.

As I see it, the main issue lies in the bad performance of the TI solution found in the tsx0108e/txb0108 series.

If you take a look at the datasheet, you'd consider it for this application.

It has sufficient data speed for SPI communication—the MAX version supports 3 MHz according to the datasheet.

There is a TSX version with internal pull-ups and a TSB series without pull-ups (recommended for push-pull applications); I believe the latter part number would be ideal for SPI.

About the direction: as I see it, SPI have two pins going one way (CLK and CS) and one pin going the other (SDO) on the 3.3V side. A bidirectional solution that doesn't require manual direction control seems like a good option here.

I haven't tested it on the board yet. I'm just raising the topic before assembly... It might work either way. If not, mounting diodes under the TSSOP pad doesn't seem like a bad idea for my application. Based on my research, I might run into malfunction issues down the line, so I really need to choose a more robust setup.

I can live with that!

Bidirectional in level-shifting circuits usually means either end can be the driver at different times. That's what you have with I2C, but not with SPI. Each of the SPI lines is unidirectional - it is always driven by the same end. Of course you can say that a bidirectional circuit should be useable in a unidirectional implementation, but the complications needed to make a bidirectional level shifter work can make it perform not so well. I think your original TI parts are an example of that. As you noted, a lot of people have trouble using them.

Yes, perfect your comment!

To be bidirectionl internally have a one shot circuit to switch the correct PMOs transistor. This is the problem to use in a SPI mode... It is like a sensor...

I will try use a TSB.. without pull-up resistor, will be better for SPI application. My ICs is closer with others (TSB + ATMEGA328 + MAX), less than 10mm. I don`t use external wires like thtat.. I read a lot of problem when have this application.. Let me try.

Thanks!

You have clock, cs and mosi plus power to make 3.3V. Some members used 3.3V AVR's at 8MHz for easy 3.3V. I did run SD cards on Uno, Mega and standalone chips, it took leveling 3 lines.

Is this the SPI project that does no mosi? Then yes, only 2 lines. Why not splice in 2 resisters each like patch jumpers? I remember seeing boards with patch wires in the 80's when I got around more.