Shop OBEX P1 Docs P2 Docs Learn Events
VGA 256 Colors — Parallax Forums

VGA 256 Colors

RoadsterRoadster Posts: 209
edited 2012-07-13 02:27 in Propeller 1
I have been working on getting more colors out of VGA and have been able to get 2 formats both only use passive components, more details to follow, I'm current working on a picture converter
I'm sorry about the bad photos, it's the best I can get with my camera.

RRRGGGBB
P_RRRGGGBB.JPG


RRGGBBII
P_RRGGBBII.JPG


Demo_08_32x25x4bit_07_09_2012.zip
640 x 577 - 205K
640 x 580 - 207K

Comments

  • RoadsterRoadster Posts: 209
    edited 2012-07-07 12:16
    Just a quick update, Here is a picture displayed on my VGA monitor in rrggbbii format
    PTurtle.JPG
    640 x 428 - 182K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-07-07 12:32
    That's a nice rendering! What's the pixel resolution? I'm anxious to see the hw/sw details!

    -Phil
  • RoadsterRoadster Posts: 209
    edited 2012-07-07 14:14
    @Phil the resolution is 256X192 with 16 color palettes.
  • msrobotsmsrobots Posts: 3,709
    edited 2012-07-07 15:16
    @roadster,

    this is very nice especially rrggbii looks great...

    Enjoy!

    Mike
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-07-07 15:35
    roadster: Nice job.
    BTW do you mean RRGGBBII (missed a B)?
    Also anxiously await your hw details.
  • RoadsterRoadster Posts: 209
    edited 2012-07-07 17:35
    Here is the schematic for RRGGBBII
    VGA_RRGGBBII.jpg
    640 x 467 - 47K
  • PerryPerry Posts: 253
    edited 2012-07-07 17:49
    WOW !!
    This is exciting, fantastic!
    Who has not dreamed of doing something with the two lonely lost bits not used in the present VGA byte storage metaphor.?

    Can't wait to see more ....
    Perry
  • RaymanRayman Posts: 14,597
    edited 2012-07-07 18:51
    Photo does look great. Is RRGGBBII really better than RRRGGGBB? Which one is the turtle in?

    I guess you're doing some kind of compression to get that kind of resolution, right?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-07-07 19:00
    Rayman wrote:
    I guess you're doing some kind of compression to get that kind of resolution, right?
    I shouldn't think compression would be necessary. 256x192x4 bits is 24576 bytes. That'll fit.

    -Phil
  • RaymanRayman Posts: 14,597
    edited 2012-07-08 03:57
    Ok, this sounds similar to what Phil did for the slide presenter then (using a new palette for every 4 pixels).
    The palette info takes some space too though, right?
  • RoadsterRoadster Posts: 209
    edited 2012-07-08 04:11
    @Rayman, Phil is right no compression, curently the turtle picture has 48 16 color palettes in rrggbbii format
    I created the rrggbbii format because I was not happy with results I was getting with rrrgggbb, both formats are good it depends on what you want to do
    rrggbbii is slightly better for photos
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-07-08 09:06
    Roadster,

    Are the palettes statically assigned in an 8x6 array or more dynamically. How do you (or your program) decide which colors to put in which palettes? Why the diodes instead of continuing the resistor-value progression? Show us some code already! :)

    -Phil
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-07-08 18:24
    Nice work. I have seen the diode and resistor cct used in the ATMega for generating the II signals on top of RGB.
  • RaymanRayman Posts: 14,597
    edited 2012-07-09 06:44
    Ok, I get it now... 4 bits per pixel and using a lot of 16 color palettes.
    Does each line have it's own palette? Or, every 8 pixels?

    Don't see the reason for the diodes though. I think they are not necessary.
  • pik33pik33 Posts: 2,366
    edited 2012-07-09 08:24
    Without these diodes pure colors can't be achieved. Signal, for example, R, will go to G and B via these I resistors.
  • RaymanRayman Posts: 14,597
    edited 2012-07-09 08:48
    Wouldn't that only happen if the Propeller pins were floating? Assuming the prop pins are all outputs,
    the Prop is forcing the voltage at these junctions where the diodes are.
  • Mark_TMark_T Posts: 1,981
    edited 2012-07-09 13:32
    Rayman wrote: »
    Ok, I get it now... 4 bits per pixel and using a lot of 16 color palettes.
    Does each line have it's own palette? Or, every 8 pixels?

    The resistor values are the same for ii as each color, so the scheme has more redundancy than RRRGGGBB. The scheme prevents full saturation of each colour too, so I don't see how it can be superior - the color cube is not spanned effectively.
  • RoadsterRoadster Posts: 209
    edited 2012-07-09 16:03
    In this post and the top post you will find the propeller code used to create 8 bit vga, It needs 4 cogs, 1 for vga and 3 for tile rendering. The tiles are 8x8 with a screen map that is 16 bits, 10 bits for the tile index 0-767 and 6 bits for the palette 0-63. This tile renderer was orinally created for a concentration game to display 48 high color game cards. The graphics converter is a big mess in multible parts and needs time to put it together before I can post it.
    The resister arrangement you decide to use is up to you, I'm not saying what's right or wrong, I was merely trying different options and providing you with 8bit VGA palette

    Demo_08_32x25x4bit_07_09_2012.zip
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-07-09 16:12
    Mark_T wrote:
    The scheme prevents full saturation of each colour too, so I don't see how it can be superior - the color cube is not spanned effectively.
    It depends on the app. For photos, a greater intensity range and less saturation is not a bad thing. But that kind of color gamut may be less useful for graphics.

    Without the diodes and continuing the binary weighting scheme for ii, here's the palette that results:

    attachment.php?attachmentid=94085&d=1341875480

    You do get good color saturation, but the fully-saturated colors are at only 80% of full intensity. By including the diodes, but reversed, you can get fully-saturated colors at full intensity, but with other tradeoffs.

    -Phil
    224 x 225 - 39K
  • Mark_TMark_T Posts: 1,981
    edited 2012-07-10 01:50
    Yes, 8 bits is frustratingly limited - had a little ponder about HSV using 3/1/4 bits respectively. The hue bits would gate the 4-bit DAC outputs to each R/G/B output and the saturation bit would mix them together - my circuit would need 3 buffers and 6 analog switches, one for gating each colour and 3 to mix them with a resistor triangle...
  • whickerwhicker Posts: 749
    edited 2012-07-10 21:54
    has anyone else seriously considered using a RAMDAC?

    or does that kind of defeat the idea of using only the Prop Chip and a few discrete components?
  • Mark_TMark_T Posts: 1,981
    edited 2012-07-11 10:09
    whicker wrote: »
    has anyone else seriously considered using a RAMDAC?

    or does that kind of defeat the idea of using only the Prop Chip and a few discrete components?

    Heresy! Heresy! (only joking)
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-07-11 10:47
    Are RAMDACs even made anymore? I keyed in some TI and Brooktree part numbers and came up with only limited stock from distributors that carry obsolete parts.

    -Phil
  • whickerwhicker Posts: 749
    edited 2012-07-12 00:40
    Phil, yeah that's kind of what I came across as well.
    I was hoping at least something was still in production.
  • ericballericball Posts: 774
    edited 2012-07-12 06:53
    Use a second slave Prop as a RAMDAC:
    RAMDAC		jmp	#:start
    		long	$FF_FF_FF_00 [255]	' CLUT 1-255
    :clut0		long	$00_00_00_00		' CLUT 0
    :start		mov	RAMDAC, :clut0
    		mov	DIRA, FFFFFF00
    		jmp	#start2
    :loop		mov	OUTA, 0-0
    :start2		mov	temp, INA
    		and	temp, #$FF
    		movs	:loop, temp
    		jmp	#:loop
    FFFFFF00	long	$FFFFFF00
    temp		res	1
    

    Hmm.. although the loop is 20 CLK, so that's only 4MHz pixel clock. Probably too low for a decent VGA resolution.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-07-12 09:20
    If you go with 18-bit color, say, instead of 24, you can add a guard bit at ina[8] and eliminate the temp stuff. That still doesn't get you to a 25 MHz pixel clock, though.

    -Phil
  • RaymanRayman Posts: 14,597
    edited 2012-07-12 13:18
    When you start thinking about using a second Prop, or a lot more external hardware, you'll eventually think about using the SSD1963...
  • pik33pik33 Posts: 2,366
    edited 2012-07-13 00:19
    SSD1963 is not a Prop, so, as Mark_T said, it is heresy :)


    All this RAMDAC discussion leaded me to an idea... The Amiga, or C64, or Atari ST, or Atari 800.. these computers was built with main processor, RAM and some custom chips. Graphic chip, sound chip, memory management chip, i/o chip...

    so - let we make some customchips from Propellers...

    A full Propeller with its 8 cogs and 32k RAM, dedicated as graphic custom chip, with defined pins, graphic modes etc...

    Make a retrocomputer this way: define one Prop as a main CPU, next one as soundchip, one as graphic chip, one as MMU, make a standard computer structure with address and data buses, add 16 MB of RAM...

    ... yet another crazy idea...

    but the Propeller as graphic custom chip can make a lot of good things, RAMDAC - like color translations included... We only have to feed it with data. Fast. This can be a problem.. but we all know there is nothing impossible with the Propeller, and even if it is, you can always add a second one.
  • Ahle2Ahle2 Posts: 1,179
    edited 2012-07-13 02:27
Sign In or Register to comment.