11 years, 3 months ago.

LCD Headers

Hello, I am using an mbed with a Powertip PC0802A LDC display, which is 8x2. I haven't found a .h file which seems to support 8x2 displays, but do I really need them? I had intended to simply control the LCD display from the pins of the mbed.

1 Answer

11 years, 3 months ago.

you might have to do some customising of the library.

The thing that will certainly change is the address of the start of each row: with 8 columns, it's only (eg) eight addresses away from the previous row's starting position, instead of 16.

see line 155 onwards of

http://mbed.org/users/simon/code/TextLCD/file/44f34c09bd37/TextLCD.cpp

that's easily fixed (create a new 8x2 LCD type, and set the addresses given for each row start as given in the driver data sheet).

But, you will also have to get a datasheet for the Hitachi HD44780, and compare the commands and registers with the driver chip in your LCD. And the initialisation sequence!

If they are wildly different, you will have to make the necessary changes, line by line.

They are differences between LCDs, but the most common type of 8x2 modules should work when you select the 16x2 display type in the library. First row startaddress is 0x00 and second row startaddress is 0x40 for both types. Startaddresses for lines 3 and 4 will depend on the #chars per line, but you should be OK for a 2 line display. Obviously, a tailored 8x2 version of the lib would be nicer and also return the correct number of columns.

posted by Wim Huiskamp 23 Jan 2013