Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to write to a Graphic LCD

Status
Not open for further replies.

AceOfHearts

New Member
Hi everyone,

I know I have already written once on this topic a while back. The few links I was given were not as helpful as I hoped them to be. I have also done searches on the forum.

I have already programmed 2x16 charecter LCDs and other charecter versions comfortably in the past using Assembly and the 8051 MCU. I had the Muhammad Ali Mazidi 8051 book which brilliantly explained everything like how long the delays should be and what pins have to be set etc.

But in the GLCD world I am finding it impossible to find anything that explains what pins need to be set and how the data bits correspond to what pixels etc, basically some very fundamental details eg. what are the CS pins for?. I have tried searching and searching online, but nothing. I need a very basic fundamental tutorial of what to do to write to my 128x62 GLCD, just explenations of what pins to set for how long, in what order, how do the Data bits relate to pixels (ofcourse, precise delays are from the datasheet) and I can then implement it in assembly. I thought there would be plenty of info on this on the web...but quite surprised that there isnt much.

Can anybody help? If it helps to know, I have the LGM12864B which is all wired up and have got the backlight running so far with no idea how to write something to it :) I want to write the codes myself in Assembly.

Many thanks for reading. :)
 
Last edited:
Unfortunately, small graphic LCDs aren't nearly as standardized as character displays until you start getting up into VGA-sized devices. In general, if the LCD datasheet is lacking, you research the controller.

In this case, the LCD uses the S6B0108 (pdf) controller, a Samsung device. The interface is much like the kind you'd see on a your 16x2 LCDs. You have a 8-bit data bus. You've got R/W and RS pins to control the type and direction of data. The CS (chip select) pins control the data too.

The similarities end there, because you have to supply two clock signals whereas the 16x2 text displays use the EN pin for timing. And there are other pins that are used to bias and drive the display itself. That's pretty much all I know about the S6B0108, but if you're looking to build a new LCD project without reinventing the wheel, you can check your microcontroller's open source community and hopefully find someone who's already made a S6B0108 code library.
 
Thanks very much Digitan for that. Sorry it took a while to get back.

Finding info on GLCD programming was a very strenuous process...after piecing together bits of information from different places, I finally managed to control pixels and am now half way through my first GLCD code for my very own image...done half and I can see the image nicely on top half of the screen. A laborious process as Im writing every byte to the GLCD from an 8051 MCU using assembly language.

I have one question though...What does the "Display Start Line" do? Here is what I found on the net:

"The display start line register specifies the line in RAM which corresponds to the top line of the LCD panel, when displaying contents in display data RAM on the LCD panel. It is used for scrolling of the screen"

Ok, that isnt fully making sense to me perhaps because of certain gaps in my knowledge of GLCDs. Does this mean the GLCD RAM is much larger than what the display requires? How does one scroll the screen? Please, any clarification is welcome.

Regards.
 
Last edited:
The start line register holds the line number to start displaying the screen. If you changed it from zero to 16 then the display would shift up 16 pixels. On a 128*64 display you can scroll the two halves independently and so make a scrolling type game.

Mike.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top