Signal Level Shifting

westaust55

Moderator
Occasionally the need arises to interface the PICAXE to another IC that needs to operate at a different voltage.

Until recently most would operate their nominal 5V PICAXE chips at 4.5V or 5V and occasionally 3V. Now there are 3V options as well.

Occasionally there are chips that must operate around 5V. The DS1307 RTC is such an IC having a minimum operating voltage of 4.5V.

EEPROMS such as the 24LC256 can operate at 3.3V or 5V quite happily.

Other new ICs and modules operate at voltages in the ranges such as 2V to 3.6V

Even the gLCD modules some of us have used out of mobile phones such as the Siemens A55 and Nokia 3310 operate at 3V.

In the past, there has occasionally been reference to use of two resistors as a potential divider. Examples include a 10K over a 20k (2 x 10k) resistor or a 4.7K over a 6.8k resistor are some examples.

Around a year ago I had purchased a few 74HC245 bi-directional 3-state octal bus transceivers but then had to put a resistor divider in from of the inputs.

It came to my attention shortly thereafter than there is a 74LVC range of IC's intended to operate at around 3V which have 5V tolerant inputs. I subsequently purchased a few 74LVC245A chips but they and seemingly most of the 74LVC range available come in SOIC surface mounting packages.

Tonight I finally got around to mounting one of these 74LVC245A chips on a 20 pin SOIC to DIP adapter board.
Contrary to "best" practice, I clamped the IC in place on the adapter board and successfully soldered it with a standard soldering iron.

Put it to the test with an ex A55 gLCD module and all worked perfectly.
Couple of photos showing the old 74HC245 board and the new 74LVC245A board for comparison. while having to buy the SOIC to DIP adapter has an added cost, it saves me 16 resistors per module so the cost roughly balances out and provides a far simpler schematic and circuit.

So in conclusion,
- where you have just 1 or 2 signals, a couple of resistors can be quick and effective
- where you want up to 8 signals with level switching even with switched/controlled bi-directional capability consider the 74LVC245A
- as I mentioned in a recent post, if you need bidirectional level switching with "automatic" direction change such as for an i2c bus consider using a couple of FET transistors such as the 2N7000. No other components required - just connect as per the philips app note AN97055 .

Trust others might find this information useful.
 

Attachments

Last edited:

moxhamj

New Member
This may or may not be relevant, but the Propeller chip uses 3.3V and the standard interface circuit is a 1k series resistor. This gives a bi-directional link too. Eg 5V to 3V device the 1k limits the current into the cmos part, and I think that current gets fed to the supply rail by internal diodes. 3.3V to 5V works as 3.3V is high enough to register as a logic High.

I have used series 1k resistors today to interface a max232 5V to a 3V3 propeller. It is the standard recommended circuit, and seems too simple in a way.

What I am not sure about is the cmos characteristics of a propeller vs pic chip. But the bi-directional nature of the 1k series resistor is very handy. Unproven though (as yet) with picaxe...

Westy, where did you get the LVC chip?
 

MartinM57

Moderator
3.3V to 5V works as 3.3V is high enough to register as a logic High.
As long as you are not feeding into a Schmitt trigger-based input pin where the logic '1' is 0.8*supply voltage.

It may work, but it's outside the spec, so shouldn't be relied upon when doing a 'proper job'...

EDIT: the i2c inputs (for 20X2, picked at random, just happened to have the Microchip data sheet open) are 0.7* supply voltage, so closer to being OK, but still out of spec..
 
Last edited:

Dippy

Moderator
There are also some specific level shifting isolator chips about for special apps.
Can't remember names, but they have been linked to previously on this forum.

Logic+reading-data-sheet can be a very good option however.

Having said that I've been doing some 3V3 to 3xAA stuff and it worked even though technically out of spec. (Oh yes it was)
So, sometimes just give it a go.

But, as implied above, if you want certainty the you have to do it properly.
 

womai

Senior Member
The more daunting task is usually to shift levels up (3.3V --> 5V). You can use a transistor but that will invert the data. But there are some nifty level translation chips from Analog Device, the ADUM series. They can perform both shifting to higher levels and shifting to lower levels. Since the two sides are galvanically separate, you can also use them when one side should be floating against the other one (i.e. no common ground). They are SOIC package so not too hard to solder. Here is the link to some of them:

Two lines in one direction:
http://www.analog.com/en/interface/digital-isolators/adum1200/products/product.html

great for level-shifting serial links (one line in each direction):
http://www.analog.com/en/interface/digital-isolators/adum1201/products/product.html

4 lines in one direction,
http://www.analog.com/en/interface/digital-isolators/adum1400/products/product.html

Wolfgang
 

womai

Senior Member
My memory is helped by the fact that not too long ago I actually used them in a design where I had one side of a RS-232 connection hooked up to the computer, while the other side (microcontroller etc.) had to be free-floating over several volts relative to it. I like those devices because they are so simple to use. Also put some of them on a SOIC-to-DIP converter board for quick breadboarding of such applications.
 

westaust55

Moderator
I have used series 1k resistors today to interface a max232 5V to a 3V3 propeller. It is the standard recommended circuit, and seems too simple in a way.

What I am not sure about is the cmos characteristics of a propeller vs pic chip. But the bi-directional nature of the 1k series resistor is very handy. Unproven though (as yet) with picaxe...

Westy, where did you get the LVC chip?
Hi Dr_Acula,
The (pseudo local) only source I have located for the 74LVC series of IC’s is www.futurlec.com.au who only have them in the mentioned SMD package format.
The adapter boards came from that venerable bastion of all things cheap – Ebay

I have previously tried using just a series resistor (6.8 kOhm) between the PICAXE at 5V and a 74HC245 at 3.0V. Will not work – each time a PICAXE output went high it drove the entire 74HC245 high including the Vdd pin to 5V.
 

westaust55

Moderator
The more daunting task is usually to shift levels up (3.3V --> 5V). You can use a transistor but that will invert the data.
Wolfgang
Using a FET such as a 2N7000 in a bi-directional line will permit bi-directional comms without inversion if done as per the Philips app note I mentioned above.

Doing just that with my current project.
 

moxhamj

New Member
Ah, futurlec. Yes, I seem to be ordering from them every week or so. Nice find on that chip. I think I might get some and test them out.

3V3 seems to becoming a standard for lots of things - micros, sd cards etc. But there are other things that only come in 5V. This is a great little interface chip.

I'll second your conclusions at the bottom of the first post.
 
Top