Shop OBEX P1 Docs P2 Docs Learn Events
80 column VGA text driver in one cog - 60/48/40/32/30/24/20...rows! (beta test) — Parallax Forums

80 column VGA text driver in one cog - 60/48/40/32/30/24/20...rows! (beta test)

Bill HenningBill Henning Posts: 6,445
edited 2012-02-23 12:01 in Propeller 1
80 column VGA text driver in one cog - 60/48/40/32/30/24/20...rows! (beta test)

This is the third driver in my high resolution, single cog flexible VGA text driver series.

MikronautsVGA80 - 80 column driver, requires 6.25MHz crystal for 100MHz prop clock speed

(It would also work at 150MHz)

As far as a monitor is concerned, it is VESA 640x480 60Hz timing.

(runs at 25MHz dot clock instead of 25.175, but that is within the tolerance of monitors)

I added VGA_Text like methods, so it should be a drop in replacement (except for palette handling).

The archive contains five fonts, and the number of times each scan line is displayed can be set in the driver, so this one driver provides the following text modes:

80x60, 80x48, 80x40, 80x32, 80x30, 80x24, 80x20
80x16, 80x15, 80x12, 80x10, 80x8, 80x6, 80x5

It is a regular "text mode" driver, and as such, uses one byte per character in the screen buffer.

The first 128 characters contain 32 graphic elements, then 96 ASCII characters, and the second 128 characters normally contain the inverse of the first 128 characters. The font is interleaved - this was the only way I could get the driver to work fast enough to get 50 columns!

Currently the horizontal timing is configured as:

hf = 16 'horizontal front porch pixels org 40
hs = 48 'horizontal sync pixels
hb = 96 'horizontal back porch pixels

because that works better with my test monitor.

The "official" VESA timing would be:

hf = 16 'horizontal front porch pixels org 40
hs = 96 'horizontal sync pixels
hb = 48 'horizontal back porch pixels

so if the default timing has issues with your monitor, try the official timing.

You may need to tweak hf/hs/hb to get the driver to work with your monitor.

I am MIT licensing the driver. Please don't change the file names so at least I get some exposure out of it

UPDATE:

I got kuroneko's patch integrated and working, it should now work without sync issues (famous last words, it is possible some monitors won't like the 59Hz refresh instead of 60Hz)

