Forums

3V <-> 5V Level shifter ?

Started by Martial Chateauvieux January 28, 2005
        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

        
        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

        
Mark Borgerson wrote:

> In article <cte69n$n7e$00$1@news.t-online.com>, Chawig@T-Online.de > says... > >> 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 ? >> > > > When I run into problems of that sort, I usually use one of the > buffer/drivers with 5V tolerant I/O. Something like a 74LCX245 > would work. Ycan also use something like a > N7SCZ125, which is a single buffer in a SOT23-5 package. You > use 3.3V to power the buffer, but its inputs and outputs can > be connected to 5V chips. > > Mark Borgerson >
For most stuff coming out of a UART you can just use a resistive divider. Check the AVR input to see if it'll take 3V as logic high going the other direction. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
"Martial Chateauvieux" <Chawig@T-Online.de> wrote in message
news:cte69n$n7e$00$1@news.t-online.com...
> > 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 ?)
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
"Martial Chateauvieux" <Chawig@T-Online.de> wrote in message news:cte69n$n7e$00$1@news.t-online.com...
> > 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 ?)
Philips do a range of level shifters http://www.semiconductors.philips.com/catalog/219/282/27063/29482/index.html#29482 You just need to connect up the 3V and 5V supplies, and ground the OE pins, and you're good to go.
> > any better idea ? > > Thanks > Martial Chateauvieux > >
In article <10vlelsse3oh5b2@corp.supernews.com>, 
mhsprang@NOcustomSPAMware.nl says...
> "Martial Chateauvieux" <Chawig@T-Online.de> wrote in message > news:cte69n$n7e$00$1@news.t-online.com... > > > > 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 ?) > > 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. >
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
Martial Chateauvieux <Chawig@t-online.de> wrote:

> 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 ?
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 --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
>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 >
Doesn't the Mega need 0.6*VCC as Vih(min) , the datasheet says so .. 0.6 x 5V = 3V 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:
> 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
On 29 Jan 2005 13:54:06 -0800, "An Schwob in USA" <schwobus@aol.com>
wrote:

>Two better ideas: > >1. use an ARM microcontroller e.g. LPC2000 from Philips or Atmels SAM7s >they are all 3V by definition
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