Shop OBEX P1 Docs P2 Docs Learn Events
Simple VGA question — Parallax Forums

Simple VGA question

pgbpsupgbpsu Posts: 460
edited 2011-10-18 20:03 in Propeller 1
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.

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-10-17 19:57
    Do you want something like this?
  • pgbpsupgbpsu Posts: 460
    edited 2011-10-18 05:06
    Do you want something like this?

    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
  • RaymanRayman Posts: 14,865
    edited 2011-10-18 06:51
    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 JakackiPeter Jakacki Posts: 10,193
    edited 2011-10-18 06:56
    @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?
  • RaymanRayman Posts: 14,865
    edited 2011-10-18 07:29
    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....
  • RaymanRayman Posts: 14,865
    edited 2011-10-18 07:33
    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.
  • pgbpsupgbpsu Posts: 460
    edited 2011-10-18 08:22
    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
  • RaymanRayman Posts: 14,865
    edited 2011-10-18 08:32
    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...
  • pgbpsupgbpsu Posts: 460
    edited 2011-10-18 08:37
    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
  • RaymanRayman Posts: 14,865
    edited 2011-10-18 09:05
    You might also want to take a look at my "Visual Spin".
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-10-18 16:35
    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).
  • pgbpsupgbpsu Posts: 460
    edited 2011-10-18 19:39
    Do you want something like this?

    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 JakackiPeter Jakacki Posts: 10,193
    edited 2011-10-18 20:03
    I frequently use 10Mhz crystals, did you change it to suit your hardware? (Line 238,239)
Sign In or Register to comment.