Shop OBEX P1 Docs P2 Docs Learn Events
How to add a VGA connector to the P2 Eval Board — Parallax Forums

How to add a VGA connector to the P2 Eval Board

I've had my P2 board for a couple of weeks now, and I really want to set it up to do VGA. I've seen some of the add-on boards that are being developed, but I think all I really need is a connector for the board, VGA connector, perf board and 6 wires. Has anybody done this? Where's a good place to get the connectors?
«1

Comments

  • TubularTubular Posts: 4,702
    edited 2019-01-08 12:24
    The other quick option is to cut a vga monitor cable in half, and just solder those 6 wires (including multiple grounds though) to a female header than plus into the male P2 Eval header

  • I use the old VGA breakout board from Parallax. It does not seem to be available any more from Parallax.

    There is this breakout board from Amazon.

    You will also need an IDC cable and wire to wire it up.
  • I looked through my box of old computer stuff, and found a couple of 6-foot VGA cables. So I'll just cut the end off of one of the cables and solder it to a 12-pin header like Tubular suggested. I'll run by Fry's this morning to see if I can find a header. If not, I'll have to order some.
  • @ke4pjw, info on the "Parallax VGA PS/2 Adapter Board Kit" can also be found at https://www.parallax.com/product/28075
    Below is a picture of the schematic for the "Parallax VGA PS/2 Adapter Board Kit".
    Are you using resistors R1 to R8, as shown on the schematic when you attach it to the P2?
    Looks like I need to connect 10 wires to the P2-Eval Board, is that correct?
    What specific pins are you connecting to on the P2-Eval Board?
    28075-VGA-PS2-Adapter-Board-A-Schematic.jpg
  • The add-on boards that I've seen for the P2 connect directly from the header to the VGA connector without resistors. Does anybody have a schematic showing how the pins should be connected?
  • Just as you see the VGA connector in that P1 schematic but you don't need resistors since the DACs are built into the P2.

    P0 --> HSYNC = 13
    P1 --> BLUE = 3
    P2 --> GREEN = 2
    P3 --> RED = 1
    P4 --> VSYNCH = 14
    GNDs --> 5,6,7,8,10
  • Just as you see the VGA connector in that P1 schematic but you don't need resistors since the DACs are built into the P2.

    P0 --> HSYNC = 13
    P1 --> BLUE = 3
    P2 --> GREEN = 2
    P3 --> RED = 1
    P4 --> VSYNCH = 14
    GNDs --> 5,6,7,8,10

    What about "5V", does it get connected from the "VGA Connector" to the "P2-Eval Board"?
  • Dave HeinDave Hein Posts: 6,347
    edited 2019-01-08 15:35
    I'm going to hazard a guess, and say NOOO! You do not need or want a 5V power source on the VGA cable.

    I found a diagram showing the pin number of the VGA connector on Wikipedia. I'm sure there are many such diagrams on the internet. So I think I have everything I need to make the cable. I found a couple of 6-pin single row headers in one of my junk boxes. (I have many junk boxes, and it happen to be in the first one I looked at.) So if I can't find a dual-row 12-pin header at Fry's I just glue the two single row headers together and go with that.
  • RaymanRayman Posts: 14,646
    Here's how I did it. The P1 Demo board has 5V going to VGA. Tells the monitor there is a connection...
    751 x 676 - 9K
  • ke4pjwke4pjw Posts: 1,155
    edited 2019-01-08 15:39
    I haven't noticed any issues that the resistors cause. I did notice the video is brighter when plugged into R,G,B-1 as opposed to R,G,B-0. I tossed around the idea of paralleling them, just to lower the resistance, but the video seems fine to me. The board is what I had on hand, so I used it.
  • Really, the monitor needs the 5V? It seems like it might be a good idea to add a series resistor to the 5 volts, but that's just me being concerned about running power on the cable.
  • marsman2020marsman2020 Posts: 71
    edited 2019-01-08 16:53
    Older breakouts with the resistors may work at a reduced brightness level, but the resistors on RGB are 100% not needed with the P2 DAC setup.
  • RaymanRayman Posts: 14,646
    I think it does need 5V, maybe 3.3V would work, haven't tried lately...
    Resistor should work, to be safer.
    But, the P1 Demo board just came straight with no resistor...
  • Dave Hein wrote: »
    Really, the monitor needs the 5V? It seems like it might be a good idea to add a series resistor to the 5 volts, but that's just me being concerned about running power on the cable.

    I didn't need it for my monitor. I would say typically you won't need it. Based on my research for adding a VGA monitor to my CoCo 3, 5V is needed by some older monitors.
  • You don't need +5V since this is meant to be an optional output and neither do you need the I2C signals either which are used for PnP on pins 15 and 12 (just saying).
  • RaymanRayman Posts: 14,646
    I have seen monitors that wouldn't work without the 5V. But, it's been a long time since I've tried not using it...
  • I will have to try the VGA / DAC hookup, sounds simple enough. What VGA driver software is everyone using?
  • RaymanRayman Posts: 14,646
    edited 2019-01-08 17:15
    I posted Chip's VGA examples, modified for eval board, in this forum somewhere...
  • F-F breadboard jumper wires from the board to a VGA cable work, too, at least to get something working.
  • There are boot images for TAQOZ that fire up the VGA. Just type P2PC from the console to enable VGA text output in parallel with the serial console. You can also draw lines and filled panels and view bmp files or create your own drawing routines. Much more interactive fun. If you have a ps/2 keyboard you can use that too.
  • There are boot images for TAQOZ that fire up the VGA. Just type P2PC from the console to enable VGA text output in parallel with the serial console. You can also draw lines and filled panels and view bmp files or create your own drawing routines. Much more interactive fun. If you have a ps/2 keyboard you can use that too.

    Well, I know what I'm doing tonight :) Awesome stuff Peter!
  • There are boot images for TAQOZ that fire up the VGA. Just type P2PC from the console to enable VGA text output in parallel with the serial console. You can also draw lines and filled panels and view bmp files or create your own drawing routines. Much more interactive fun. If you have a ps/2 keyboard you can use that too.

    I am a fan of FORTH for many years. I need to know which pin on the P2-ES is the base pin for VGA. Or is there a word to change the base pin?

    BTW, I have read your documentation, just haven't had any comments to share.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2019-01-08 23:17
    These are the default pins:
    I/O     SIGNAL      VGA PIN
    P0      HSYNC       13
    P1      BLUE        3
    P2      GREEN       2
    P3      RED         1
    P4      VSYNCH      14
    GND                 5,6,7,8,10
    

    The config block in low memory can be edited and saved back on _BOOT_P2.BIX either as a complete MAKEBOOT or just write the first sector.
    0001c 007 0001c200 _BAUD		long	baud_rate
    00020 008 03020100 _VGACFG		long	vgapins			' VGA CONFIG '
    00024 009 00000004 		long	vspin
    00028 00a 000088d0 _VGAINIT	long	@vgainit		' VGA code '
    0002c 00b 00000607 _KBCFG		long	kbpins
    

    So to change the VGA pins say to P8 we would do this ( with comments ):
    ---  R  G  B  H          V
        &11.10.09.08 $2O !   12 $24 !
        MAKEBOOT
    
    Next time you reboot it will use those pins instead (hit reset or type REBOOT)
  • Rayman wrote: »
    I posted Chip's VGA examples, modified for eval board, in this forum somewhere...

    Rayman, can you try to find those VGA examples? I tried some of the code you posted, but I couldn't get it to work. What changes are needed to Chip's VGA examples to get them to work on the eval board?
  • RaymanRayman Posts: 14,646
    edited 2019-01-09 00:52
    I think this is them:
  • Dave Hein wrote: »
    I've had my P2 board for a couple of weeks now, and I really want to set it up to do VGA. I've seen some of the add-on boards that are being developed, but I think all I really need is a connector for the board, VGA connector, perf board and 6 wires. Has anybody done this? Where's a good place to get the connectors?
    There's a male version of the following terminal breakout for VGA on Amazon: https://amazon.com/D-SUB-Female-Terminal-Breakout-Connectors/dp/B014L8ROMS/ref=sr_1_2?ie=UTF8&qid=1546997729&sr=8-2&keywords=D-SUB%2BDB15%2BVGA%2BMale%2B3Row%2B15Pin%2Bto%2BTerminal%2BBreakout%2BBoard%2BConnectors&th=1

    dgately
  • Rayman, thanks for posting the modified VGA examples. They both work. I was able to solder a VGA cable to the headers, and the cable is working fine. It is a bit delicate, and I have to be careful not to put any strain on the wires soldered to the headers.

    Thanks to everybody for their suggestions on how to connect to a VGA monitor. Hopefully, this thread will help others get connected as well.
  • Great that its working.

    I think we've all got fairly 'proto' vga wiring setups, looking forward to those nicer breakouts from Parallax soon

  • Dave HeinDave Hein Posts: 6,347
    edited 2019-01-09 15:07
    I was looking at the parameters used to set up the clock for the VGA examples, and I wondering how some of the values are determined. The code looks like this:
      _XTALFREQ     = 20_000_000                                    ' crystal frequency
      _XDIV         = 10                                            ' crystal divider to give 1MHz
      _XMUL         = 125                                          ' crystal / div * mul
      _XDIVP        = 1                                             ' crystal / div * mul /divp to give _CLKFREQ (1,2,4..30)
      _XOSC         = %10                                  'OSC    ' %00=OFF, %01=OSC, %10=15pF, %11=30pF
      _XSEL         = %11                                   'XI+PLL ' %00=rcfast(20+MHz), %01=rcslow(~20KHz), %10=XI(5ms), %11=XI+PLL(10ms)
      _XPPPP        = ((_XDIVP>>1) + 15) & $F                       ' 1->15, 2->0, 4->1, 6->2...30->14
      _CLOCKFREQ    = _XTALFREQ / _XDIV * _XMUL / _XDIVP            ' internal clock frequency                
      _SETFREQ      = 1<<24 + (_XDIV-1)<<18 + (_XMUL-1)<<8 + _XPPPP<<4 + _XOSC<<2  ' %0000_000e_dddddd_mmmmmmmmmm_pppp_cc_00  ' setup  oscillator
      _ENAFREQ      = _SETFREQ + _XSEL                                             ' %0000_000e_dddddd_mmmmmmmmmm_pppp_cc_ss  ' enable oscillator
    
    How are the values of _XDIV, _XMUL and _XDIVP determined? Does _CLOCKFREQ/_XMUL have to be within a certain range?

    EDIT: So I see in the P2 documentation that the VCO frequency should be between 100 MHz and 400 MHz. However, the document also says between 100 MHz and 200 MHz. The VCO frequency is _XTALFREQ/_XDIV*_XMUL, so in the code above the VCO frequency is 250 MHz.
  • There is a great picture of the VGA connector along with the pin out info on the app Electrodroid.Sorry I don’t have it on the iPad to share it here. It shows the +5 on pin 9 with [key] in the column Origional VGA and the pin is labeled KEY/PWR.
    Jim
Sign In or Register to comment.