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