Shop OBEX P1 Docs P2 Docs Learn Events
Hard-Coded VGA_text Demo, Tiny + Educational — Parallax Forums

Hard-Coded VGA_text Demo, Tiny + Educational

localrogerlocalroger Posts: 3,452
edited 2011-01-05 13:04 in Propeller 1
I recently needed to convert a TV driver I wrote some time back to VGA. I tried using VGA_Learn as a template but it wouldn't always sync my monitor, and small changes would cause it to quit working for reasons I didn't understand. And all the weird calculations at the end of the Parallax VGA.spin left me scratching my head.

So what is attached is a version of the VGA_text_demo which eliminates all those calculations and is entirely hard coded for 640x480 with all default options. This makes it over 600 bytes smaller and much simpler both to interface and understand. I created this by adding debug code to Chip's version which reported the results of all those calculations to a separate display (nice that demoboards have both TV and VGA outputs) and replaced the calculations with hard settings to those values. Then I optimized what was left a bit.

I have more work to do to get the driver I really need, but as-is this is both very small for limited RAM situations and a nice template for understanding how a robust VGA driver actually works, so I thought someone might find it useful.

Comments

  • SapiehaSapieha Posts: 2,964
    edited 2011-01-05 11:29
    Hi localroger.

    Have You tested this even with 6.25MHz crystal?
  • localrogerlocalroger Posts: 3,452
    edited 2011-01-05 11:33
    No, this is completely hard-coded for 80 MHz. Now that the logic is worked out it would be pretty straightforward to throw some debug WRLONGs into Chip's original version again to spit out the different values for the various magic numbers.
  • SapiehaSapieha Posts: 2,964
    edited 2011-01-05 11:40
    Hi localroger


    If You give that try. Build one for 6.25 and one for 14.318.180MHz PLLx8.


    localroger wrote: »
    No, this is completely hard-coded for 80 MHz. Now that the logic is worked out it would be pretty straightforward to throw some debug WRLONGs into Chip's original version again to spit out the different values for the various magic numbers.
  • localrogerlocalroger Posts: 3,452
    edited 2011-01-05 11:51
    Update -- just for giggles I tried this version with a 6.25 MHz crystal in my DemoBoard, and my VGA input LCD does sync to it.
  • SapiehaSapieha Posts: 2,964
    edited 2011-01-05 12:06
    Hi localroger.

    Most of VGA drivers I used needed some adjustments to Blanking timings.


    localroger wrote: »
    Update -- just for giggles I tried this version with a 6.25 MHz crystal in my DemoBoard, and my VGA input LCD does sync to it.
  • localrogerlocalroger Posts: 3,452
    edited 2011-01-05 13:04
    I'm sure it depends on the monitor, and this is a brand new 7 inch headrest LCD. It did notice that the timing had changed and went through a bit of "auto-adjust" jiggering, but in the end it synced. Considering that this is the original VGA timing at 60 Hz to start with, the speedup going to 6.25 MHz will only be taking it to 75 Hz, which is pretty close to a standard update rate.
Sign In or Register to comment.