SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By ploedoff
#14056
Hi all,

Will i fry my nokia lcd if i use 5v levels on the I/O pins?

I'm trying to hook up the sparkfun color lcd to a sparkfun mega128 board. the problem is, one is a 5v part, the other a 3.3 v part. I'm trying to use Jimbo's avr code, but he doesn't say anything about the actual connections.

Does anybody know whether the display is 5v-tolerant on the data lines?
I tried to connect them via 10k Resistors (as stated in the bascom example), but
Code: Select all
  __  __  __
  | | | | | |
__| |_| |_| |

on the avr side of the resistors
looks like
Code: Select all
    ,
   / \    /\  /\
__/   '--'  '-'  '

on the display side.
So, the lcd, of course, stays blue all the time.
But since i don't want to destroy the lcd, i don't want to just hook it up directly and hope it survives...

so, does anybody KNOW, or has already tried that?

Thanks, Nico

PS: if i had a 3.3V µC, i'd be using it....
By JamesC
#14071
Based on the datasheet, the answer is no, it is NOT 5v tolerant, and you will likely fry it you try.

Assuming you've already got a voltage regulator to supply the 3.3v power that the LCD needs, and it shares the ground with your 5v supply, you can create a voltage translation circuit very easily using some signal diodes and pull up resistors.
Code: Select all

                     Pull-up  
                     to 3.3v  
                      (10k)        
     3.3v supply  ---/\/\/\--+
                             |
                             |               
                             |     Diode         
     3.3v Input pin   -------|------>|------------- 5v CPU pin



Hope that ascii art makes sense. The idea is that when the CPU pin is high, the diode is reverse-biased and blocks current flow, and the resistor pulls the 3.3v line high. When the CPU pin is low, the diode is foward-biased and current flows from 3.3v side to ground (at the CPU). A key point here is that the 3.3v and 5v circuits MUST share a common ground.

A more robust variation is documented here...
http://delphys.net/d.holmes/hardware/levelshift.html

...which uses pullups on both sides and a mosfet in place of the diode to allow bi-directional I/O. For the LCD, you only need to communicate from the CPU to the LCD, so a signal diode should be sufficient. Don't use a power diode, they don't switch fast enough. I haven't used this technique on the LCD display, but the circuit I describe and the one described at the URL worked for interfacing to a pair of 3.3v uMIRFs. (diodes for uni-directional lines, mosfets for bi-directional lines)

I highly recommend bread-boarding it first and making sure it looks like it will work before hooking it up to your display, as I just woke up and may be confused. :?

One final note: You may get signal degradation problems with this technique as well, for the same reasons. Decreasing the value of the pull-up (a little!) may help, but make sure it is a large enough value that you dont draw too much current and fry the display. The web site above has o-scope capture of the mosfet circuit.
By ploedoff
#14095
Thank you,

I tried the voltage resistors (don't have diodes at hand, though it might be the more elegant solution) , 100 and 220 Ohm, gives me nice clean 3 voltish signals, and i can actually see a circle when i look at a special angle.

but the contrast or brightness / color temperature changes about every second. is that the flicker everybody complains about? i thought it would be a lot quicker... i added the 100uF cap, and from what my scope shows, it's a pretty stable 3.3v.

when the display is uninitialized, it shows no flicker whatsoever, just a plain blue color. but when i initialise it, draw some stuff on it, and then STOP sending any commands/data, it still flickers... Any ideas? might there be some lcd controller settings i missed?

Bye, Nico
By ploedoff
#14168
Hello,

if somebody is interested, I got everything to work, ported Jimbo's Nokia LCD Example Code to avr-gcc and ATMega128 (pgm_read_byte!), stripped basically everything out except the 6x8 font, and will soon put it in the bootloader section together with the butterfly bootloader! Wouldn't that be cool ;)

The voltage dividers did the trick with the signal levels.
But although I used a seperate 3.3v regulator for the backlight booster, the electronic volume/brightness/contrast changes sometimes (a "flicker" with a period measured in minutes, if not hours :) ), so i added two pushbuttons to brighten/dim the display..
Sometime in the future, I will pust the graphic lcd bootloader..
Bye, nico
By Grimm Spector
#15702
I'd really love to see that bootloader, see if maybe it could be useful in an upcoming project I'm working on.