+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 20 of 27

Thread: VGA 1600 x 1200 Tile Driver

  1. #1

    Default VGA 1600 x 1200 Tile Driver

    Well, it takes SIX cogs!! It pumps out pixels at 160MHz. Want a cursor? That'll take another cog. You'll have one left to do something with. I'll try to reduce the cog count later, but I wanted to get it running.

    It looks great on a CRT, but some LCD's have trouble syncing perfectly. CRT's are much more forgiving since they are analog and let the pixels land where they may. You may notice a slight sawtooth pattern on the edges of characters. It is only a fractional pixel in width and is caused by the 0 to ~2ns delay from the chained pin-output OR gates going through zero to five consecutive cogs, in sequence for consecutive scan lines.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  2. #2

    Default

    Chip,

    You just had to push it to the limit, 1600x1200, unreal:)
    But how do you get 160MHz from a 80Mhz micro?

    At the moment the number of colours is limited because you are only using 2 pins each for RGB.
    What resolution can you get if you use 3 pins or 4 pins for each RGB and how many colours, 512, 4096?
    At 3 x 5 bits-32768 colours this would be good for displaying pictures, lose 11, 14, 17 I/O pins?

    Gavin
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  3. #3

    Default

    The cog hardware handles shifting the out of pixels to the relevant pins, so a single WAITVID assembly language instruction provides the hardware with enough data for 16 four colour or 32 two colour pixels.

    Its' still bloody impressive though.
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  4. #4

    Default

    Chip, I am using an Envision 17" LCD monitor and the display is razor-sharp.

    Sid



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  5. #5

    Default

    Oh, and the way to work out how may colours you can have is to raise 2 to the power of however many bits you have in total. So 3 bits per colour is a total of 9 bits which would be 2^9 = 512, 4 would give a total of 12, which would be 2^12 = 4096 etc.

    From an external hardware point of view increasing the number of colours is simply a case of adding a few resistors and changing the values of the existing ones, but the standard cog hardware will only output 2 bits per colour component, so you'd need to have several cogs running in sync outputting to different sets of pins. You could then get 4 bits per component with two cogs (4096 colours), 6 with three cogs (262144 colours), and the maximum would be 8 bits per component from four cogs giving 16777216, but there'd be no pins left for anything else, as you'd also have four sets of horizontal and vertical sync lines coming out of each cog as well.
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  6. #6

    Default

    If I remove my keyboard and plug in a mouse, then click on a Menu option, would I get the same result as entering the option from the keyboard?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  7. #7

    Default

    Newzed said...

    If I remove my keyboard and plug in a mouse, then click on a Menu option, would I get the same result as entering the option from the keyboard?

    Sid

    I think you are referring to that stuff on the screen, which is inert. It just shows what could be done. Those 3D buttons don't actually do anything. I wish it would let you edit and compile, though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  8. #8

    Default

    The limitation on colors can be gotten around by having more cogs work in parallel. Each cog's video shifter outputs up to 8 bits simultaneously, that are locked to the CTRA's PLL. By having two cogs output in parallel for example, you could expand that front to 16 bits and then reallocate the R, G, and B signals to have more bits, and more resistors. The video shifter doesn't know anything, other than it is outputting 8 bits. That bit0is tied to V and bit1 tied toH is completely a software issue, as are the 2-bits each for R, G, and B. All the video shifters do is update up to 8 pins synchronously to CTRA's PLL, that's all. It's quite agnostic relative to the specifics of what you're trying to do.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.

    Post Edited (Chip Gracey (Parallax)) : 11/23/2006 5:53:57 PM GMT
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  9. #9

    Default

    Gavin said...


    But how do you get 160MHz from a 80Mhz micro?
    Each cog has a video shifter which runs off its CTRA's PLL. The PLL is designed to run up to 160MHz across all temperature, voltage, and process extremes. The crazy thing is that at 160MHz (in two-bits per pixel mode), the shifter must be updated at 10MHz, or every 100ns. Those WAITVID instructions cost at least 6 cycles or 75ns, so 100 of themmust be executed back to back with no room for any instructions in between. To do this, the data must be ready in memory and the code goes like this:

    waitvid colors0,pixels0
    waitvid colors1,pixels1
    waitvid colors2,pixels2
    ...
    waitvid colors99,pixels99

    Whew!

    POST-EDITED FOR TIMING CORRECTNESS

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.

    Post Edited (Chip Gracey (Parallax)) : 11/25/2006 12:54:20 AM GMT
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  10. #10

    Default

    Tried this demo today and my screen displayed "Out of Range" I use an older Dell monitor with my Propeller, must not be up the the task of 1600x1200. I'll have to try it on my good monitor some other time.
    The other highres demo's lately have been great though!

    Brian
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  11. #11

    Default

    Chip, I've almost figured out the structure of the VGA longs - not 100% but almost.

    I firugured I wouldn't be using the box colors so I modified and substituted some of the first few longs. I now have white on maroon, white on orange and red on yellow. Still trying for the yellow on blue.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  12. #12

    Default

    Finally got my yellow font on a blue background!!. Now everything is
    dinky-dy.

    Sid



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  13. #13

    Default

    Chip, it appears that blue is the default color for the VGA screen. I have found another color - maroon - that I really like and would like to see what a maroon screen looks like. Can you tell me where the default screen color is called out so I can try to change it?

    Thanks

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  14. #14

    Default

    Never mind, Chip. I found the mask.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  15. #15

    Default

    Well.........I guess there is more to it than just changing the mask. I made a bunch of changes to it and all I could get was a black screen or "No signal". So how do I change the default color to maroon, please, sir?

    Thanks

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  16. #16

    Default

    Firstly, have a quick Google to find an introduction to VGA displays and signals, as you'll definitely need to understand how a VGA monitor works and which signals are involved before any of the marvellous video related things that the Propeller can do will make any sense. It's actually not that difficult to get to grips wtih, but it's essential that you do.

    As far as colours are concerned, the cog video hardware is very simple - all it does is set the eight output pins to one of the four bytes provided by the second argument in the WAITVID assembly instruction depending on the colour of the pixel being output at that time. As on the demoboard two of those eight pins are used for the horizontal and vertical sync lines which at a simplistic level essentially provide the structure of the picture itself, if your colour bytes have either of these bits set, and those colours are displayed anywhere on the screen, then your display will be garbled. In theory by feeding it screwy timing, you could damage your monitor, but most will handle dodgy signals in a sensible manner, blank the display, and maybe show a suitable message.
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  17. #17

    Default

    ciw1973, if that post was intended for me, I fail to see how greater knowledge of how a VGA works is going to help me. The means for doing what I want to do are buried somewhere in the assembly code, and since I don't understand assembly, I'm lost. I stumbled onto the mask just by accident. If you know how to change the screen to maroon from the default $FCFCFCFC, I would welcome any help.

    Sid



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  18. #18

    Default

    Newzed said...

    Chip, it appears that blue is the default color for the VGA screen. I have found another color - maroon - that I really like and would like to see what a maroon screen looks like. Can you tell me where the default screen color is called out so I can try to change it?

    Thanks

    Sid

    Sid,

    Sorry for the delay, but I was out of town and just got home. Everything you are talking about doing can be done in the top-level Spin file. You will see towards the end of the file that there is a color table. I believe that the first twolongsare used for the main background/foreground color combination. There are two longs, not just one, because those ROM font characters are interleaved and to pick one out, you will either have to use the even or odd bits within their pixel definitions. The first long always selects the even-bit colors and the second long always selects the odd-bit colors. To get a maroon background and a yellow foreground, you should set the first two longs to these values:

    $F044F044 'even-bits character's color: yellow on maroon

    $F0F04444 'odd-bits character's color: yellow on maroon

    If you read the documentation for the PUB 'start', you will get an explanation of this. To make a full-blown text printing, color selecting, print positioning object to set up the data for the tile driver, you only need to write spin code. That color_mask $FCFCFCFC you saw is used to clear the H and V bits for each of the four colors, so that in case some lousy data was passed with any non-color bits set, they won't cause any errant sync timing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  19. #19

    Default

    Chip, thanks to your example, I was able to figure out yellow on maroon. You had written:

    $F044_F044 'even-bits character's color: yellow on maroon(purple)
    $F0F0_4444 'odd-bits character's color: yellow on maroon(purple)

    which turned out to be yellow on purple. I changed it to:

    long $A040_A040 'yellow on maroon
    long $A0A0_4040

    With this knowledge, I was able to come up with five different "default" screen combinations. I haven't been able yet to figure out how to pre-determine what color combination to call.In the two groups above, they both call out a yellow font, but none of the four bytes are the same. So I just punch in different values and if I like what I get, I save it.

    Thanks again, Chip. Now the agony of deciding which combination I want to use.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

  20. #20

    Default

    Chip, what is the status of the addition you were going to make to the program that would allow me to position a line of text, similar to the
    "setxy(n,m)" instruction in Mike Green's OS program.

    Thanks

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    Last edited by ForumTools; 09-30-2010 at 02:13 PM. Reason: Forum Migration

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts