graphics driver question
Erik Friesen
Posts: 1,071
I would like to use the graphics driver for my 128x64 lcd driver.· I have a 1024 main memory byte array that the lcd updates from.· The bytes are layed out horizontally, 16 bytes per row, by 64 rows high.· The graphics driver updates a 16 x 16 tile if I understand it correctly.· How are the longs or bytes written to in a 16 x 16 tile?·
Comments
I'm just recalling this from memory and I haven't looked closely at the graphics driver in a while. Someone hit me over the head if I'm wrong.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I suggest picking up the Hydra book. It covers this topic in a good detail with diagrams which are more helpful in this case than words. I have attached the graphics.spin object to a couple of different LCD screens. One was a monochrome screen and the other was a uOLED-96-PROP screen. Once you get the core concept of graphics.spin down it is easy to do.
Let see if I can do this right in words:
-Graphics.spin is tile based
-each tile is 16 pixels by 16 pixels
-in memory, each tile is one long wide by 16 longs tall (maybe not the best description words)
-the tiles are column major, meaning the upper left tile is first in memory, than the tile below it, then the tile below, when you get to the bottom you wrap around to the top of the next colum
-As previously said, each tile is 16 pixels by 16 pixels so therefore each long (32 bits) is 16 pixels meaning there are two bits for a pixel. This ends up being four colors unless you do something like the tv.spin does with a table (again I reference the Hydra book to learn more) to get more color.
You will need to reserve the space for two screens. Your LCD driver code will look at the "on screen" buffer and graphic.spin will look at the "off screen" buffer. When the "off screen" buffer is written, it is copied to the "on screen". Your LCD code will have to work its way through the "on screen" buffer depending on how the data needs to be sent to your LCD being used.
This should be a good start.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter
www.brilldea.com·- check out the uOLED-IOC, an I/O expansion for the uOLED-96-PROP
www.tdswieter.com
One little spark of imagination is all it takes for an idea to explode
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
In my case I was using the VGA driver which needs the bitmap layout as-is.· Therefore I didn't develop anything that would get you any closer to a solution for your display.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Ken Peterson) : 4/23/2008 9:11:22 PM GMT
The monochrome driver that I refered to was for a product for my company that I am unable to release the code to at this time. Maybe in the future I can release it, I am reviewing the options because the product is not completed yet. In my monochrome application I left graphics driver all alone and didn't modify it. I then wrote a driver to read the "on screen" buffer and send the data to the LCD. It was a while ago when I wrote the driver, but I think my LCD wanted data clocked out by row. So the driver started in the upper left corner (the first long of the video memory) and then clocked out the first 16 pixels and then jumped to the tile of the next top column and clocked out 16 pixels. A mask was used to pull the correct pixels out of the memory. Data was sent to the LCD in bytes, so I actually had to gather a few pixels before I sent a byte to the LCD.
I hope this helps some. Do you have a datasheet or further information about your display?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter
www.brilldea.com·- check out the uOLED-IOC, an I/O expansion for the uOLED-96-PROP
www.tdswieter.com
One little spark of imagination is all it takes for an idea to explode
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter
www.brilldea.com·- check out the uOLED-IOC, an I/O expansion for the uOLED-96-PROP
www.tdswieter.com
One little spark of imagination is all it takes for an idea to explode