# Level shifting between SD Card and Lipo-powered microcontroller

I have an ATtiny861 microcontroller powered directly from a Lipo battery. My circuit is designed to operate on supply voltages from 3V - 4.2V (bonus if it tolerates up to 4.6V).

I need to interface with a MicroSD card, which works around 3.3V. I'm using this datasheet from Kingston as a reference (feel free to point me toward a more authoritative spec).

I'm looking for suggestions on sourcing (or building) a level shifter that tolerates the entire 3V-4.2V range on one side, and 3.3V on the other. Initially I looked at the TXB0104 but it's inappropriate because it requires one side always remain lower than the other. (I suppose I could run my SD card under-voltage, eg. at 2.9V, but I'm hoping there's a better way).

Also note I'd like to minimize part count, routing complexity and footprint (in roughly that order).

A few more details:

I only need to read the card, and am limiting myself to SPI mode. That means three unidirectional "output" lines from the uC to the SD (CLK, CMD, CS/DAT3), and one unidirectional "input" line from the SD to the uC (DAT2).

Running the uC at 3.3V isn't an option I'm considering. It spends most of it's time sleeping, and periodically wakes to see if activity is required. I figure putting a linear or buck converter between the battery and uC would likely waste some power due to conversion losses during these periods. It would also necessitate a redesign of some other parts of my circuit.

I'm powering the SD card with a 3.3 buck regulator (PAM2301CAAB330) which is shut down when I'm not reading the card (nor using other devices sharing the same enable line).

I could probably do a quick-and-dirty hack by wiring the input directly to the uC, and the three outputs through voltage dividers. It might work at "typical" values, but would violate the min/max specs of the components.

Some helpful tidbits from the datasheets:

uC input HIGH min: 0.7 * Vcc (so down to 2.1V)
uC input LOW max: 0.2 * Vcc
uC output HIGH min (@3V Vcc): 2.5V
uC output LOW max (@5V Vcc): 0.6V

SD Vdd: 2.7V - 3.6V
SD input HIGH min: 0.625 * Vdd
SD input LOW max: 0.25 * Vdd
SD output HIGH min: 0.75 * Vdd
SD output LOW max: 0.125 * Vdd

• – rkagerer Aug 4 at 3:42
• I'm presently investigating TI's SN74LVC1T45 transceiver which I think may not require one side to always be higher than the other. Would be great if I could find a "quad" version, especially with less Direction pins. – rkagerer Aug 4 at 4:19
• You could try using the lowly (in today's world of switching converters) 3.3v Zener to power the SD card. Just that, with appropriate series resistor, might be all you need. Check it out! – Kripacharya Aug 4 at 5:24
• @Kripacharya: Thanks for the suggestion! Do you mean using Zeners on uC output lines instead of a voltage divider, or as an alternative to my PAM2301CAAB330? I shied away from the latter since the SD card will draw a varying amount of current and I wasn't sure just how much that range (esp. peaks) narrows when use is restricted to just reading (although tests indicate an average might be around 10mA). – rkagerer Aug 4 at 5:34
• Not on the lines. Only to power the SD card. – Kripacharya Aug 4 at 5:37