Level Translator for AVR and microSD
The SD specification stipulates 2.7V - 3.6V for all IO and power.  Using any other voltage will most likely cause death to your SD card.

Assuming you are running the SD card in SPI mode (most common for small microcontrollers), then you don't need to translate the signal from the SD card to the ATMega32, since 3.3V is a valid HIGH input even when running at 5V.

You will need to translate the 5V from the ATMega32 to the SD card though, and that will only be one way.  A simple 74-series buffer or logic gate of almost any kind will do the job.  A common one is the 74HC08 AND gate, with both inputs of a gate tied together to form a buffer.  Run the chip from 3.3V, feed the 5V signals directly into the inputs via a small series resistor (say 1KΩ) and it should translate the 5V signals to 3.3V quite happily.







simulate this circuit &ndash; Schematic created using CircuitLab

The 74HC08 (in common with the other 74HC series chips) has quite robust input clamping.  Any voltage that is more than Vcc + 0.5V, so anything above 3.8V in this case, gets routed through input clamping diodes to the Vcc rail, clamping it at Vcc + 0.5V, so 3.8V.  That current should be limited to below the "input clamping current limit", which is 20mA limit.  The 1KΩ resistors limit the current to a tiny (\$5 - 3.8 = 1.2, \frac{1.2}{1000} = 0.0012\$) 1.2mA.