320(rgb)x240 lcd
DaveC3
Posts: 8
I am new to the Propeller, however I have been programming PIC micros for many years. I acquired a couple of 320(RGB)X240 displays for a buck a peace. They do not have a controller chip. So far I have been able to modify R. A. Paz Schmidt's LCD.spin (thanks for the kick start) to display color bars. Now I am stuck. I want to be able to display text and graphics on this display. I have ordered the Hydra book (maybe this will point the way).
Here are the signals that I need to control
Any help would be appreciated
Thanks
Dave
Here are the signals that I need to control
Frame = High during the first scan line Load = a pulse after each scan line CP = clock pulse DISP = turn on display high signal VEE = turn on lcd drive voltage ~27v high signal Data = one byte [noparse][[/noparse]code] KCS057QV1AD RGB Display connected to 74LCX245 (as buffer 3.3v to 5v logic): PIXEL 1 2 3 4 5 6 7 8 ............. 320 D0..D7 PA0..7 Data RGBRGBRG BRGBRGBR GBRGBRGB ............ bit 76543210 ' dec val 146 73 36 'Red %10010010_01001001_00100100 ' 73 36 146 'Green %01001001 00100100 10010010 ' 36 146 73 'Blue %00100100 10010010 01001001 ' 182 219 109
Any help would be appreciated
Thanks
Dave
Comments
Displaying text and graphics on the Propeller is divided into two parts: drawing and displaying. For the drawing part, you'll probably use the Graphics object. It has methods for drawing lines, text, etc. It does its work on a bitmap. To actually display the bitmap, you'll use a TV object if you're hooked up to a TV, a VGA object if you're connected to a VGA monitor, or in your case, well, you're out of luck.
The Propeller doesn't have built-in support for 24-bit pixels, so you've got your work cut out for you. Maybe you could use the VGA driver to start with. It outputs 6 bits per pixel, 2 each for R, G, B. Connect them to the most-significant bits of your LCD's RGB inputs. You still have to figure out the sync signals.
Eventually you'll have to get into assembly language and devote a cog (or two?) to pumping out pixels.
Probably from SparkFun. They sell a Color QVGA 2.3" 320x240 for $1USD. Sku is LCD-08843.
Cheers,
Alex
As I said I am real new to the propeller. I will do some more reading on the video and VGA drivers to see if I can modify something.
Each pixel has three bits (RGB) but the data bus is eight bits wide so I have to figure out how to get 2 & 2/3 pixels per byte.
Thanks for the reply's
Dave
What I think you have is a Color STN display. or I'm wrong ?. This displays make up the colors using frame dithering, That means that to get shades of a color use set a pixel in one frame and do not set in subsequent frames. Very complicated. Why they do not have 6 or 9 data pins is everybody's guess.
The easiest way to drive it would be to use full colors, just one shade of any color. And build a table depending which pixel you are driving because after some pixels you start over with the combination:
1st byte : RGB RGB RG
2nd byte : B RGB RGB R
3rd byte : GB RGB RGB
4th byte : RGB RGB RG
...
As you see after 3 bytes the scheme repeats. So you have 2 solutions, either you have a 27kbytes buffer in memory and use 1 shade of each color (8 colors) and have the bitmap in memory with exactly this structure (easy to drive the display because you only send the data as they are in memory.
2nd: You reorder the data from memory before you send it to the display. Well... There is not enough memory to use say 4 bits per pixel because that would mean more than 32k for he buffer.
Well try the first approach .
How to draw something ?, well each pixel occupies 3 bits so you have to calculate in bits and then get the byte and bit index out of the x and y coordinates. Not utterly complicated.
If it is a TFT display... the driving will be different, but with your : it has 8 bits and 1 per color sounds like a CSTN.
Have fun and if you have more questions, here we are.
Ale
Thanks for the reply. I have been able to make full screen one color, different color bars and and split screen with different colors. I used the method you suggested by making 3 bytes in a specific color pattern. That gives eight pixels for three bytes of data.
I will try your suggestion #1
And thanks again for posting lcd.spin it was a great help getting started.
Dave
Here is a picture of the display and the various supporting boards. To the far right you can see the Propeller USB board, just to the left of that is a 3,3v to 5v adapter. I used two 74LCX245's. Jut to the lft of that is a small board that has the 5v to 27v biasa supply and supplies 5v to the display as well as all the LCD connections. As you can see I can ge te display to produce color bars. In this case red, green, blue.
Here is the code.
There is a bunch of stuff that is not needed, just been to lazy to take it out.
Thanks
Dave
Wowsers, that 320x240 LCD is bigger than I thought; formerly I thought you were talking about a Nokia cell phone LCD.
Good eye, yes it is most likely the same supply. I bought two or three from Tanner electronics in Dallas. I do not remember what I paid for them but not more than $10 more likely in the $5 range(I am cheap). I use the one in the picture for my bench supply.
I picked up this display in Austin. They were a real bargain, $1.00 each. They did not have any data on them so I did a search and gave them the data sheet, they gave me another for free. Up to now I have not thought it possible to run the display (in a useful manner). I normally build my projects around PIC Micros. It would be very hard to do it with a PIC and using a non-asm programing language. I thought the Propeller looked like it could handle the job so I sent for one a couple of weeks ago. Now I have to learn another language
Take care
Dave