You Are Here: Home » AVR ATmega Projects » How To Use a Nokia Color LCD using an AVR

How To Use a Nokia Color LCD using an AVR




Nokia manufactures a wide variety of cell phones and many of their cheaper phones contain simple LCD’s which may be used in microcontroller projects.  There is one particular LCD model that is used in a wide variety of their phones and is often referred to as simply a “Nokia LCD“, or “Nokia 6100 LCD”.  I used to use a Nokia 2600 phone and whenever I upgraded I took the Nokia apart to remove its LCD.  This LCD appears to be the same one that is sold as “Nokia 6100 LCD” and I was able to get it up and running with a bit of work using an AVR.

SparkFun sells them if you do not already have one,
http://www.sparkfun.com/products/569

You will need some sort of breakout board in order to connect the display.  Sparkfun sells several (a standard breakout, an Arduino shield, an Olimex module, etc) as well as the bare surface-mount connector.  Since all of SparkFun’s boards include the LCD, I just bought the connector and made my own breakout board since I already had the LCD.

The connector:
http://www.sparkfun.com/products/570

Nokia Color LCDIf you don’t have a breakout board, you need to first make some sort of connector for the LCD.  My first attempt was to solder thin magnet wire to each leg of the connector with a fine-tip soldering iron.  This took several tries but eventually I got it connected.  I then applied generous amounts of super glue to make sure it wouldn’t come apart and soldered on some thicker wires to connect to the microcontroller.

For cleaner and more practical uses, I eventually made a small breakout board for the connector that can be printed and etched using the laser printer toner transfer method.  Make sure not to put too much pressure on the transfer or the traces can be pressed together.  If this happens, you can try cutting the toner away with a sharp knife, but you’ll probably end up breaking the toner trace and have to start over.

I hand-soldered the connector to the finished PCB and then added some breakaway pin headers so that the board may be breadboarded or socketed into projects while being easily removable.

After you have a breakout board for the LCD connector, you must connect it to your circuit.  There are 10 pins on the connector, one is unused.  The LCD has four control signals (Clock, Data, Reset, Chip Select), two 3.3V inputs, two grounds, and a backlight input.  The LCD driver circuitry runs on 3.3V as do the control signals.  However, the backlight requires a higher voltage around 7V.  Using a 1K ohm resistor between the backlight power and a 12V power supply seems to work well, the voltage is around 6-6.5V which makes it bright enough to use.
Pinout:
1:  Vcc (3.3V)
2:  Reset
3:  Data
4:  Clock
5:  Chip Select
6:  Vcc (3.3V)
7:  Unused (Not Connected)
8:  Ground
9:  Ground (Backlight LED -)
10:  Backlight LED +Since the LCD protocol is 9-bit SPI, you cannot use the hardware SPI interface found on many microcontrollers (including the AVR series microcontrollers) as they often only support 8-bit mode.  This means that you will probably have to implement a software SPI output.  Electrically, this means you can connect the four control lines to any unused I/O pins on your microcontroller.  Your microcontroller must be running at 3.3V to connect the lines directly, otherwise add 10K ohm resistors on each line to limit the current going into the LCD.

Step 3LCD Protocol – Initialization (Phillips PCF8833 Only!)

The LCD has many functions that are available by sending commands over the SPI interface.  The important ones are explained here and will allow you to get your LCD up and running.  A full set of commands is listed in the PCF8833 datasheet here:

http://www.nxp.com/acrobat_download2/datasheets/PCF8833_1.pdf

The 9th bit is the command flag.  If set to 0, the data byte is interpreted as a command.  If 1, the data byte is interpreted as data.  Data may be sent after issuing an appropriate command.

Before you can write to the LCD, it must be initialized.  First, the Reset line must be pulled low for around 100ms and then raised high again.  The Reset line must remain high during operation.  Then, a sequence of commands must be sent, in the following order:

SLEEPOUT (Hex 0x11) – Exits LCD sleep mode

BSTRON (Hex 0x03) – Turns on booster voltage

COLMOD (Hex 0x3A) – Sets pixel format to the following data byte
Data 0x03 – The pixel format 0x03 is 12 bits per pixel

MADCTL (Hex 0x36) – Sets several LCD params – [<Mirror Y>, <Mirror X>, <Vertical Write>, <Bottom to Top>, <BGR/RGB>, -, -, -]
Data 0xC0 – Flips display upside down (my LCD was mounted upside down), uses RGB color format

SETCON (Hex 0x25) – Set Contrast to following data byte
Data 0x40 – This contrast value works fairly well for my LCD, adjust if yours does not display well

DISPON (Hex 0x29) – Turns on display

For more Detail: How To Use a Nokia Color LCD using an AVR

Leave a Comment

You must be logged in to post a comment.

Read previous post:
How to Read Many Switches with One MCU Pin

Have you ever been chugging away at a project(s) and the project keeps growing and growing, while you add more...

Close
Scroll to top