Shop OBEX P1 Docs P2 Docs Learn Events
Propeller noob here. Is it right for me? — Parallax Forums

Propeller noob here. Is it right for me?

salfasanosalfasano Posts: 7
edited 2011-10-28 22:26 in Propeller 1
I'm currently working on an embedded system that requires the ability to display an alternating pattern of variable rate and type on a monitor.

For example, a checkerboard pattern like the following where the checks flip to the opposite color at a frequency of 2-15Hz.

y6PhL.jpg

The pattern could also be horizontal bars, vertical bars, etc., all of variable size.

When researching devices to accomplish this I came across the propeller and it's video generation capability. Would it be suitable for my requirements?

Thanks

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-10-21 21:12
    slafasano,

    Welcome to the forum!

    That should be a snap for the Propeller. The easiest way to do what you want would be to predefine the pattern and just swap bytes in the color descriptor when you want to flip colors. (What you propose sounds migraine-inducing, though! :) )

    -Phil
  • SRLMSRLM Posts: 5,045
    edited 2011-10-21 21:27
    Take a look at the VGA objects on the obex for sample display code: http://obex.parallax.com/
  • salfasanosalfasano Posts: 7
    edited 2011-10-21 21:44
    Thanks for the response!

    Would creating the patterns dynamically be feasible? I'd like to pass some parameters such as BlackRGB and WhiteRGB (for contrast variability), Width, Height,etc. and create the pattern based on that. There are so many combinations of variables that predefining patterns probably isnt possible.
    slafasano,

    Welcome to the forum!

    That should be a snap for the Propeller. The easiest way to do what you want would be to predefine the pattern and just swap bytes in the color descriptor when you want to flip colors. (What you propose sounds migraine-inducing, though! :) )

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-10-21 21:50
    The graphics.spin object will let you create any kind of pattern you want. What I was suggesting was that, when it comes time to ping-pong the display, it's quicker just to alter the palette than to redraw the entire pattern.

    Having said that, there are some limitations on the color gamut available. The VGA output, for example, uses a six-bit R:G:B (2:2:2) color space. The NTSC output is similarly limited.

    -Phil
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-10-21 21:53
    salfasano wrote: »
    ...

    For example, a checkerboard pattern like the following where the checks flip to the opposite color at a frequency of 2-15Hz....

    Sounds suspiciously like Photic Driving. Seriously dude, don't mess around with it if you've got epilepsy in your family.
  • salfasanosalfasano Posts: 7
    edited 2011-10-21 21:59
    Sounds suspiciously like Photic Driving. Seriously dude, don't mess around with it if you've got epilepsy in your family.

    http://en.wikipedia.org/wiki/Evoked_potential#Visual_evoked_potential
  • salfasanosalfasano Posts: 7
    edited 2011-10-21 22:01
    The graphics.spin object will let you create any kind of pattern you want. What I was suggesting was that, when it comes time to ping-pong the display, it's quicker just to alter the palette than to redraw the entire pattern.

    Having said that, there are some limitations on the color gamut available. The VGA output, for example, uses a six-bit R:G:B (2:2:2) color space. The NTSC output is similarly limited.

    -Phil

    Ok sounds good. Thanks so much for the help!
  • MagIO2MagIO2 Posts: 2,243
    edited 2011-10-22 05:15
    I think these easy patterns can be generated programatically without the need of a graphics buffer. So it would also be possible to use more than one COG to generate more than 6 bit color.
  • potatoheadpotatohead Posts: 10,261
    edited 2011-10-22 09:36
    Yep. Agreed on both, though I personally would seriously consider tiles.

    With simple patterns, blocks essentially, tile displays could also be used. A creative set of tiles would provide for a lot of patterns. Resolution could be fairly high as well.

    1. Render pattern elements

    2. Build screen display.

    3. Assign colors

    4. Color cycle using color redirection possible in 4 color / tile displays.

    If there isn't a lot of other processing needed, a basic set of patterns output to VGA / TV would take minutes. Good match for the Propeller. If wider color spaces are needed, that's going to take a few hours, depending. Good news is we've done them in various ways, each with limits, but the foundations are there. Same for resolution.

    The only real difficulty is the combination of resolution, larger color spaces and display detail complexity. So long as one doesn't want to optimize all three, the Prop is going to do the job very nicely.
  • salfasanosalfasano Posts: 7
    edited 2011-10-28 15:22
    So I received my propeller demo board and I'm trying to play around with some graphics demos, but I don't see any output from the VGA port on my monitor or tv. Do I need a different crystal for VGA output? Am I using the wrong type of display? The monitor is a Dell S2209W and the TV is a Vizio XVT373SV.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-10-28 15:33
    Almost all of the video generation is done in software, so there are different display drivers for VGA and TV and the dimensions of the display area are usually different. Programs are generally written for one or the other. It's quite possible to write a program that, with a change to one or two lines of the program and a recompilation, can work with either type of display. It's even quite easy to use both at the same time if you're displaying just text on one of the displays. Graphics displays are very memory intensive and, depending on the display resolution, you may not have room for both display drivers with their buffers.

    FemtoBasic, for example, comes in a VGA version and a TV version. The difference is 3 lines in the main program and a recompilation.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-10-28 15:40
    salfasano wrote: »
    ...Do I need a different crystal for VGA output?....

    No. The Demo board should work fine with VGA. As Mike said, you just need to be sure you have the right code for whichever display type you are using. You can't use a VGA object to drive the TV, etc.

    You might want to post the code you're using to set this up. It might be obvious what's going wrong.

    attachment.php?attachmentid=78421&d=1297987572
  • salfasanosalfasano Posts: 7
    edited 2011-10-28 15:44
    No. The Demo board should work fine with VGA. As Mike said, you just need to be sure you have the right code for whichever display type you are using. You can't use a VGA object to drive the TV, etc.

    You might want to post the code you're using to set this up. It might be obvious what's going wrong.

    attachment.php?attachmentid=78421&d=1297987572

    I haven't written or modified any code yet. All I tried was running Graphics_demo.spin, Graphics.spin and VGA.spin.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-10-28 16:10
    salfasano wrote: »
    I haven't written or modified any code yet. All I tried was running Graphics_demo.spin, Graphics.spin and VGA.spin.

    Are you sure that the Demo board has power? Have you checked that your computer can actually communicate with the Demo board?
    If I remember correctly, a bank of yellow(?) surface mount LEDs will light up if the Demo board is sending signals to the VGA. Any sign of those?
  • salfasanosalfasano Posts: 7
    edited 2011-10-28 16:22
    Yes the device is powered and the LEDs light up when first turned on. When I program it with the demo graphics programs I do not see anything on the LEDs. I can modify some of the blinker programs to make the surface LEDs light up so I know I am able to load programs to RAM properly.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-10-28 22:26
    salfasano,

    I'm afraid I'm away from my usual computer that can read SPIN code, so perhaps you could start a new thread and title it something like "Having problems getting Demo board to display VGA" so others might be aware of your present problem. The present title of this thread might cause some people to ignore it but people on this forum are generally very helpful if they see somebody is having a specific problem.

    Did you try the TV demo object and try outputting to a TV, but still got nothing?
Sign In or Register to comment.