1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/docs/wiki/Examples--vga Sat May 04 22:54:18 2019 +0200
1.3 @@ -0,0 +1,100 @@
1.4 += VGA Output Example =
1.5 +
1.6 +This example demonstrates the generation of an analogue VGA signal from a
1.7 +PIC32 microcontroller using general output pins. It follows on from the work
1.8 +done in the VGAPIC32 project. The result is not entirely satisfactory:
1.9 +
1.10 + * Every fourth pixel is wider than the others, this apparently being an
1.11 + artefact of the DMA transfer mechanism.
1.12 +
1.13 +It might be possible to introduce some kind of delay and even out the pixel
1.14 +widths, but this has not been investigated with hardware. However, unlike the
1.15 +[[../vga-pmp|vga-pmp]] example, there is no accompanying signal to potentially
1.16 +orchestrate the staging of individual pixels at a slightly delayed rate.
1.17 +
1.18 +Attempts to introduce other remedies to the wide pixel problem have been made
1.19 +with the [[../vga-dual|vga-dual]] and [[../vga-timer|vga-timer]] examples.
1.20 +
1.21 +== Hardware Details ==
1.22 +
1.23 +The pin usage of this solution is documented below.
1.24 +
1.25 +=== PIC32MX270F256B-50I/SP Pin Assignments ===
1.26 +
1.27 +{{{
1.28 +MCLR# 1 \/ 28
1.29 +HSYNC/OC1/RA0 2 27
1.30 +VSYNC/OC2/RA1 3 26 RB15/U1TX
1.31 + D0/RB0 4 25 RB14
1.32 + D1/RB1 5 24 RB13/U1RX
1.33 + D2/RB2 6 23
1.34 + D3/RB3 7 22 RB11/PGEC2
1.35 + 8 21 RB10/PGEC3
1.36 + RA2 9 20
1.37 + RA3 10 19
1.38 + D4/RB4 11 18 RB9
1.39 + 12 17 RB8
1.40 + 13 16 RB7/D7
1.41 + D5/RB5 14 15
1.42 +}}}
1.43 +
1.44 +Note that RB6 is not available on pin 15 on this device (it is needed for VBUS
1.45 +unlike the MX170 variant).
1.46 +
1.47 +=== UART Connections ===
1.48 +
1.49 +UART1 is exposed by the RB13 and RB15 pins.
1.50 +
1.51 +=== Data Signal Routing ===
1.52 +
1.53 +For one bit of intensity, two bits per colour channel:
1.54 +
1.55 +{{{
1.56 +D7 -> 2200R -> I
1.57 +
1.58 +I -> diode -> R
1.59 +I -> diode -> G
1.60 +I -> diode -> B
1.61 +
1.62 +D6 (not connected)
1.63 +
1.64 +D5 -> 470R -> R
1.65 +D4 -> 1000R -> R
1.66 +D3 -> 470R -> G
1.67 +D2 -> 1000R -> G
1.68 +D1 -> 470R -> B
1.69 +D0 -> 1000R -> B
1.70 +
1.71 +HSYNC -> HS
1.72 +VSYNC -> VS
1.73 +}}}
1.74 +
1.75 +=== Output Socket Pinout ===
1.76 +
1.77 +{{{
1.78 +5 (GND) 4 (NC) 3 (B) 2 (G) 1 (R)
1.79 +
1.80 + 10 (GND) 9 (NC) 8 (GND) 7 (GND) 6 (GND)
1.81 +
1.82 +15 (NC) 14 (VS) 13 (HS) 12 (NC) 11 (NC)
1.83 +}}}
1.84 +
1.85 +=== Output Cable Pinout ===
1.86 +
1.87 +{{{
1.88 + 1 (R) 2 (G) 3 (B) 4 (NC) 5 (GND)
1.89 +
1.90 +6 (GND) 7 (GND) 8 (GND) 9 (NC) 10 (GND)
1.91 +
1.92 + 11 (NC) 12 (NC) 13 (HS) 14 (VS) 15 (NC)
1.93 +}}}
1.94 +
1.95 +== References ==
1.96 +
1.97 +https://en.wikipedia.org/wiki/VGA_connector
1.98 +
1.99 +http://papilio.cc/index.php?n=Papilio.VGAWing
1.100 +
1.101 +http://lucidscience.com/pro-vga%20video%20generator-2.aspx
1.102 +
1.103 +https://sites.google.com/site/h2obsession/CBM/C128/rgbi-to-vga