Electrical – How to connect a W25Q64 3.3 SPI Flash to a 5V Arduino Mega

bufferflashspivoltage divider

I need memory to read from, for my project. I first intended to use an SD card, but I now found out a W25Q64/128 SPI Flash is more practical, since I don't need to write data.

However, this W25QXX Flash works with 3.3V SPI and the Arduino Mega has a 5V SPI.

By searching around, I find many solutions, but two that work which are quite different:

  • Using a voltage divider, which has the advantage of a simple circuit, but has problems that too less current is passed. However according to this link, in the end, someone fixed it easily by using much smaller resistor values.
  • Using a buffer circuit, which has the advantage of probably being more secure, but means some quite big ICs to be added. A circuit is mentioned in this link; credits to Steve Marple.

Question: Why should I (or shouldn't I) use this SPI Flash with a 5V using small resistor divider voltages?

(It seems that if I only want to add only this single 3.3V SPI Flash on the SPI bus, I can use the voltage divider using small resistors).

UPDATE

After Marcus Müller's answer, I found the following page that gives a lot of backgrounds (his solution is indeed the one with the most advantages):
how-to-interface-a-5v-output-to-a-3-3v-input

Best Answer

Assuming you don't plan to use the chip in anything but standard SPI (not Dual- or QSPI), then all the signal pins are unidirectional!

That means that in the Arduino->Flash direction, a voltage divider that divides 5V down to 3.3V is sufficient (place it close to the receiving end, usually). This applies to the clock and the master-out, slave in (MOSI) data pin (called "Data Input" in the flash datasheet).

In the opposite direction (MISO / Data Output), there's little you can do to ensure reliable transmission but buffer. A buffer doesn't have to be large – in fact, a dual-NPN package would totally do with two resistors, and that would take single-digit square millimeters in SMD.

You might simply want to invest 33ct into something like a 74LVC1T45. That thing is maybe 1.7×1mm² in size even in its largest variant; I doubt that will be a limiting factor for your circuitry.