1 = VGA Output Example = 2 3 This example demonstrates the generation of an analogue VGA signal from a 4 PIC32 microcontroller using general output pins. It follows on from the work 5 done in the VGAPIC32 project. The result is not entirely satisfactory: 6 7 * Every fourth pixel is wider than the others, this apparently being an 8 artefact of the DMA transfer mechanism. 9 10 It might be possible to introduce some kind of delay and even out the pixel 11 widths, but this has not been investigated with hardware. However, unlike the 12 [[../vga-pmp|vga-pmp]] example, there is no accompanying signal to potentially 13 orchestrate the staging of individual pixels at a slightly delayed rate. 14 15 Attempts to introduce other remedies to the wide pixel problem have been made 16 with the [[../vga-dual|vga-dual]] and [[../vga-timer|vga-timer]] examples. 17 18 == Hardware Details == 19 20 The pin usage of this solution is documented below. 21 22 === PIC32MX270F256B-50I/SP Pin Assignments === 23 24 {{{ 25 MCLR# 1 \/ 28 26 HSYNC/OC1/RA0 2 27 27 VSYNC/OC2/RA1 3 26 RB15/U1TX 28 D0/RB0 4 25 RB14 29 D1/RB1 5 24 RB13/U1RX 30 D2/RB2 6 23 31 D3/RB3 7 22 RB11/PGEC2 32 8 21 RB10/PGEC3 33 RA2 9 20 34 RA3 10 19 35 D4/RB4 11 18 RB9 36 12 17 RB8 37 13 16 RB7/D7 38 D5/RB5 14 15 39 }}} 40 41 Note that RB6 is not available on pin 15 on this device (it is needed for VBUS 42 unlike the MX170 variant). 43 44 === UART Connections === 45 46 UART1 is exposed by the RB13 and RB15 pins. 47 48 === Data Signal Routing === 49 50 For one bit of intensity, two bits per colour channel: 51 52 {{{ 53 D7 -> 2200R -> I 54 55 I -> diode -> R 56 I -> diode -> G 57 I -> diode -> B 58 59 D6 (not connected) 60 61 D5 -> 470R -> R 62 D4 -> 1000R -> R 63 D3 -> 470R -> G 64 D2 -> 1000R -> G 65 D1 -> 470R -> B 66 D0 -> 1000R -> B 67 68 HSYNC -> HS 69 VSYNC -> VS 70 }}} 71 72 === Output Socket Pinout === 73 74 {{{ 75 5 (GND) 4 (NC) 3 (B) 2 (G) 1 (R) 76 77 10 (GND) 9 (NC) 8 (GND) 7 (GND) 6 (GND) 78 79 15 (NC) 14 (VS) 13 (HS) 12 (NC) 11 (NC) 80 }}} 81 82 === Output Cable Pinout === 83 84 {{{ 85 1 (R) 2 (G) 3 (B) 4 (NC) 5 (GND) 86 87 6 (GND) 7 (GND) 8 (GND) 9 (NC) 10 (GND) 88 89 11 (NC) 12 (NC) 13 (HS) 14 (VS) 15 (NC) 90 }}} 91 92 == References == 93 94 https://en.wikipedia.org/wiki/VGA_connector 95 96 http://papilio.cc/index.php?n=Papilio.VGAWing 97 98 http://lucidscience.com/pro-vga%20video%20generator-2.aspx 99 100 https://sites.google.com/site/h2obsession/CBM/C128/rgbi-to-vga