Plotting full color pixels? (1-255 color)
Microcontrolled
Posts: 2,461
I am wondering if thier is a way to display or use the plot_pixal function that could use full color or almost full color. I have seen bitmap images displayed on a screen in full color or at least close so I am wondering how you would do this for a simple plot pixel program like that in the Parallax Graphics driver. I am not experienced in working any kind of TV driver, so I need some help here. Thanks in advance.
Micro
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Computers are microcontrolled.
Robots are microcontrolled.
I am microcontrolled.
SX Spinning light display·
Post Edited (microcontrolled) : 1/4/2010 9:08:52 PM GMT
Micro
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Computers are microcontrolled.
Robots are microcontrolled.
I am microcontrolled.
SX Spinning light display·
Post Edited (microcontrolled) : 1/4/2010 9:08:52 PM GMT
Comments
if you need more help, let me know.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
For VGA, on a standard propeller board, the maximum you could do would be about 160x120 (using 640x480 timing), with 64 colors per pixel.
To do better, you need to slow-scan to Ray's LCD, or get a Morpheus where I designed a fast memory interface and changed the VGA output circuit for 256 colors.
Currently Morpheus can do 256x192 at 256 colors per pixel with 51Hz XGA timing, but I will be writing a 320x240 pixel driver (256 colors per pixel, with VGA timing) soon.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheusdual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Computers are microcontrolled.
Robots are microcontrolled.
I am microcontrolled.
SX Spinning light display·
·
I read on another thread that you are working on vga graphics.
Can you expand on that more?
Fundamentally, if you have 640x480 pixels at 3 bytes per pixel for full color, that is 640x480x3=921k, just a bit over the 32k of the propeller chip.
So I presume solutions become compromises. Reduce the bytes per pixel. Reduce the colors. Look up colours in a lookup table. Make the visible area smaller. etc
But the one that intrigues me is your comment about a fast memory interface. How fast does it need to be to run vga? If you can get a pixel out of external ram in, say, 10 PASM instructions, is that fast enough? Do you need one cog running the VGA or two?
Given the lower resolution of TV, even a small vga picture in the middle of the screen would still be very useful, eg 160x120. Is this possible (external or internal ram) or is it way out of the ballpark?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Rough memory bandwidth calculation for bitmapped graphics:
(x_rez * y_rez * bits_per_pixel)/8 = bytes required for frame buffer
* 60 = required read bandwidth for 60Hz refresh
* 2 = to allow for a fair bit of repainting per field
So, for your example:
(640 x 480 x 24) / 8 = 921600 bytes to hold the frame buffer
* 60 = 55.3MB/sec just to refresh the screen
* 2 = 110MB/sec if you want to update it at a decent speed.
Even Morpheus can't do that.
I can do 4 colors per pixel at up to 1024x768, and 256 colors at 256x192 - newer drivers should allow me to go as high as 400x300 with 256 colors per pixel (800x600 timing).
Don't be too surprised if I announce some additional interesting products in 2010... I am going to UPEW again [noparse]:)[/noparse]
Mike Huselton is currently porting ZiCog to Morpheus - I can't wait to try it!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheusdual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
Going back to the original question, lets say you have a completely blank screen and you want to plot one red pixel in the middle. Well, you could have an array with a list of all the pixels and their x and y coordinates. The vga (or TV) driver ouputs Low and counts through the lines and then the columns until x and y match the coords of that pixel. If they match, it is displayed. Then it moves to the next pixel in the list, which might be at the bottom of the screen.
Given the R/2R network of the vga driver only gives you 2 bits per color gun the maximum color resolution with the standard resistors is 6 bits. 3 bits (is that right?) for TV. So - first question Bill, how are you getting 256 colors?
So each pixel in the array takes 10 bits to describe the x position (640) and 9 bits for the y (480) and 6 bits for the color, so each pixel takes 25 bits. Maybe to make the math simple, 1 long per pixel. So using this system we could draw possibly 7000 pixels on a screen. Maybe useful, maybe not.
Another way of looking at things. Take 640x480 and make it black and white (all 3 guns on or off) then that is 640x480 bits and divide by 8 to give 38400 bytes. So, Bill, how are you doing 400x300x256 colours, is that 400x300 bytes, or 120k. That is more than the memory of the prop. Have you reached the holy grail of pulling in data from a ram chip fast enough for video?
Re the original question, is this about displaying bitmaps on TV or VGA or both?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Currently Morpheus (which is a commercial design, people would need a license from me to make compatible boards) has the most sophisticated video engine of any Propeller based board, however mctrivia is making a 16bpp design using FPGA's that will be very interesting, and ofcourse, PropII will support 15bpp natively!
I use 3R 3G 2B DAC, with Hsync and Vsync on a separate ping group. My current drivers use 6 cogs to implement an XMM/VGA256 engine:
1 - Sync generation cog (HSync and VSync)
2 - Video generation cogs
1 - Address generation cog
2 - Burst read cogs
My next generation driver will combine the Sync and Address generation cogs.
The current 256x192 driver uses one byte per pixel, for 256 colors per pixel, but it generates XGA timing (monitor thinks it is displaying a 1024x768 image)
The upcoming 320x240 driver will also use one byte per pixel, but will use VGA timing (monitor sees 640x480)
The future 400x300 driver will also use one byte per pixel, but will use SVGA timing (800x600) - I may even be able to do a 512x384 driver with 256 colors per pixel!
I also have 4 color (out of 256) drivers with a unique palette of 4 colors per scan line for 640x480, 800x600 and 1024x768.
My current design is the result of a lot of experimentation as to what is the best balance between memory bandwidth, available colors, and pin usage on a Propeller. I also considered several CPLD based designs, and may yet produce some - one of my CPLD designs uses only 15 pins for 256 colors (including memory interface!) but sacrifices random access speed, and requires a CPLD similar in cost to another Propeller, due to the number of LE's required to implement a display engine on the CPLD, in addition to a memory controller.
These are all VGA modes as Morpheus does not have a TV output. An off-board RGB to NTSC converter could be used for TV display.
A sparse display like you describe could be written, however the method you describe is too slow. Look up "scan line buffers" and "scan line renderers" for some methods that can be used to implement sparse displays. At a minimum you would need two scan line buffers, and generate scan line n+1 while displaying scan line n. Rinse and Repeat [noparse]:)[/noparse]
As far as the Holy Grail goes... I have been able to do burst reads at 20MB/sec since well before UPEW 2009 where I demonstrated 1024x768 bitmapped graphics with two bits per pixel, and 256 colors on screen at once.
(Yes, 20 Mega BYTE's, not mega bits <grin> but I have to use a lot of pins, and a lot of cogs - and the code was the most incredible PITA to debug I have ever written)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheusdual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
Post Edited (Bill Henning) : 1/5/2010 5:43:29 AM GMT
Actually my design was 24bpp using a CPLD but it was to expensive. Once I get my RAM Modules working I will lay the PCB for a circuit I have designed that will get 16bpp using only the prop, ram, and some latches. it will work with Rays LCD Screen though not a VGA Monitor.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
24 bit LCD Breakout Board now in. $21.99 has backlight driver and touch sensitive decoder.