Comments

  • Bill HenningBill Henning Posts: 6,445
    edited 2011-04-23 12:39
    UPDATE:

    The version above, with frequent sync problems still works for me most of the time :)

    The version with kuroneko's fix does not sync for me yet - no idea why.

    I am working on it (now that I've sent all the PCB's for UPEW off to production)

    I will keep updating this thread with my progress.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2011-04-23 12:56
    Awesome! I've got to try this out on my monitor as soon as I find my 6.25Mhz Xtal. Thanks Bill!


    BTW I didn't know there was a process of "MIT licensing", I just thought you pasted the license at the foot of your code. Shows what I know...
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-04-23 13:15
    You are welcome!

    The process is... sticking the license at the end, and saying "MIT licensed" on top, so you were basically correct :)

    Don't be too surprised if it does not work for you yet, but I am sure that it will be fixed soon.
    Awesome! I've got to try this out on my monitor as soon as I find my 6.25Mhz Xtal. Thanks Bill!


    BTW I didn't know there was a process of "MIT licensing", I just thought you pasted the license at the foot of your code. Shows what I know...
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-04-23 13:45
    Finally!

    Kuroneko's patch integrated, and now working with the 80 column driver!!!!!!!!!!!!!!!!!!!!

    New archive uploaded to the first post.

    Microcontrolled, this one should work for you :-)
  • ApteryxOzApteryxOz Posts: 17
    edited 2011-04-23 16:35
    Bill, could you please cast your eye over he thread: "[unsolved] VGA Connector - Prof. Dev. Board"

    Kind Regards
    ApteryxOz
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2011-04-23 17:21
    Oh, man! I really want to try this out, but I can't find my high-speed Xtal! I'll be digging through some more boxes and checking around the general clutter until I find it, I'll let you know once I get it working.

    Thanks,
    Microcontrolled
  • kuronekokuroneko Posts: 3,623
    edited 2011-04-23 17:27
    Kuroneko's patch integrated, and now working with the 80 column driver!!!!!!!!!!!!!!!!!!!!
    Integrated but not active. It evidently doesn't work here (6.5MHz demoboard). Or you simply sent the wrong driver (MikronautsVGA80_demo-bst-archive-110423-133917.zip).

    After activating it it does work.
    sub     href,#6
    
                            mov     vscl,[COLOR="red"]href[/COLOR]               'do horizontal back porch pixels
    
                            ...
    syncfix                 long    (hs + hb)[COLOR="red"]*4[/COLOR]
    
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2011-04-23 17:50
    Found my Xtal, but the demo doesn't seem to run. Hmm..... I get a lot of static on the VGA monitor, but that is about it. However, I think my Xtal is a 6.00Mhz Xtal instead of a 6.25Mhz.
  • AribaAriba Posts: 2,690
    edited 2011-04-23 21:44
    Here is a modified version for 6 MHz. Seems to works on my picky VGA monitor.

    Andy
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2011-04-24 04:37
    YES!!!!! THANKS A LOT! It works perfectly now. Very nice, especially for only one cog. This is a major improvement over the default hi-res text object, and I love the programmer-friendly VGA text commands that so many VGA objects lack!
  • RsadeikaRsadeika Posts: 3,837
    edited 2011-04-24 05:12
    I tried the latest VGA80 driver that Bill just provided, it does not work on my C3. I also tried the one kuroneko provided, that one works. I just ran it a couple of times,though, later on today today I will run it more, and see if it holds up. Thanks guys for the excellent driver(s).

    Not knowing a thing about this VGA stuff, why can't the VGA80 be run at 5MHz crystal? I am not trying to insult anybody, but just curious.

    Ray
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-04-24 07:20
    Rats! I knew I'd forget someting... I'll issue a new release shortly. Thanks for catching it!
    kuroneko wrote: »
    Integrated but not active. It evidently doesn't work here (6.5MHz demoboard). Or you simply sent the wrong driver (MikronautsVGA80_demo-bst-archive-110423-133917.zip).

    After activating it it does work.
    sub     href,#6
    
                            mov     vscl,[COLOR="red"]href[/COLOR]               'do horizontal back porch pixels
    
                            ...
    syncfix                 long    (hs + hb)[COLOR="red"]*4[/COLOR]
    
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-04-24 07:21
    I have to integrate the line kuroneko found that I forgot to add while updating the driver.

    I must have an incredibly forgiving monitor!
    Found my Xtal, but the demo doesn't seem to run. Hmm..... I get a lot of static on the VGA monitor, but that is about it. However, I think my Xtal is a 6.00Mhz Xtal instead of a 6.25Mhz.
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-04-24 07:23
    I am glad it now works for you!

    The whole reason I built the one cog drivers was to free up a cog. Part of my future "Save A Cog Foundation" (LOL)

    A 6Mhz crystal will work as long as your monitor can sync to a 57.2Hz Vsync.
    YES!!!!! THANKS A LOT! It works perfectly now. Very nice, especially for only one cog. This is a major improvement over the default hi-res text object, and I love the programmer-friendly VGA text commands that so many VGA objects lack!
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-04-24 07:29
    Very simple - with a 5Mhz crystal the dot clock would be 20Mhz instead of 25Mhz, which means a 47.7Hz vsync rate. Some LCD monitors may sync to this, but most won't.

    Just try it - if you are lucky, your LCD monitor will sync to it - however it is more likely that it won't.

    Your C3 should be able to run it fine with a 6.25MHz crystal, with the latest patches - but don't forget to do:

    dira[15]~~
    outa[15]~

    before vga.start, otherwise it cannot work.

    There is simply not enough hub bandwidth with a single cog to refresh the 640x480 VGA video at 60Hz with a single cog with a 5Mhz crystal - which is why Chip's drivers take two cogs. (well, I did figure out one theoretical way, but it needs the font to be kept in the cog, and cannot have graphics characters that touch ie vertical lines, I have not tested that driver yet)

    My drivers were meant to sync waitvid's to the hub cycle, which allows 640x480 @ 60Hz with my font table trick. The initial versions only synced some of the time, but kuroneko was kind enough to figure out and provide a patch that gave hard synced the VGA pixel clock to the hub cycles.
    Rsadeika wrote: »
    I tried the latest VGA80 driver that Bill just provided, it does not work on my C3. I also tried the one kuroneko provided, that one works. I just ran it a couple of times,though, later on today today I will run it more, and see if it holds up. Thanks guys for the excellent driver(s).

    Not knowing a thing about this VGA stuff, why can't the VGA80 be run at 5MHz crystal? I am not trying to insult anybody, but just curious.

    Ray
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2011-04-24 09:29
    @Bill: Well, I tried it on my old tube monitor that will take any input and it worked, not my super-picky LCD which doesn't take any Propeller VGA signals except the VGA text object. The modified code Ariba posted works great with my monitor. This is the object I've been looking for!
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-04-24 11:43
    Microcontrolled: I am glad you like it! Just imagine... if 100,000 people use this driver on just one propeller each, 100,000 cogs will be freed up!

    ALL:

    I've updated the archive in post#1, includes the line with the corrected calculation as per kuroneko's post :)
  • Heater.Heater. Posts: 21,230
    edited 2011-10-27 03:36
    Bill,

    I was trying to get VGA80 demo running on my TriBlade which happens to have a 6.5536MHz XTAL. installed. Is this likely to work?
    Also can we verify the pinout. The TriBlade has VGA pins from P8 upwards.
    So far there is no sign of output on my LCD monitor.
  • AleAle Posts: 2,363
    edited 2011-10-27 04:55
    I am with Heater on this, and wanted also to ask if it will work with the 6.5536 crystals, as I do not have any 6.25 (because I never bought them :( ), or 12.5 for that matter :(.
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-10-27 16:28
    Hi Heater, Ale!

    It should work with your 6.5536MHz xtal's, but will refresh at higher than 59Hz... you may need to play with the front/back/sync horiz/vert timings. A quick and dirty test is lie to the driver, run it configured for 6.25MHz, and it should display at roughly 62Hz, most monitors should sync to it.

    It should be easy to switch to work off P8-P15; just change the VCFG initializations; it is configured for P16-P23
  • kuronekokuroneko Posts: 3,623
    edited 2011-10-27 16:44
    A quick and dirty test is lie to the driver, run it configured for 6.25MHz, and it should display at roughly 62Hz, most monitors should sync to it.

    It should be easy to switch to work off P8-P15; just change the VCFG initializations; it is configured for P16-P23
    FWIW, I tested with 6.5MHz (didn't have anything else) and it worked out of the box. Pin configuration is based on a basepin so shouldn't be an issue.
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-10-27 16:47
    kuroneko wrote: »
    FWIW, I tested with 6.5MHz (didn't have anything else) and it worked out of the box. Pin configuration is based on a basepin so shouldn't be an issue.

    Thanks... good info.

    I have not looked at it so long I forgot I used basepin :)

    Now that I have Obex access again (Thanks Matt!) I'll post it there soon.
  • wb7076wb7076 Posts: 29
    edited 2012-02-22 13:07
    bill can this driver be modified to set color on a single character?
  • Bill HenningBill Henning Posts: 6,445
    edited 2012-02-23 12:01
    Sorry, no.

    There is not enough hub bandwidth.

    I might be able to do it with two cogs... or if I go back to my original ugly hack design that required at least one blank scan line between each character row - which makes vertical graphics lines, boxes, text-gui etc ugly. If there was about twice as much cog ram, I could do it as there is another hack that wastes memory... but not in 496 longs.
    wb7076 wrote: »
    bill can this driver be modified to set color on a single character?
Sign In or Register to comment.