How to write an LCD driver

Thread Starter

jozef1990

Joined Aug 6, 2019
8
Hi, I am fairly new to writing an LCD driver for a custom LCD. I just cannot figure out how to get started based on datasheet. A few Questions...

*Why do manufacturers not put any example code (c/c++) on their datasheets, somebody at the IC company must have surely had to test a new LCD driver IC using code so why not include a simple example of how to initialize, send data etc.?

*How can I use the datasheet to work out what commands have to be sent from the PDF attached, any guidance at all would be greatly appreciated. Which pages to concentrate on etc.

Just to clarify, I don't need to know WHAT data to send, I can work that out in time based on the custom LCD I will be using and which pins are assigned to which IC pins etc. but it's HOW to send the data that I struggle with.

Thanks!
 

Attachments

Last edited:

MrChips

Joined Oct 2, 2009
30,810
It is not as easy as you might think.

protocol -> IC -> LCD

The IC manufacturer is responsible for the design and fabrication of the IC. They have no control on the protocol and LCD. There could be a hundred combinations of protocols and LCDs.
 

KeithWalker

Joined Jul 10, 2017
3,095
The code you write will depend on what device you are going to use to communicate with the display driver. If you use a PIC, Arduino or other popular microcontroller, there will probably be libraries available for similar display devices that you can use as a starting point.
 

BobTPH

Joined Jun 5, 2013
8,967
An LCD is driven by driven by supplying alternating voltage to each of the segments you want to be visible, usually with a multiplexing scheme.

There are LCD display modules that have a driver built in and it communicates via a data protocol, which should be documented in the datasheet. Often, cheap knock-offs merely list the controller chip and you need to go to the datasheet for that controller chip to get the communication protocol.

How about a link to the datasheet for the LCD or the display module you are using? At this point we don’t even know which of those two you have.
 

joeyd999

Joined Jun 6, 2011
5,283
The only code they could provide -- if they did -- would be basic chip setup and snippets to turn individual segments on and off.

They have no idea as to what the geometry/layout/features of the LCD you would be driving, and therefore could not provide any higher level code.

Are you using an OTS (off-the-shelf) LCD, or designing your own? Designing your own can be a *great* advantage in terms of code efficiency later on, but it requires tons of detail work and aforethought.
 

Ian0

Joined Aug 7, 2020
9,817
At what level are you driving it? Does it already have some sort of control IC? Or are you driving the segments directly?
 

BobTPH

Joined Jun 5, 2013
8,967
At what level are you driving it? Does it already have some sort of control IC? Or are you driving the segments directly?
I expect he does not know the answer to that. We will know when he posts a datasheet, which should be mandatory for any question like this.
 

Ian0

Joined Aug 7, 2020
9,817
I expect he does not know the answer to that. We will know when he posts a datasheet, which should be mandatory for any question like this
He really ought to! IF it is "custom" then it must have been made to order i.e. to the customer's specification.
 

Thread Starter

jozef1990

Joined Aug 6, 2019
8
An LCD is driven by driven by supplying alternating voltage to each of the segments you want to be visible, usually with a multiplexing scheme.

There are LCD display modules that have a driver built in and it communicates via a data protocol, which should be documented in the datasheet. Often, cheap knock-offs merely list the controller chip and you need to go to the datasheet for that controller chip to get the communication protocol.

How about a link to the datasheet for the LCD or the display module you are using? At this point we don’t even know which of those two you have.
There is a datasheet attached underneath the question and has been there since I posted it!
 
Top