3V <-> 5V Level shifter ?

Hi,

I want to connect a GPS Smart antenna SAM LS from u-blox, to the UART of an atmega128 running under 5V.

Unfortunately the GPS runs in 3V and has 3V compatible IOs. I set up a 3V regulator already for the power supply. Can someone explain how to build a level shifter from 3V to 5V with a transistor ? (How do I choose it, how to connect it ?)

any better idea ?

Thanks Martial Chateauvieux

Reply to
Martial Chateauvieux
Loading thread data ...

transistor ?

You don't need all that. The TX signal from the u-blox can go right into the input of the atmega, since everything above 2.5V is seen as '1'. The signal from the atmega to the u-blox can be brought down to 3V by a voltage divider with two resistors: 12k and 18k. I've used this in a commercial product and it runs just fine.

Meindert

Reply to
Meindert Sprang

Philips do a range of level shifters

formatting link

You just need to connect up the 3V and 5V supplies, and ground the OE pins, and you're good to go.

Reply to
HP

That's probably correct. When I was connecting 3V and 5V systems, I was connecting a 5V ADC to a 3V SPI serial port. The clock and data were running at 2MHz, and I had to use the tri-state feature to allow the SPI bus to be used for other peripherals.

Mark Borgerson

Reply to
Mark Borgerson

Most 5 Volt Circuits can cope with 3.3 Volt CMOS Signal, which has around the same levels as normal 5 Volt TTL Outputs. If you really want to shift 3 Volt CMOS to 5 Volt CMOS, use a TTL level compatible CMOS gate, like AHCT, with 5 Volt supply. For the way 5 Volt CMOS to 3 Volt CMOS, look for 3 Volt Gates with 5 Volt tolerant inputs, like AHC. For bidirectional busses, there are devices to with two supplies, however ther need additional direction signals and need some conditions when switched on, or there is a chance that they will latch.

If you want to connect a 3.3 Volt device to a 5 Volt TTL/CMOS Bus, use a passive busswitch, like the SN74CBTD3861.

Bye

--
Uwe Bonnes                bon@elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
 Click to see the full signature
Reply to
Uwe Bonnes

Doesn't the Mega need 0.6*VCC as Vih(min) , the datasheet says so ..

0.6 x 5V = 3V

Carsten

Reply to
Carsten

Two better ideas:

  1. use an ARM microcontroller e.g. LPC2000 from Philips or Atmels SAM7s they are all 3V by definition
  2. as already mentioned compare output levels to input levels both ways. If this is for a hobby project, just measure the voltage levels, if it is for a product you want to vcreate and sell, you better get the specifications of the output and input levels.

An Schwob

Martial Chateauvieux wrote:

the

someone

transistor ?

Reply to
An Schwob in USA

The ATMega128 also has a 3V version available. The only "problem" is that the maximum clock frequency is only 8MHz in stead of 16MHz. For talking to a GPS module, an 8MHz ATMega128 should be plenty powerfull enough.

Regards Anton Erasmus

Reply to
Anton Erasmus

the

signal

divider

and

Correct. In my case, the LV device runs at 3.3V, and there it works. So did the OP really mean 3V or 3.3V? But even with 3V it can be done with a shottky diode (to make the 3V output behave like an open collector/drain) and a pull-up resistor. No need for fancy circuits.

Meindert

Reply to
Meindert Sprang

Sounds interresting , Meindert would you please give an example , i'm a bit of a electronics beginner ??? Im going to interface a Dataflash to a Mega162 , and was planning on using a HCT as levelconverter for the dataflash SO , but would like to avoid it if possible , i will be using a Micrel mic2920 LDO as 3v3 regulator , or maybe "just" the 3 x 1n4148 in series from 5v "trick".

Does it have to be a Schottky diode ??

TIA Carsten

Reply to
Carsten

Assuming the dataflash is 3.3V and the mega162 is on 5V, you can connect the DO from flash directly to the DI from the mega.

Using a schottky diode is good for two reasons: the voltage drop is lower ( and therefore the raise of the 0-level voltage) and they are much faster and have a lower recovery time. But if the flash is on 3.3V you don't need a diode at all to simulate an open drain output to the mega.

The DO from the mega should be brought down to 3.3V. I have used a voltage divider for that (2 resistors) but this was for a low speed connection (57600 baud max.) I am afraid that the signal edges could be affected too much to run this on 1 mbps or higher when communicating to the flash.

Meindert

Reply to
Meindert Sprang

... snip ...

Or germanium :-) The point is that the lower forward drop does less harm to the low logic level.

--
"If you want to post a followup via groups.google.com, don't use
 the broken "Reply" link at the bottom of the article.  Click on 
 Click to see the full signature
Reply to
CBFalconer

Im quite sure that Atmel says that the DataFlash has 5v tolerant input signals.

But i have seen the divider trick used on a mmc card.

Just for learning the opencolector stuff , how do you connect the schotky and the resistor.

I guess the resistor goes to vcc , but what about the diode ??

Is it like this :

---------------|--------Vcc | Pullup |

DO----------|>-------|-----------------------AtMega-Input

Regards Carsten

Reply to
Carsten

Almost. The diode must be the other way around and the resistor must be sitting between the atmega input and VCC

But you'll probably don't need this at all.

Meindert

Reply to
Meindert Sprang

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.