View Full Version : Custom LCD Driver

Chad George
02-14-2007, 09:26 AM
I'm trying to write an LCD driver for a small graphical (128 x 64) LCD. I have all of the interface
stuff worked out, but I'm having alot of problems using graphics.spin. I've looked in the demo files
and can't seem to figure out the data format that graphics.spin packs its bitmap into. I thought I read that
it uses 16 + 1 longs for each 16 x 16 pixel tile, but I tried various ways to access this data with no

Basically, I need a formula for getting the color value at pixel (not tile) location x,y using only the
base_address given to the graphics driver.

Also if anyone has some good ideas on how to change the font (and possible tile size) to 8x8 that would
work alot better for this small of a screen.


Post Edited (Chad George) : 2/14/2007 7:57:31 PM GMT

Chad George
02-15-2007, 02:58 AM
Does anybody have any ideas on this topic?

02-15-2007, 03:23 AM
If you look at vga.spin or tv.spin, there is explanation about how pixel data is mapped. It's not that complicated, at all. Pixels are stored in 16x16 groups which use 16-long segments.·The first long's lowest bit·pair·defines the color code for the upper left-most pixel within the 16x16 pixel array. There is an associated 4-color definition for each array, or cell, defined by a separate word-based cell map, which you could probably bypass for your LCD purposes.

What might work best·is to make a static image that·you can display on a tv or vga monitor. Then, map it to your LCD and see what's wrong. You will at first see that·pixels are transpositioned, but the pattern will clue you into what needs to change.


Chip Gracey
Parallax, Inc.