0
\$\begingroup\$

My SPI bus has 2 slaves, one is 5V tolerant and is connected normally to the bus, however the second one is only 3V3 tolerant and so I have to level shift it. I have decided to use the 74AHCT125 buffer, however I have some questions regarding this.

  1. Should the buffer Vcc pin be powered with 5V (Master) or 3V3 (Slave)?
  2. Are my following connections correct based on this information?

MOSI: Arduino MOSI (5V) -> Buffer Input -> Buffer Output -> 3.3V Device MOSI

SCK: Arduino SCK (5V) -> 74AHCT125 Input -> 74AHCT125 Output -> 3.3V Device SCK

SS: Arduino SS (5V) -> 74AHCT125 Input -> 74AHCT125 Output -> 3.3V Device SS

MISO: 3.3V Device MISO -> 74AHCT125 Input -> 74AHCT125 Output -> Arduino MISO (5V)

OE: Connected to ground (active low)

Vcc: Not sure

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$
  1. 5V, because that chip works only on 5V and outputs 5V. It would be a great chip for level shifting 3.3 to 5V, but will not work for level shifting 5V to 3.3V.

  2. No it would burn up the 3.3V device if you use a 5V supply or would not work if you use a 3.3V supply,

Even if the chip did work at 3.3V, the 3.3V output is generally not enough for a 5V MCU. But also if you power the chip with 3.3V supply, it cannot tolerate 5V on the input.

\$\endgroup\$
11
  • \$\begingroup\$ Thanks, is my solution a bidirectional level shifter then? The slave will be powered with 3V3 and Arduino with 5V. \$\endgroup\$
    – zoghii
    Commented Jul 8 at 5:38
  • \$\begingroup\$ @zoghii Please define bidirectional. You can use that chip for 3.3V to 5V conversion, and use similar chip that can handle the 5V to 3.3V conversion. If you go use FET&resistor based bidirectional level shifters for SPI, or use autosensing bidirectional level shifter chips, the next thing you likely ask here is why they don't work in your system. Further options, use a 3.3V Arduino board, or, use a 3.3V non-Arduino board. \$\endgroup\$
    – Justme
    Commented Jul 8 at 5:43
  • \$\begingroup\$ Something like TXU0304 or TXB0108 chips since I need both 5V to 3V3 and 3V3 to 5V. I have read that the FET solution gets abit dodgy at higher CLK speeds. \$\endgroup\$
    – zoghii
    Commented Jul 8 at 5:57
  • \$\begingroup\$ The TXU might work for you if you use it correctly, but far simpler and cheaper solution like adding a LVC125 would suffice. Plus, I already warned about the TXB and similar chips, unless you use it it correct conditions, you are likely get glitchy operation, as the MISO would be either driven by the 3.3V chip or tristated as the 5V chip drives it or is tristated. \$\endgroup\$
    – Justme
    Commented Jul 8 at 7:18
  • 1
    \$\begingroup\$ @zoghii I already said you need two xxx125 chips - one for 5V to 3V3 and one for 3V3 to 5V. You cannot do what you explaned in previous comment for two reasons : 3.3V supply means 3.3V out and your 5V MCU will not see it properly, and if you tie all enable pins active, the MISO out from the xx125 will always be an output and will interfere with the 5V chip output when it tries to drive MISO to MCU input. You cannot have two outputs driving one input simultaneously, but you can use the CS to enable a buffer. \$\endgroup\$
    – Justme
    Commented Jul 8 at 8:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.