PDA

View Full Version : Simple VGA question



pgbpsu
10-18-2011, 03:24 AM
I've found a project that would really benefit from a display and I wonder if a spare VGA monitor can meet my needs. I don't know much about graphics on the prop and haven't been able to find any suitable examples. I'd like to have the upper 1/4 of the display for text and the lower part for a simple graph. Is this possible with the VGA/graphics drivers out there? I've looked through the obex and found some demos but haven't seen any mixed text and graphics for VGA.

Where should I start my quest for working with displays and VGA?

Thanks
Peter.

Peter Jakacki
10-18-2011, 03:57 AM
Do you want something like this? (http://forums.parallax.com/showthread.php?133599-Display-motor-RPM-with-large-digits-and-graph-on-VGA-demo)

pgbpsu
10-18-2011, 01:06 PM
Do you want something like this? (http://forums.parallax.com/showthread.php?133599-Display-motor-RPM-with-large-digits-and-graph-on-VGA-demo)

That's great. Thanks for linking to it. I'll pull down the code and have a look. After posting I was able, using the google site search, to find a few examples including Rayman's strip chart EKG. But I hadn't found your's. Thanks.

Peter

Rayman
10-18-2011, 02:51 PM
Peter, you can use "graphics.spin" with VGA, just like you do for TV.
I'm not sure there are too many examples of doing this for the regular 640x480 mode.
But, there is a Parallax example in OBEX of 1024x768 mode with graphics. I have notes on my website about how to move and resize the graphics windows...

Peter Jakacki
10-18-2011, 02:56 PM
@Ray: Peter was asking about mixing text and graphics and I don't know if he needed scalable fonts but that's what I did in my graphics routines so I could specify the X and Y size of characters drawn from the ROM font. I couldn't find anything at all in the OBEX or forum that did this. Is this right?

Rayman
10-18-2011, 03:29 PM
People have converted the TV graphics demo to VGA before. It just doesn't look as nice because the palette isn't the same.
You don't have to have the graphics window be the same size as the screen and then you can mix regular text and graphics.
I'll see if I can track down the 1024x768 example....

Rayman
10-18-2011, 03:33 PM
I just took a quick look and couldn't find the 1024x768 with graphics example in OBEX, but I'm sure it's there...

Anyway, here it is.

pgbpsu
10-18-2011, 04:22 PM
I was hoping to build something like the attached figure (from LabVIEW). Maybe I'm better off building an interface on the prop to LabVIEW where the graphing, gauges, etc can be done. It would be nice for it to be a stand alone application. And I'd rather not deal with the licensing issues involved in labVIEW but I think it will be simpler and more flexible. I really don't know much about graphics on the prop other than looking at the object in the OBEX and reading the forums. I haven't actually worked with it myself.

Is something like the attached graphic possible? I know there's a gauge object but it's for TV and, not to denigrate the efforts of the individual who wrote it, I don't think it's clear enough and I suspect that's just the limit of the prop and TV. If the attached image isn't possible with the prop, that's fine I'll work the lab view side of things.

Thanks. Peter

Rayman
10-18-2011, 04:32 PM
If it weren't for the 32kB memory limit, you could do something like that. The example I posted above has one graphics window. You can actually have several graphics windows at the same time on your screen. But, I think they'd have to be small to keep from running out of memory...

pgbpsu
10-18-2011, 04:37 PM
Hi Rayman-

It seems like your card game for VGA might be a good starting point. I need some static text (which looks like you've already done) and then some text (current measurement info) that will update at several HZ. Then rather than display cards I would have a plot or two. If I can do this all on the prop I can live without the gauge I noted in previous post. I'll just turn that into a normal x-y graph. My info will need to update at around 10Hz. Because I know so little about the way VGA works, I figure I'd plot my points (as x-y) on my graph and then, rather than move all the points to the left or right every time a new data point is available, I'll replace the oldest point with a new one. Does the entire screen get redrawn each refresh, or can I simply update the display on a point-by-point basis?

If you read this and think "This guys doesn't know enough about VGA to pull this off", please say so. I was hoping an object already existed for this and I wouldn't have to get too far into the working of VGA to meet my needs. If that's not possible I'd rather figure that out now than spend lots of time fighting with it only to find it out later. I'm a learn by doing kind of person, but at the moment I'm not looking to learn all about VGA, just trying to get some data displayed.

Thanks,
Peter

Rayman
10-18-2011, 05:05 PM
You might also want to take a look at my "Visual Spin".

Cluso99
10-19-2011, 12:35 AM
pgdpsu: Your tiff file is actually a full graphics file because the text is really graphics here. If you want to do a whole screen of graphics, then apart from having sufficient hub ram for the graphics buffer, there should not be a problem.
If you really want half the screen to be text and half graphics, I don't think any of the above solutions do that, and the VGA driver is not one for the beginner to play with. Perhaps later when you understand pasm and the prop, then this could be tackled. It's not a huge deal and it would save on hub space.

Maybe its just time to get one of the VGA graphics demos running. BTW with the prop inbuilt font, there are some quite amazing effects that can be built just with text. There is a VGA demo of these in the obex (by Chip Gracey).

pgbpsu
10-19-2011, 03:39 AM
Do you want something like this? (http://forums.parallax.com/showthread.php?133599-Display-motor-RPM-with-large-digits-and-graph-on-VGA-demo)

Hi Peter Jakacki - I had a chance to try out your example. After commenting out some things I gave it a shot to see if I could get something that resembled the image you posted in your other thread. Unfortunately my monitor says: "H 26.7Khz V33.3Hz Input Signal Out of Range".

The archive Rayman posted below does work so I think my demo board and monitor are okay.

Peter Jakacki
10-19-2011, 04:03 AM
I frequently use 10Mhz crystals, did you change it to suit your hardware? (Line 238,239)