2
\$\begingroup\$

I am using 5V logic microcontroller and I want connect the Hardware SPI bus to SD CARD and Ethernet chip(W5500). Using below circuit I am not able to initialization SD card.

Below is my schematic:

Base on 74LVC126AS14-13 data sheet this chip should be able to convert between 5V and 3.3V.

I even lower my SPI speed (Division of 4,16) and still same problem. (Clock speed is 7.37Mhz), I even by pass MISO (Direct) same problem.

enter image description here

Below is my questions

  1. What is wrong with this circuit or even can I use Logic buffer on SPI bus
  2. If I can not use logic buffer can I use something like TXU0304
  3. Since I have two slave do I suppose to connected differently.
\$\endgroup\$
2
  • \$\begingroup\$ Your circuit looks OK, could be a silly layout bug. I used NL37WZ16USG with 3.3V supply between 5V atMega2650 and an SD card, MISO routed directly back. Pullup resistors for the CS signals on the 5V side is good style to avoid MISO collision during MCU reset states. \$\endgroup\$
    – Jens
    Jul 18, 2022 at 17:30
  • \$\begingroup\$ @Jens: In order to test my layout, I removed the 74LVC126 and short the pins and it works fine. \$\endgroup\$
    – Shahreza
    Jul 18, 2022 at 17:42

2 Answers 2

1
\$\begingroup\$

The bus is not always SPI, because SD cards must be switched into SPI mode by sending native-mode commands. So you have bidirectional open-drain signals.

There are specialized SD card translators like the TXS0206, but they do not handle 5 V.

It might be possible to use a general-purpose open-drain bidirectional translator like the TXS0108E. (Bidirectional translators that are not open-drain, like the TXB0108, will not work for SD cards.)

\$\endgroup\$
1
  • \$\begingroup\$ The card switches to SPI mode when you send the first command CMD0 with chipselect low, which can be sent over SPI bus so the bus lines don't need to be in native mode at all and unidirectional signals are fine. After all, the cards must be SPI compatible in order to put them into SPI mode in order to use them with a SPI host. \$\endgroup\$
    – Justme
    Jul 18, 2022 at 20:13
0
\$\begingroup\$
  1. The problem is that generally the LVC should be used with 3.3V supply and it can do 5V to 3.3V conversion. LVC is not intended for 5V operation, and even if it works at 5V supply, it may not work properly with 3.3V input when powered with 5V supply.

  2. Maybe, depends on what you want to do with it (see #3)

  3. Maybe, as it is unknown how you connected it, but the rule is that you cannot connect two outputs together if they are active at the same time, so if you did so it will not work no matter what chip you use.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks for the answer and now make more sense why LVC doesn't work for me. How about 74HC does that work, or any of 74 Series will work for me. #3 I am sharing Hardware SPI between two chips, so I am not trying to use both of them at same time. \$\endgroup\$
    – Shahreza
    Jul 18, 2022 at 17:18
  • \$\begingroup\$ 74HC does not work either. Yes many series can convert 3.3V levels to 5V levels. #3 Of course you use one at a time but if you have any two outputs connected together it won't work. \$\endgroup\$
    – Justme
    Jul 18, 2022 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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