Shop OBEX P1 Docs P2 Docs Learn Events
Propeller user learning VGA programing for first time, need some guidance — Parallax Forums

Propeller user learning VGA programing for first time, need some guidance

Tony B.Tony B. Posts: 356
edited 2011-05-25 19:04 in Propeller 1
I was wondering if there other resources I may be missing from Parallax that can help me learn to write code for displaying text and graphics on a VGA monitor. I am completely new to this type of coding though I have been using the Propeller chip for my robots for some time. I have the following equipment and downloads already and have read the Propeller manual, syntax guide, and the PE Labs book.
1. Demo Board
2. VGA Monitor
3. PS/2 keyboard and mouse
4. Full Hydra Manual – Just download not read
5. VGA demo code By Chip Gracey from OBEX
Other than studying the available code, a method I have used in the past to learn new things, and possibly reading the Hydra manual what other helps do you all suggest.
Thanks,
Tony

Comments

  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-05-15 18:04
    There is a bunch of information on VGA all over the place. The trouble is most of it is not helpful with the Prop. You may have a look at the Lucid Science VGA video generator at http://www.lucidscience.com/pro-vga%20video%20generator-1.aspx Maybe his info will be of some aid.
  • potatoheadpotatohead Posts: 10,261
    edited 2011-05-15 19:12
    It is helpful to sort out what your intended display is. We've got lots of display methods, each with trade-offs. Text? Graphics? Both? High Resolution, medium, low?
  • localrogerlocalroger Posts: 3,452
    edited 2011-05-15 19:21
    As potatohead says, you need to define your objectives. I spent the first few months of this year writing several VGA drivers because I saw that there was no blinking at the extra cost. (In small 7-inch land, you can get a TV monitor for $80 but VGA generally runs around $300.) But even in 7-inch land, VGA just looks a lot better. The problem is VGA also has a much, much higher dot rate than TV, which really pushes the Prop to its limits. There are some very clever solutions out there but they are all compromises. It's likely that if your app is possible at all, it will require a custom solution.
  • potatoheadpotatohead Posts: 10,261
    edited 2011-05-15 20:51
    If you don't have any objectives, make some!

    Working through some basic displays with the Parallax drivers is a great starting point. The HYDRA book you have is one of the better entry point references, IMHO. Those VGA / TV drivers are capable of a lot, and sometimes get passed over too quickly, IMHO. Start there.

    Your Prop tool download comes with basic TV and VGA drivers, along with a graphics library. It's pretty easy and fun to modify the simple programs included, and again, a whole lot is possible with those drivers.
  • Tony B.Tony B. Posts: 356
    edited 2011-05-16 05:56
    Thanks for all the replies!
    I would like to design an interactive industrial control interface for a project. How do I do that?
    Just kidding! I want to start out with the basics, you know, Hello World! I want to be able to put text on the screen, choose its placement, color, and style. Then move on to placing sensor data on the screen like you might do in PST when testing a robot or project. Again, I just want to learn the basics and grow from there. I have no problem putting effort into learning, just was wondering if I was missing a good Propeller focused tutorial or guide. Also, I wanted a post on the forums to be able to ask questions along the way because as all of you who have responded have shown, the forums are a great resource for help and encouragement!
    Thanks,
    Tony
  • RaymanRayman Posts: 14,877
    edited 2011-05-16 06:22
    I've got some tools on my website that might help...

    You could also try "VisualSpin", if you're brave :)
  • localrogerlocalroger Posts: 3,452
    edited 2011-05-16 07:08
    You can do an awful lot with the vga_text object which ships with the proptool by using colors and the Prop font drawing characters. I'd work with that first, then define objectives based on what you'd like to do that you can't. (which is, incidentally, pretty much what I did.)
  • RaymanRayman Posts: 14,877
    edited 2011-05-16 09:25
    Yes, can't argue with that, VGA_Text_Demo.spin is definitely the place to start...
    It comes with the Prop Tool in the Propeller Tool..\Examples\Library folder, in case you can't find it...

    Actually, now that I think about it, the Prop Tool should include an easy way to access the Library examples...
    Maybe as an item in the "File" menu...
  • Tony B.Tony B. Posts: 356
    edited 2011-05-16 10:13
    I’m a little embarrassed for not thinking to look in the Propeller Tool Library. I use Objects from it all the time. I guess since I have never worked with video I didn’t pay much attention to that class of Objects. Thanks to all for bringing them to my attention. I will begin working with the VGA_Text Object this evening. I’m sure there will be questions to follow.
    Thanks
    Tony
  • Tony B.Tony B. Posts: 356
    edited 2011-05-18 01:56
    I was looking at the new Parallax Semiconductor website and on the home page they had a link to a new Appnote AN004 GUI & Graphics Series — Getting Started with VGA and Terminal Output. I have read it and found it to be a great place to start. Thought others following this thread might like to review it. The Appnote with source code can be downloaded here: http://www.parallaxsemiconductor.com/an004

    Tony
  • Jorge PJorge P Posts: 385
    edited 2011-05-18 08:02
    For variouse File Formats, BSP trees, AVI, Colorspace, and Animation FAQs see ftp://rtfm.mit.edu/pub/usenet/news.answers/graphics/ lots of general info there. The faq's range in date from ~1991 to current.
  • Tony B.Tony B. Posts: 356
    edited 2011-05-25 17:41
    Making great progress with the provided demo "VGA Text Demo.spin" that comes with the Propeller tool. In working through it testing and playing with the code I am puzzled by a line of code in the PUB out(c) of the "VGA Text" object which is used by the demo which reads

    $00: wordfill(@screen, $220, screensize)

    I understand the wordfill part but where did the hex value $220 come from. It seems arbitrary to me though I know it isn't? It's to big to match ASCII codes correct? I know it paints a blue screen with no text and if I change the value I get a crazy white and blue pattern.
    Any help would be appreciated.
    Tony
  • kuronekokuroneko Posts: 3,623
    edited 2011-05-25 18:05
    Tony B. wrote: »
    I understand the wordfill part but where did the hex value $220 come from. It seems arbitrary to me though I know it isn't? It's to big to match ASCII codes correct? I know it paints a blue screen with no text and if I change the value I get a crazy white and blue pattern.
    Check the print(c) method and imagine printing a space character ($20). Have a look at what's stored in the relevant word location for said character.
  • Tony B.Tony B. Posts: 356
    edited 2011-05-25 18:33
    Kuroneko, thanks for your reponse.

    I follow the idea of printing a space character, but why wasn't $20 used instead of $220? I tried $20 and it worked fine.
    kuroneko wrote: »
    Have a look at what's stored in the relevant word location for said character.

    I'm not understanding what you are saying to do here.
  • kuronekokuroneko Posts: 3,623
    edited 2011-05-25 18:46
    Tony B. wrote: »
    I follow the idea of printing a space character, but why wasn't $20 used instead of $220? I tried $20 and it worked fine.
    I didn't dig too deep here as to why things are the way they are (see below).
    kuroneko wrote:
    Have a look at what's stored in the relevant word location for said character.
    Tony B. wrote: »
    I'm not understanding what you are saying to do here.
    PRI print(c)
    
      screen[row * cols + col] := (color << 1 + [COLOR="red"]c & 1[/COLOR]) << 10 + [COLOR="red"]$200[/COLOR] + [COLOR="red"]c & $FE[/COLOR]
      if ++col == cols
        newline
    
    Printing $20 will construct $0220 in the assignment above and store it in screen memory (combined colour/character info). I'm not sure as to the purpose of the fixed $0200 part but I believe there is an explanation out there. Anyway, $0220 - your original question - boils down to a space character written in colour 0.

    Update: The $0200 is essential for addressing (it looks really messy without it). Further digging reveals that this $0200 becomes the base address for the ROM font after being rotated left by #6 ($8000). The format of a character entry basically provides as much help to the PASM driver as possible.
  • Tony B.Tony B. Posts: 356
    edited 2011-05-25 19:04
    Thanks again. I've been working through the code with your information and was was coming back to post a question about if it was the color info, but you beat me to it.

    I guess I should say I get the idea of what is going on but still do fully understand the Print(c) PUB fully.

    Thanks,
    Tony
Sign In or Register to comment.