Shop OBEX P1 Docs P2 Docs Learn Events
Help with Vga bitmap output — Parallax Forums

Help with Vga bitmap output

Hello all,
I am new to the Propeller2 and have the P2 edge module and P2 Breadboard.
I would like a VGA bitmap output. I have tried the various text mode drivers and they all work but now I am trying the "VGA "640x480x8bpp – example driver by Chip Gracey" as found on the parallax website under "Quick Bytes"
it compiles ok but nothing is displayed and the monitor even goes into standby mode.
I have wired the vga as follows on the P2 side
0 = hsync
1 = blue
2 = green
3 = red
4 = vsync

i have chagned vsync to 4, but still nothing
Any ideas or more examples of a VGA bitmap driver?

Kind regards,
Fred

Comments

  • roglohrogloh Posts: 5,786
    edited 2021-04-18 02:13

    That example looks old now and designed for FPGAs. It is not setting up the PLL for a real P2.

    If you are using FlexProp take a look at the pong demo example that Reinhard did using my video driver. That sets up a bitmap in VGA resolution and draws to it.

    Link is here for final code:
    https://forums.parallax.com/discussion/comment/1501099/#Comment_1501099

  • Cluso99Cluso99 Posts: 18,069

    For your wiring you need to ensure the basepin is set to 0. IIRC it's set to 8.

  • Yeah it is setup to base pin 48 by default in that pong demo, so might be better to move it to port A. I think the older driver code has an issue with the sync pins getting corrupted in port B using VGA. I found I needed to disable parallel output with VGA which had been inadvertently left on in the streamer commands. This is fixed in my newer (yet unreleased) driver version.

  • roglohrogloh Posts: 5,786
    edited 2021-04-18 05:35

    To get that original VGA FPGA 640x480x8bpp demo working on a Rev B P2 I found you need to do a bunch of things...

    1) setup a valid working P2 frequency in the PLL and setup the fclk value accordingly (eg. here's one for 250MHz)

    CON
      fclk      = 250_000_000.0
    

    and

    DAT org
    '
    '
    ' Setup
    '
            hubset  ##%1_000001_0000011000_1111_10_00       'config PLL, 20MHz/2*25*1 = 250MHz
            waitx   ##20_000_000 / 200                      'allow crystal+PLL 5ms to stabilize
            hubset  ##%1_000001_0000011000_1111_10_11       'switch to PLL
    

    2) enable the 4 video DAC output pins with dirh after the wrpin instruction:

            dirh    #3<<6 + 0
    

    3) setup the DAC mode to be 75 ohm 2Vpp output:

    dacmode     long    %0000_0000_000_1011100000000_01_00000_0
    

    4) enable the streamer command "e" bits:

    m_bs        long    $7F810000+16        'before sync
    m_sn        long    $7F810000+96        'sync
    m_bv        long    $7F810000+48        'before visible
    m_vi        long    $7F810000+640       'visible
    
    m_rf        long    $7F880000+640       'visible rlong 8bpp lut
    

    5) finally, ensure x is always zero initially before using it, by not relying on "x res 1", but with this instead:

    x           long    0 
    
  • Fred777Fred777 Posts: 19
    edited 2021-04-18 18:24

    Thanks @rogloh - the P2VIDEO driver works great! (I thought there might be a problem at first but my on-breadboard power supply was to weak for the P2... wow, hmm that P2 gets quite warm, do you guys use cooling?)

  • Thx. Personally I don't use cooling at room temps and generally drive the P2 around the 250-300MHz range without any noticeable issues. But I'm not always using all the COGs at 100%. At more total load or higher ambient temps you might like some cooling but I know others push it harder without it. It can reach over 350MHz but you'll need a good power supply and I suggest for that you might want to cool it then when multiple COGs are used. I've not yet seen any reports of anyone actually frying a P2 by overclocking/overheating it however so it will be interesting to hear if/when that happens.

Sign In or Register to comment.