Shop OBEX P1 Docs P2 Docs Learn Events
VGA Color on 3 pins..... Concept and ideas for maximum colors — Parallax Forums

VGA Color on 3 pins..... Concept and ideas for maximum colors

Cluso99Cluso99 Posts: 18,069
edited 2011-08-30 23:21 in Propeller 1
I have 3 prop pins for VGA use...

I want the maximum colors possible (I want my cake and eat it too!)

How can this be achieved...

Lets call the 3 pins R, G & B for outputting to the RGB of the VGA. Now, to get HS & VS I can tristate the R pin and circuitry can detect this and switch the G & B pins to now output HS & VS on those pins. This solves the HS & VS and now gives us back the 3 pins for the RGB colors.

So, with 3 pins, how can I gain the most colors?
Lets assume that each pin connects ultimately to it's respective R, G & B output. Now we can examine a pin to find the best circuit. Each pin has 2 states, low and high (tristate is not possible within the pixel frame in the vga counters).
By connecting a buffer and an inverter to the pin, we can use a different resistor value to obtain 2 different values for the color pin. Obviously, we now lose black.

So now we have 3 pins able to each produce 2 primary color hues (is this the correct term?). So now we have a total of 8 colors (but black is impossible here).

Does anyone have any other ideas?

BTW I am looking for a cheap solution so almost all programmable logic will be too expensive, and in that case, I may as well use a second propeller!
By buffering the pin we

Comments

  • ericballericball Posts: 774
    edited 2011-08-30 18:08
    On a per-line basis you can use CTRB in DUTY mode to "push" one or two of the outputs up from zero. (Kinda like the NES had RGB emphasis bits.) So per-pixel you've only got 8 colors (I'd recommend keeping black), but per line you have some extra shading abilities. Externally inverting the outputs might be more useful so you always have black and you use the DUTY to tone down one of the colors.

    Adding tristate logic to the other pins would give you 2 sets of 4 pixel colors selectable on a per-line basis.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-08-30 18:12
    Hmm - no black. I guess you still get the same number of colors doing this but they are different (lighter) colors.
    I may as well use a second propeller!

    I'm going down the same road, and it is a road already traveled by Baggers et al, ie a devoted propeller for graphics. They are using two props and I'm looking at one prop plus an external ram. 256x224 works now for TV and so VGA could be the next challenge. The more pins for the ram chip, the faster it goes, and so your HS/VS tristate trick could be very useful. I'm thinking 2 pins for serial comms to talk to the board, 6 for VGA and 24 for ram and a latch...
  • localrogerlocalroger Posts: 3,452
    edited 2011-08-30 18:24
    Unless you use PWM in the limited way ericball suggests, the maximum number of colors you will ever get with 3 pins is 8. You can jigger which 8 by fiddling with the resistors or even ignoring one of the RGB signals to use a pin for putting luminance on another, but losing black is probably not a good idea.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-08-30 18:29
    Drac: I am sticking to a latchless solution for SRAM. So my PicoBlade(TM) solution requires a single prop, a tiny pcb, cheap logic. This gives me 5 pins to do VGA or TV, eeprom, kbd. For anything more, my NanoBlade(TM) uses 2 props (or 3 for better VGA resolution). The NanoBlade pcbs will be sent to mfr this week.

    Eric: That's a nice idea worth considering :)

    BTW: I looked at CPLDs but they are big (12x12mm which is basically prop size) or power hungry.

    Thinking about it, I guess 8 basic colors is going to be pretty much it, with 1 of them being black. Perhaps Erics suggestion makes the most sense.
  • jmgjmg Posts: 15,185
    edited 2011-08-30 23:21
    Cluso99 wrote: »
    Drac: I am sticking to a latchless solution for SRAM.
    Eric: That's a nice idea worth considering :)
    BTW: I looked at CPLDs but they are big (12x12mm which is basically prop size) or power hungry.

    CPLDs do come smaller, but a CPLD will always be more costly that a latch on the SRAM.

    So why not add the cheapest extra chip, Latch the RAM, and simply free up some pins, for more Colors ?

    Or, still slightly ahead of a PLD solution, is cheap SRAM, under $1.50/100+, would give you a 256 colour palette.?
Sign In or Register to comment.