# Driving custom LCD glass with a PIC

Status
Not open for further replies.

#### ACharnley

##### Member
Having not done this before I wanted to ensure I was thinking along the right lines.

Assuming I have an LCD with 30-40 pins driving segments or graphics I would need to make a custom LCD controller using several banks of AND/OR gates. Is that the right way to do it?

My display would be similar in complexity to a bicycle computer and I can't see them having 30-40 pins though maybe I'm wrong. Is it normal to specify the logic gates and drop a COB on the back of the LCD?

#### Nigel Goodwin

##### Super Moderator
I seem to recall that MicroChip make a number of PIC's with suitable drivers built-in - you might like to check there first?.

#### ACharnley

##### Member
Aren't these for driving segment LCD's such as the 2 x 16's and similar?

Edit: yes they are.

This answered the question but raises another:

http://www.embedded.com/design/real...-LCDs-Getting-more-for-less-with-your-display

One method is multiple common nodes which allows for the OR/AND logic to remain in code.

My next question is whether PIC's support multiple COM on IO pins. I'm guessing not, but I could use IO pins to drive transistors that ground the returning LCD current to do the same?

Last edited:

##### Well-Known Member
As Nigel posted many of the PIC24/dsPIC have LCD segment drivers available , some over 80 , this is not ...
these for driving segment LCD's such as the 2 x 16's and similar?
but the "raw" LCD glass...
" The Liquid Crystal Display (LCD) driver module generates the timing control to drive a Static or Multiplexed LCD panel and meets low power design requirements including driving the LCD display in sleep mode as well as software contrast control for boosting or dimming."

#### ACharnley

##### Member
Not for custom glass though? "38 segment x 8 common LCD display"

Although there's nothing to say I couldn't have custom LCD glass made and send custom made characters to it. That might work!

#### ACharnley

##### Member
OK, so physically how? Assume I have a custom LCD glass with 40 "segments" (or pictures etc), then there has to be an interfacing chip to connect to them. I'm glad I asked!

#### ACharnley

##### Member
OK, so getting down to it there'll be 6 x 7 digit segments, 4 icons, so multiplexed I make it 7 outputs, 7 commons or 14 pins.

As I've just learned LCD's need a specific duty cycle to prevent burn out and this is where it'll get tricky. I'm quite the novice when it comes to PIC's but assume the duty cycle must be persistent, i.e not effected by other operations (which the pic will be doing).

Last edited:

#### ACharnley

##### Member
Thanks be80be, that's exactly what I needed.

So for sure I need a PIC with integrated LCD driver that'll handle the multiplexing duty cycle. I'll begin looking for the appropriate chip. I take it the built in LCD driver works in async, that I won't have to worry about other operations affecting the duty cycle?

#### ACharnley

##### Member
Controlling the LCD is the last part of my puzzle. As I need USB OTG I can't use one of the Microchip's with the LCD controller unless I move to a PIC24 which is far too overkill for the application. I found an aging chip called LC7581X (X being a number representing duty cycle) which looks like it'll fit the bill, but documentation is weak. Am I on the right lines? The alternative is to use 2x PIC18's for the USB OTG & LCD Controller functionality. I've only minimal PIC experience and don't fancy the move to atTiny if I can help it though that might open up options.

Regards, Andrew

#### Nigel Goodwin

##### Super Moderator
Controlling the LCD is the last part of my puzzle. As I need USB OTG I can't use one of the Microchip's with the LCD controller unless I move to a PIC24 which is far too overkill for the application. I found an aging chip called LC7581X (X being a number representing duty cycle) which looks like it'll fit the bill, but documentation is weak. Am I on the right lines? The alternative is to use 2x PIC18's for the USB OTG & LCD Controller functionality. I've only minimal PIC experience and don't fancy the move to atTiny if I can help it though that might open up options.
Why would you consider moving to a PIC24 'overkill' but consider using two 18F chips? - that sounds more like 'over kill to me'

The PIC24 are nice chips, with lot's of capabilities and loads of memory - and pretty cheap too.

#### ACharnley

##### Member
Undoubtedly, but I need very little of the power or complexity. I'd also prefer a 5.5v capable device as it makes it easier to drive my FET's and the LCD if it's a 5v type.

My LCD will have 21 segments which begs the question whether to ditch multiplexing. Doing so, I could drive the segments using a larger PIC18 device (i.e PIC18F45K50). I'd have to write my own code to phase the voltage but I can't see a way to vary it for contrast control (other than every pin being a DAC).

For reference I need;

ADCx3, GPO x 4, DACx1, Serial, USB

And for the LCD if I can find a multiplexing chip then an extra serial or i2c whichever said chip uses.

#### ACharnley

##### Member
I made a mistake with the OTG requirement, thus I'm looking at a PIC24FJ64GC006 to do USB & LCD.

I found a LCD multiplexing solution in the PCF8551. I only need to identify the USB client deviceid/vendorid so I still believe the PIC24 is hugely overkill for what I need.

#### be80be

##### Well-Known Member
$4000.00 to start then you keep on paying lol for a deviceid/vendor id of your own Microchip did let you use theirs for free to test with. Getting a Vendor ID If you are a new USB product developer looking to get a vendor ID for your company, there are two preferred options for doing this: 1) Become a member of the USB-IF. Among the many benefits of being a member is the assignment of a vendor ID to your company (if one has not been previously assigned). The annual membership fee is US$4,000. Download the membership application.

2) Become a USB-IF non-member logo licensee. Logo licensees are eligible to use the USB logo in conjunction with products that pass USB-IF compliance testing. In addition, you must also purchase a vendor ID if one has not been previously assigned to your company. The licensing fee is US$3,500 for a two year term (this fee is waived for USB-IF members). Click on the link to download the Logo Trademark License Agreement and Logo Usage Guidelines and vendor ID form in order to become a logo licensee. If your company does not already have a Vendor ID number, your company must execute and return the Vendor ID form along with your USB-IF Trademark License Agreement. The Vendor ID is US$5,000. Please keep in mind that becoming a USB-IF Logo Licensee alone does not entitle your company to USB-IF membership benefits.

If you would like to purchase a vendor ID without signing the logo license agreement, the fee for this purchase is US\$5,000. If you do not execute the logo license agreement, you are not authorized to use the USB logo in conjunction with your products regardless of their testing status.

Last edited:

#### ACharnley

##### Member
I only need to read the deviceid/vendorid of the attached device and then short the Data +/- lines (it's a 1.2 power output).

##### Well-Known Member
PIC24 's with LCD segment drive have 5v tolerant pins so the 5v LCD (?) could be done with a 3.3 device with careful design .... The LCD module can be configured in one of three Bias types:
• Static Bias (Two Voltage Levels: VSS and VDD)
• 1/2 Bias (Three Voltage Levels: VSS, 1/2 VDD and VDD)
• 1/3 Bias (Four Voltage Levels: VSS, 1/3 VDD, 2/3 VDD and VDD)
LCD Bias voltages can be generated with an internal resistor ladder, internal Bias generator or