Menus On GLCD's

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have never used a GLCD before and my projects are getting complex enough that a simple character LCD and my old method of programming will no longer work for my wants.

I was checking out AVGA and tvText but as they output to a TV and require vertical sync I cant exactly walk through the code with my dragon to understand how they are handling things.

I have a 128x64 GLCD with a S6B0108 controller and am looking for some example code to how to display to this lcd. After the basics are down I would like to understand how to handle 'viewports' as tvText calls them so I can update a specific part of the screen only (such as menu buttons so you can save space)

Currently I use the 'double buffering' method on ly character LCD but its way overkill. This is what I do:

I set up TWO arrays of Buff1[2][20] and buff2[2][20] and then I output the text to the array and some pointers to some changing data locations. I then have a screen_redraw flag that on updated data I re-draw the entire display. I use the second buffer to make the next screen sequence so the first buffer can continue to run its own contents and then I swap the memory locations of the two buffers and the new screen is updating.

So in short I need help on how to handle lcd's and graphics but beyond the very simple heres a box, now lets draw a circle tutorials. Any ideas?

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not that I've had experience with your particular display, but most of them have their own display ram, so if you want to double buffer, you only need one ram buffer in the micro as the display has the other. Have you found any code to talk to the display yet.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

screens ks0108 compatible so writing to it is fairly simple. I'm more looking for some examples or a project I can walk through and understand how to 'handle' the entire screens contents. Say you have a screen with menu buttons on the bottom and some data in a window. If I press a button the button layout changes but the data window does not. Right now the only way I know how to use an LCD is to single shot write the entire screen from ram but either way I still don't know how to manage a window in ram properly.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

make some button pictures in paint and transfer them to your micro and put them on the lcd in a matris that is what i did in bascom avr with a lcd whit a touch screen.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Something to think about... the ks0108 controller thinks the lcd is 8 horizontal stripes of 64 pix wide and 8 pix hi. So you 'set an x address' then write 0x01 0x02 0x04 0x08 0x10 youd get a '/' more or less. This is sort of '90 egrees out of phase' with a pc screen that has the 0,0 pixel at the top left and goes to the right along the top row. 128x64 is 8k pix, 1k bytes. I set aside a 1k ram buffer, wrote a bunch of line and box and char draw routines that drew into the ram buf AS IF IT WAS A PC BUF, then I wrote one updatelcd subroutine that picked up pixels from ram and wrote them to the ks0108 the way it liked. I think this is faster, because all graohics draws are to avr ram, and you can updatelcd faster than the lcd can respond (15ms or so... 66hz)

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bobgardner wrote:
I set aside a 1k ram buffer

That is similar to what I am doing, I found it was much faster to update the entire LCD on change from a matrix than to handle each piece of information on the screen and then update.

I also found this handy as I have a few different controllers and all I had to do was re-write the basic char output routine for the new LCD and my application code stays the same.

What I am trying to learn is the actual act of coding a 'viewport' so I can dynamically update only the part of the screen I have changed. I see in a few online examples that they simply assign a name to the rectangle coordinates and when they want to update the write a white rectangle over the previous content and then write the new content. Like 0:45s into this vid http://www.youtube.com/watch?v=-MEJoeqzfQ0