Shop OBEX P1 Docs P2 Docs Learn Events
Basic Video Broadcast Operation — Parallax Forums

Basic Video Broadcast Operation

edited 2007-11-28 21:31 in Propeller 1
I am just starting to work with the video.· I am used to 24 bit color pixel or 8 bit grayscale.· The doc on the video is confusing.

I have a bitmap in memory how do I feed this out.· I have looked at some of the examples but they are not commented very well.

Does anyone have a good resource or well commented example on how to output pixel data.

Thanks.jumpin.gif

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-16 15:43
    The best resource is the Hydra Manual. There is some information in the Propeller datasheet.

    The Propeller's video generator is based on "tiles" of 32 or 16 horizontal pixels with either two colors or 4 colors respectively
    per pixel and the 2 or 4 color "palette" associated on a per tile basis (each tile can have a different palette). You might look
    at Terry Hitt's display overlay driver (in the Propeller Object Exchange) which is a simple black and white bitmap video driver.
  • edited 2007-11-16 16:21
    I think I finally get it. I am confined to at most 4 colors for every horizontial 16 pixels. Could yield some very interesting displays on the tv[noparse]:)[/noparse]

    Thanks Rayman. Your color app lifted the confusion curtain.

    I wonder why they did it this way instea of just allowing 24 bit color or 8 bit b/w???
  • RaymanRayman Posts: 14,162
    edited 2007-11-16 16:30
    Somebody (Baggers, I think) has done this, but I think it uses up most of the output pins... This way only uses a few pins...
  • hippyhippy Posts: 1,981
    edited 2007-11-16 16:34
    WAITVID churns out a pixel stream, 32 x 1-bit ( two colour ) or 16 x 2-bit ( four colour ) with the source register specifying the pixel bits and the destination register defining the colours for each pixel. Synch's and so on are just special colour values used in the right place.

    You're right; a maximum of four colours per 16 horizontal pixels.

    VCFG register sets the 'operating mode' and VSCL register sets the rate at which pixels are churned out.

    The clearest examples (IMO) I've seen are those of and derived from potatohead's 8x8 text driver. My own variation on that shows perhaps more clearly how it is done a scan line at a time.

    That was the code which gave me an understanding of Propeller video generation.

    http://forums.parallax.com/showthread.php?p=679210
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-16 16:46
    I believe that the video was done this way mostly because it was simple and straightforward given the limited resources (chip real estate) available, yet could provide both video and VGA output and be usable for other applications as well (like phase shift keying or other waveform generation). Four colors with a per-tile palette is hugely flexible for applications like control panel displays and is reasonably matched to the limitations of NTSC/PAL video. There's also not enough memory in the Propeller to support any significant VGA graphics resolution with even the 4 color per pixel format.
  • edited 2007-11-16 18:31
    What is the maximum size for broadcast/baseband video and framerate?

    Thanks.
  • RaymanRayman Posts: 14,162
    edited 2007-11-16 18:40
    AFAIK framerate for NTSC is always 30 fps (or 60 interlaced half frames per second).

    I think this is about the biggest screen for NTSC:
    cols = 42
    rows = 28

    You get a bit more with PAL.
  • edited 2007-11-16 18:44
    So for a B/W image I only have 4 grayscale colors.
  • edited 2007-11-16 18:51
    If I am doing my math correctly it looks like 64 possible colors
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-16 19:07
    For non-color video, you're really more limited than that (see the datasheet). The 8 bit values for the pixel colors have only 3 bits of luminance data and the blackest level is reserved for the sync level, so you have 7 gray levels possible. The other bits include one to enable color and 4 for the phase angle in relation to the color subcarrier.

    There's a utility (demo) program to display the color values that's included with the Propeller Tool.
  • edited 2007-11-16 19:20
    How do you indicate the end of a scanline and/or the end of an image??

    I have a 640x480 b/w image that I would like to stream from ext memory.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-16 19:35
    Since the video generator just continues to produce output and will just grab the contents of an internal bus if not fed with a WAITVID instruction, you can turn off video generation or feed values that produce the sync pulses (super-black) or a blank screen (black).
  • edited 2007-11-16 20:52
    Thanks for the help. It looks like I should be able to modify the 'VGA 512x384 2-Color Bitmap Driver v1.0" driver
  • RaymanRayman Posts: 14,162
    edited 2007-11-16 21:07
    I think there's a 640x240 driver in Object Exchange too...
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-11-19 02:01
    it's not very difficult to get around the 4 colors/16 pixels limitation; adjust vscale so that only 4 pixel's worth of data is pushd out over the frame, set pixels to colors 0 through 3 and set the colors for the 4 pixeels.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • edited 2007-11-28 14:32
    How do I convert a 24-bit RGB value to a TV color??

    Thanks.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2007-11-28 15:33
    Check out this link for a simple algorythm...

    http://forums.parallax.com/showthread.php?p=645048
    I settled on a simple algorithm... convert the image to grey scale first...

    GreyScale = (Red + Green + Blue ) \ 3

    Next set RGB values so that they are all equal. (This is part of converting the image to grey scale)..

    Red = Green = Blue = GreyScale

    Now if you strip the LSB bits of the Grey Scale value down leaving only the upper 2 bits, you are left with 4 color combinations which is exactly what is needed...

    4Color = (GreyScale AND &HC0) \ &H40

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • edited 2007-11-28 21:31
    Thanks for the help.

    Maybe I am missing something, but it looks like you just thru away all your color data.

    It looks like the grayscale will just get filled with meaningless colors.

    How do you pick one of the 64 colors that is closest to the 24 bit RGB value??
Sign In or Register to comment.