PDA

View Full Version : Propeller noob here. Is it right for me?



salfasano
10-22-2011, 03:57 AM
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.

http://i.imgur.com/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

Phil Pilgrim (PhiPi)
10-22-2011, 04:12 AM
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

SRLM
10-22-2011, 04:27 AM
Take a look at the VGA objects on the obex for sample display code: http://obex.parallax.com/

salfasano
10-22-2011, 04:44 AM
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)
10-22-2011, 04:50 AM
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

ElectricAye
10-22-2011, 04:53 AM
...

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.

salfasano
10-22-2011, 04:59 AM
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

salfasano
10-22-2011, 05:01 AM
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!

ElectricAye
10-22-2011, 05:04 AM
http://en.wikipedia.org/wiki/Evoked_potential#Visual_evoked_potential

http://www.ncbi.nlm.nih.gov/pubmed/9623880

MagIO2
10-22-2011, 12:15 PM
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.

potatohead
10-22-2011, 04:36 PM
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.

salfasano
10-28-2011, 10:22 PM
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 Green
10-28-2011, 10:33 PM
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.

ElectricAye
10-28-2011, 10:40 PM
...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.

http://forums.parallax.com/attachment.php?attachmentid=78421&d=1297987572 (http://forums.parallax.com/showthread.php?129690&p=978076&viewfull=1#post9780 76)

salfasano
10-28-2011, 10:44 PM
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.

http://forums.parallax.com/attachment.php?attachmentid=78421&d=1297987572 (http://forums.parallax.com/showthread.php?129690&p=978076&viewfull=1#post9780 76)

I haven't written or modified any code yet. All I tried was running Graphics_demo.spin, Graphics.spin and VGA.spin.

ElectricAye
10-28-2011, 11:10 PM
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?

salfasano
10-28-2011, 11:22 PM
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.

ElectricAye
10-29-2011, 05:26 AM
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?