Maker Pro
Maker Pro

3v to 5v level translation

S

Scott Miller

Jan 1, 1970
0
I'm connecting a 5-volt HD44780 LCD controller to a 3-volt microcontroller.
I'd planned to use a level translator IC, but I just switched to an MCU with
5-volt tolerant inputs. Actually, I don't need inputs - just 6 outputs. My
question is this - assuming the slew rate is acceptable, is there any reason
I can't just connect each I/O line to a pullup to 5 volts, set the port to
all 0's, and then use the data direction register to switch between
high-impedance input mode and output to control the 5-volt signals?

Seems to me like it should be fine, but I can't recall having seen it done
that way before.

Thanks,

Scott
 
R

R.Lewis

Jan 1, 1970
0
Scott Miller said:
I'm connecting a 5-volt HD44780 LCD controller to a 3-volt microcontroller.
I'd planned to use a level translator IC, but I just switched to an MCU with
5-volt tolerant inputs. Actually, I don't need inputs - just 6 outputs. My
question is this - assuming the slew rate is acceptable, is there any reason
I can't just connect each I/O line to a pullup to 5 volts, set the port to
all 0's, and then use the data direction register to switch between
high-impedance input mode and output to control the 5-volt signals?

Seems to me like it should be fine, but I can't recall having seen it done
that way before.

Thanks,

Scott
There are 'reversed' diodes on each I/O pin to the internal Vdd and Vss of
the uP.
When the I/O is high impedance current will flow through the pull-up
resistor and through one of these diodes to Vdd (which would otherwise be at
3 volts.)
Hence the uP has now has a forced Vdd of 5 less the v drop across the
resistor and diode - which will be very small as the uP current is small.
Whether or not this matters is dependant upon the which uP you are using.
Ensuring a load, or even better a clamp, on the supply to the uP that can
sink this current without causing the volts to rise too much will solve the
problem (with a decent cap)
However the pull-up will now only rise to 3 volts when the I/O is high
impedance.
If this does not matter why not just connect the uP as it is.
If this does matter - that's why it ain't done!
 
S

Scott Miller

Jan 1, 1970
0
What you're saying makes sense - I've done weird things with these
protection diodes on other MCUs - but if that's the case, how is it supposed
to work with 5-volt inputs? The specs for the chip (AT91SAM7S64) say Vih
can be up to 5.5 volts. It does say not to drive the inputs over VddIO
while the internal pullup is enabled, which makes sense. But wouldn't there
have to be some provision in the design for dealing with 5-volt inputs
without raising Vdd?

I also see now that it's got an open-drain output mode, which is pretty
cool, and should simplify things a bit.

Thanks,

Scott
 
J

Joe.G

Jan 1, 1970
0
Some HD44780 Coppies Can run at 3V but the V0 LCD cross the LCD glass needs
to be 5V.

So the copy IC can direcly interface to your 3V MCU.

JG
 
J

Jeff Stout

Jan 1, 1970
0
Look at the Voh of your mpu. It should be something like 2.4V, or 2.6V, or
2.8V output with a
Vdd of 3V. Now look at the Vih on the HD44780 mpu. It should be something
like 2.0V If it
is, you should not have a problem driving a "1" into the LCD display.

Do the same exercise with Vol of the mpu, and Vil of the LCD display. If
Vol is less
than Vil, then you should have have a problem driving a "0" into the the
dispaly.

If you detect a problem, go to the TI web site, and find a logic family
which will do what
your want, maybe 74HCT.

Jeff Stout
 
Top