How to interface LCD to microcontroller?

joeyd999

Joined Jun 6, 2011
5,237
This is a single backplane LCD. There are three ways to drive it:

1) Manually drive each segment via an I/O on your CPU. Need 1 pin for each segment and 1 pin for the backplane. You will need to write code to drive the pins/backplane with AC (squarewave).

2) Use a CPU with a built-in LCD driver. Still need 1 pin for each segment + backplane.

3) Use a separate discrete LCD driver attached to your CPU. Need fewer pins on CPU, but driver needs all pins for segment/backplane.

FYI, you may want to consider a multiplexed LCD. Fewer pins to drive, and many CPUs (for instance, PICs) can drive up to four backplanes.
 

Thread Starter

CVMichael

Joined Aug 3, 2007
419
Thanks for your response.

For #1

But how do I connect the PIC to the LCD, do I connect pin directly? or do I use a resistor? (if yes, what value)

Is the common wire "COM", common negative, or common positive?

I have PICs that are 5V, and also 3.3V, do both pics work? i.e. what voltage does the LCD need?
 

spinnaker

Joined Oct 29, 2009
7,830
If I were you I would consider looking for another display. The datasheet on the digikey site is worthless, the link inside the datasheet does not work and the part number can't be found on the manufacturers site.

Exactly what do you want to do with the display? Graphics or just characters?
 

joeyd999

Joined Jun 6, 2011
5,237
If I were you I would consider looking for another display. The datasheet on the digikey site is worthless, the link inside the datasheet does not work and the part number can't be found on the manufacturers site.

Exactly what do you want to do with the display? Graphics or just characters?
Why do you say the datasheet is worthless? It is perfectly clear to me. Obviously, he wants a numeric display, not graphics or characters.

The only thing that isn't clear is the driving voltage, which I assume is 5V since that is the most common for this type of display. Even if it's a 3V display, 5V ain't gonna hurt it.
 

spinnaker

Joined Oct 29, 2009
7,830
Why do you say the datasheet is worthless? It is perfectly clear to me. Obviously, he wants a numeric display, not graphics or characters.

The only thing that isn't clear is the driving voltage, which I assume is 5V since that is the most common for this type of display. Even if it's a 3V display, 5V ain't gonna hurt it.
I don't know which datasheet you are looking at but all I see is one for environmental specs and one showing a mechanical drawing.
 

joeyd999

Joined Jun 6, 2011
5,237
Thanks for your response.

For #1

But how do I connect the PIC to the LCD, do I connect pin directly? or do I use a resistor? (if yes, what value)

Is the common wire "COM", common negative, or common positive?

I have PICs that are 5V, and also 3.3V, do both pics work? i.e. what voltage does the LCD need?
No, you don't need resistors. LCD are voltage driven parts, not current. Each segment just looks like a really sloppy capacitor. You can tie the CPU pins directly to each segment/backplane.

One thing to remember is that you must supply a square wave to the back plane and each segment. Segments that are 'off' should be in phase with the backplane. Segments that are 'on' are 180 degrees out-of-phase. You will need 50% duty cycle on your square waves to ensure no DC component, as that will destroy the segments over time.

This all *can* be done manually through programming, but most times, a dedicated driver (or on-chip LCD peripheral) is used.

5V should work fine.

EDIT: BTW, your square wave frequency should be on the order of 60Hz or so.
 
Last edited:

Thread Starter

CVMichael

Joined Aug 3, 2007
419
So your saying that I have to supply a 50% duty PWM to the pins? What is the normal frequency? Can I do that only on the COM (common) pin ?
 

joeyd999

Joined Jun 6, 2011
5,237
So your saying that I have to supply a 50% duty PWM to the pins? What is the normal frequency? Can I do that only on the COM (common) pin ?
NO! Not PWM. Just a square wave. Think toggling pins 60 times per second. One pin is the master, connected to the backplane. Then, one pin for each segment. For each segment line, it should toggle in phase with the backplane if the segment is 'off', and toggle 180 degrees out-of-phase (opposite polarity) if the segment is on.

Don't think PWM....it won't work!

*EACH* pin must toggle. Any DC component will destroy the LCD.
 

Thread Starter

CVMichael

Joined Aug 3, 2007
419
Thank you for all the info, I think I'll be fine... I will get the display tomorrow, and I will play with it in the next few days...
 

joeyd999

Joined Jun 6, 2011
5,237
Either PIC18F9722 or PIC18F87K90 (both 80 pin), or something close to that, I have a lot of PICs :D
The 87K90 has a built in LCD driver for up to 48 segments. This will be *much* easier than trying to manually implement your own driver!

Don't know about the 9722...

Edit: Actually, I cannot find a pic18f9722 on microchips website...did you get the number wrong?
 

Thread Starter

CVMichael

Joined Aug 3, 2007
419
Just want to let you know that I got it work with the PIC18F8722.

If anyone wants pics/schematic/source code (in mikroC), let me know.

Thanks again for your help.
 
Top