Level Translator for AVR and microSD

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello!
I want to connect a microSD card in my AVR ATMEGA32 which its operate with 5V.
The microSD card i think that operates with 3.3V so, it is must to connected via bidirectinal level translator.

 

I found this TI's translator 1-BIT BIDIRECTIONAL VOLTAGE-LEVEL TRANSLATOR
FOR OPEN-DRAIN AND PUSH-PULL APPLICATIONS
 
which its accepts any voltage from 1.65V to 3.6V in input A, and 2.3V to 5.5V in input B.

My matter is: Can i direct wire the chip's I/O between AVR and microSD?
or it's only, as the datasheet say, "for open-drain and push-pull applications"?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Interesting chip.

 

Be careful not to confuse the fact that an SD card is a bi-directional device, one to which one can both read and write; and a bi-directional data line, where a single data line has to operate in both directions.

 

The chip you mentioned is a bi-directional data line level converter. 

One can send signals back and forth, quickly, in either direction, at two voltage levels.

That chip also does this without a separate bit defining the data direction.

It is truly a cool chip.

 

For an SD card, I think, each line is uni-directional.  The overall device is bi-directional.

 

One could certainly use a bi-directional chip for a uni-directional level converter / interface, but it is overkill to do so, you aren't using the key feature of the chip which is its bi-directionality.

 

The circuit below is an old design, my first project which used an MMC card, (the predecessor to the SD card).

I show it to make the point that each signal line is unidirectional.

Three signals need to be converted from 5V to 3V.

One signal needs to be converted from 3V to 5V.

 

Clearly if you are making lots of SMD PCBs a chip converter is much better than a handful of discrete components.

That said, the discrete component approach let me prototype this section of the project with what I had on hand.

 

JC

 

 

 

 

Last Edited: Sat. Nov 15, 2014 - 06:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

An interesting chip to be sure.  But not really that amazing.  You can do almost the same thing with a MOSFET and a couple of resistors:

 

From http://husstechlabs.com/support/tutorials/bi-directional-level-shifter/:

 

 

Google says:

https://www.google.ca/search?q=b...

 

The chip mentioned by the OP adds an OUTPUT ENABLE pin, and is a bit more robust electrically (guarantees about power-up sequence, etc.).  Probably does some other things as well (haven't read the datasheet all the way through), but it's greatest advantage might just be that it's a single package.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

giorgos3924 wrote:

My matter is: Can i direct wire the chip's I/O between AVR and microSD?
or it's only, as the datasheet say, "for open-drain and push-pull applications"?

Yes, you can use this chip between a uC @5V and a uSD @3.3V.

 

Also note the TI TXB0104, which is similar to the TXS0101, but is 4 bits wide in a single chip.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's the active pull-up that's a feature (but not unique; others have that function).

The follow-on to TI TXB and TXS is LSF.

TI Home > Semiconductors > Interface > Voltage Level Translation > Dual Supply Translator >

LSF0101

Single Bi-Directional Multi-Voltage Level Translator

http://www.ti.com/product/LSF0101

"Dare to be naïve." - Buckminster Fuller

Last Edited: Sun. Nov 16, 2014 - 12:50 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had some issues using the TXB0104 in a uni-direction SPI application. I suspect that when the Slave Select was released the MISO pin changing to HiZ occasionally caused the TXB to altered its direction and upset the comms to other devices on the SPI.  Occurred very rarely; but usually when performing remote (OTA) boot-loading.

Never did get back to confirm this behavior but its worth studying the recommendations carefully.  I may have been a bit careless here.blush

 

Steve

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The 74LCV244 (or other LCV chips) are good for the 5v->3v3 direction; they work in the other direction but don't translate up to 5v which costs you some safety for any dubious levels.

 

To go from 3v3 to 5v, tie the 3v3 output to the emitter of a fast transistor, tie the base to 3v3, and take the output from the collector which is pulled up to the 5v rail. (I think I got that the right way around!)

 

Neil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

What about if we have micro at 5V and  multiple  3.3V SPI slave devices like an SD card + another SPI chip. Can we use only one level shifter like this 74HC4050D for the SCK MOSI CS1 CS2 .. lines and on the 3.3V side connect multiple SPI slaves? Or we need one level shifter for each SPI slave?

 

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Life is an awful lot easier if you just run the AVR at 3.3V

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

Life is an awful lot easier if you just run the AVR at 3.3V

 

David.

 

Yes, but people don't like doing things the easy way.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One 5v-3v3 shifter for the MOSI and CK lines, one 3v3-5v shifter for MISO, and one 5v-3v3 for each SS line.

 

But if you are selecting by number (e.g. three lines to select one of eight slaves) rather than individual lines, you need only use converters on the group lines; run the decoder at 3v3.

 

Neil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guys i know it's better to use 3.3V but i need to interface an arduino uno (5V) with two SPI slaves and i was wondering if it's OK to use just one level shifter IC.

 

So it is doable, thank you for your info barnacle!