Shop OBEX P1 Docs P2 Docs Learn Events
VGA vs. TV out — Parallax Forums

VGA vs. TV out

fezmonkeyfezmonkey Posts: 41
edited 2010-06-01 23:36 in Propeller 1
This have probably been coved before but I am not finding an answer.

What are the limitations on VGA vs TV out? Which one needs more resources (cogs/memory)

Is it correct that with TV you can only have a max of 4 colors? but then with VGA you have a max of 4 colors for each RGB and so you end up with 64 colors?!!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-06-01 17:55
    It isn't so much about VGA vs TV as it is about numbers of pixels. There are bitmapped graphics drivers and text-only drivers for both a VGA and a TV display that use the same number of cogs and roughly the same amount of memory. On the other hand, a typical VGA display can handle vastly more pixels than a TV display and more pixels means more cogs and more memory.

    The video generator can handle at most two bits per pixel which gets you a maximum of 4 colors, but the 4 colors are chosen for a horizontal run of 16 pixels. A different set of 4 colors can be used for each run of 16 pixels and each of the 4 colors is determined by an 8 bit value. Typically, the video driver code is written to handle a 16 x 16 or 16 x 32 "tile" of pixels and to use the same set of 4 colors for all of the rows in the tile. This works well with the font table in ROM which is designed with 16 x 32 pixel tiles. There's a color palette consisting of up to 64 4-byte entries and each tile or character on the display screen can use a different color palette value. With the greater number of tiles possible on a high resolution VGA display, the video drivers are written to use only one color palette value per line of text to save display buffer space which is limited on the Propeller.
  • RaymanRayman Posts: 15,003
    edited 2010-06-01 17:56
    Regular VGA (640x480) and TV use about the same resources. Both only allow 4 different colors in each 16x16 pixel tile. But, different tiles can have a different set of 4 colors....
    The regular VGA hardware setup allows 64 different colors. The regular TV hardware setup allows for more colors....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
  • fezmonkeyfezmonkey Posts: 41
    edited 2010-06-01 20:59
    I do embedded programming for living but the propeller is a new thing for me. I am hoping you guys can help me out a bit more please
    I have read about "tiles" but I am still lost understanding how they work!

    Is it correct if I say this: there are small 4-color 16x16 bitmaps in memory. I can map any of these 4 colors to my choice of 256 colors. We then can place this 16x16 bitmap (or tile) anywhere we like on the display? So I can have 256 color on the display but each 16x16 tile must only have 4 colors?

    Am I correct or how far am I?

    Can someone explain this please, maybe this is the key for me to understand what is going on!

    ' so we have 64 colors in total that we can pick out of 256?
    'init colors
    repeat i from 0 to 64
    colors := $00001010 * (i+4) & $F + $2B060C02

    'have no clue what is going on here! Is the display an array of pointers to the tiles? but then what is a tile!!
    'init tile screen
    repeat dx from 0 to tv_hc - 1
    repeat dy from 0 to tv_vc - 1
    screen[noparse][[/noparse]dy * tv_hc + dx] := display_base >> 6 + dy + dx * tv_vc + ((dy & $3F) << 10)

    Post Edited (fezmonkey) : 6/1/2010 9:08:17 PM GMT

  • localrogerlocalroger Posts: 3,452
    edited 2010-06-01 21:21
    VGA gives a sharper image than TV because each color has its own full-bandwidth channel; TV colors (especially highly saturated colors like the Prop produces) can smear badly.

    TV monitors are a lot easier to find and cheaper. You can get a brand new 7 inch "headrest" monitor (sold for the purpose of letting your kids watch DVD's in the back seat of your pimped-out SUV) for about $60. The cheapest VGA monitors I've found in that form factor are nearly double the price. It's about economies of scale; DVD displays are a big market and lots of those are made. (I have heard Bill Henning might be sourcing something in that dept. though. Hope I can make it to UPEW...)

    Resource usage really depends on what you're using it for. If you want a bitmapped 640x480 pixel display you should really be using a different chip, or dedicating a propeller to nothing but display duty. I wrote a reduced resolution TV text driver that provides for mixing resource-stingy 8x8 pixel user defined characters with the 16x32 native Prop character set; this allows me to display large, relatively low-resolution graphics along with razor sharp Prop text. But to get the timing to work I had to reduce the horizontal resolution to 32 characters instead of 40. (Typically I use 4 or 6 lines of 20 to 25 characters, for kiosk displays). I haven't looked closely into the VGA driver because of the cost of hardware, but I suspect the timing is tighter and I might not be able to pull off the same trick.
  • fezmonkeyfezmonkey Posts: 41
    edited 2010-06-01 22:39
    If you want a bitmapped 640x480 pixel display you should really be using a different chip, or dedicating a propeller to nothing but display duty
    
    



    All I want is get about 320x240 or less and I do not want the propeller to do anything beside display a bitmap I send from a secondary microcontroller. This seem doable but the problem is in colors. Can I display 16 colors on any pixel? I was told no, you can only have 4 colors!! but then you can have more colors by having different colors on different tiles!
  • Mike GreenMike Green Posts: 23,101
    edited 2010-06-01 22:54
    The Hydra Manual is a good source for information on the Propeller's video generator, well worth the modest cost.

    It's possible to force the video generator to output 4 pixels per 32 bit word with each color chosen from one of 4 bytes in another 32 bit word.· That would allow you to have 256 colors per pixel.· A 320 x 240 pixel display requires around 80K for its display buffer, much more than what's available on the Propeller.· You'd have to cut this to maybe 160 x 128 to fit it in memory with some space for code.· It is possible to use external SRAM for a video buffer (like Bill Henning's Morpheus) and get higher resolutions with more colors.· See his website for details.
  • RaymanRayman Posts: 15,003
    edited 2010-06-01 22:56
    You can check out VGA color options here:

    http://www.rayslogic.com/propeller/Programming/Colors.htm

    And TV colors here:

    http://www.rayslogic.com/propeller/Programming/TV_Colors.htm

    And here's how you can show 2-bit bitmaps:

    http://www.rayslogic.com/propeller/Programming/2BitBitmap.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
  • Bill HenningBill Henning Posts: 6,445
    edited 2010-06-01 23:25
    Hi,

    320x240 = 76,800 bits

    so:

    2 colors (1bpp) = 76,800/8 = 9,600 bytes .... feasible with a prop by itself.

    4 colors (2bpp) = 76,800/4 = 19,200 bytes ... barely feasible with a prop by itself

    16 colors would need 38,400 bytes - which is more memory than a prop has, therefore it is not feasible without an external frame buffer, and a LOT of work designing a driver to use it (and to make 16 color line scan buffers)

    64 colors would need 96,800 bytes - 3x the amount of memory the prop has, and is the maximum that can be done with the standard Parallax VGA design.

    Morpheus can do 320x240 by 256 colors per pixel using 96,800 bytes per bitmap, however I have not written a 320x240 driver yet - but I will be writing one. I do have a 256x192 256 color driver. Note - Morpheus uses a non-standard VGA configuration and more cogs to achieve this. Morpheus is a dual propeller expandable single board computer.

    See my signature for links to Morpheus.
    fezmonkey said...
    If you want a bitmapped 640x480 pixel display you should really be using a different chip, or dedicating a propeller to nothing but display duty
    
    



    All I want is get about 320x240 or less and I do not want the propeller to do anything beside display a bitmap I send from a secondary microcontroller. This seem doable but the problem is in colors. Can I display 16 colors on any pixel? I was told no, you can only have 4 colors!! but then you can have more colors by having different colors on different tiles!
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com E-mail: mikronauts _at_ gmail _dot_ com
    My products: Morpheus / Mem+ / PropCade / FlexMem / VMCOG / Propteus / Proteus / SerPlug
    and 6.250MHz Crystals to run Propellers at 100MHz & 5.0" OEM TFT VGA LCD modules
    Las - Large model assembler Largos - upcoming nano operating system
  • Bill HenningBill Henning Posts: 6,445
    edited 2010-06-01 23:36
    Hi localroger,

    You are right, I will be introducing an 800x480 WVGA TFT LCD module and matching analog module at UPEW. Unfortunately as I cannot import them by the thousands, and as they are OEM modules meant to be integrated into custom products (for industrial control as an example) I cannot match Ebay pricing for mass produced car monitors (video or VGA).

    Currently I can offer:

    5.0" 640x480 TFT LCD module with matching analog module, VGA and Video input, $149USD+s/h "list", $119USD+s/h to forum members. Compare at $250+ at US distributors.

    7.0" 800x480 TFT LCD module with matching analog module, VGA, Video and S-Video inputs, $199USD+s/h "list", $159USD+s/h to forum members. Compare at $300+ at US distributors.

    7.0" 480x234 TFT LCD module with matching analog module, Video in, $99USD "list", $89USD+s/h for forum members - compare at $150+ at US distributors.

    These are qty.1 prices, I can do somewhat better in qty.25/qty.100 and up.

    All modules take 12VDC, and I can get matching 4-wire touch screens for them.
    localroger said...
    VGA gives a sharper image than TV because each color has its own full-bandwidth channel; TV colors (especially highly saturated colors like the Prop produces) can smear badly.

    TV monitors are a lot easier to find and cheaper. You can get a brand new 7 inch "headrest" monitor (sold for the purpose of letting your kids watch DVD's in the back seat of your pimped-out SUV) for about $60. The cheapest VGA monitors I've found in that form factor are nearly double the price. It's about economies of scale; DVD displays are a big market and lots of those are made. (I have heard Bill Henning might be sourcing something in that dept. though. Hope I can make it to UPEW...)

    Resource usage really depends on what you're using it for. If you want a bitmapped 640x480 pixel display you should really be using a different chip, or dedicating a propeller to nothing but display duty. I wrote a reduced resolution TV text driver that provides for mixing resource-stingy 8x8 pixel user defined characters with the 16x32 native Prop character set; this allows me to display large, relatively low-resolution graphics along with razor sharp Prop text. But to get the timing to work I had to reduce the horizontal resolution to 32 characters instead of 40. (Typically I use 4 or 6 lines of 20 to 25 characters, for kiosk displays). I haven't looked closely into the VGA driver because of the cost of hardware, but I suspect the timing is tighter and I might not be able to pull off the same trick.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com E-mail: mikronauts _at_ gmail _dot_ com
    My products: Morpheus / Mem+ / PropCade / FlexMem / VMCOG / Propteus / Proteus / SerPlug
    and 6.250MHz Crystals to run Propellers at 100MHz & 5.0" OEM TFT VGA LCD modules
    Las - Large model assembler Largos - upcoming nano operating system
Sign In or Register to comment.