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. Potentially, the
15 peripheral clock signal might be generated and processed to make such a
16 signal.
17
18 Unlike the vga example, this example employs two DMA channels for pixel data
19 which are interleaved to investigate a potential remedy for the wide pixel
20 effect. Unfortunately, despite each channel contributing every other word (or
21 group of four pixels), the effect persists. However, the picture is perhaps
22 more stable than in the vga example.
23
24 Hardware Details
25 ================
26
27 The pin usage of this solution is documented below.
28
29 PIC32MX270F256B-50I/SP Pin Assignments
30 --------------------------------------
31
32 MCLR# 1 \/ 28
33 HSYNC/OC1/RA0 2 27
34 VSYNC/OC2/RA1 3 26 RB15/U1TX
35 D0/RB0 4 25 RB14
36 D1/RB1 5 24 RB13/U1RX
37 D2/RB2 6 23
38 D3/RB3 7 22 RB11/PGEC2
39 8 21 RB10/PGEC3
40 RA2 9 20
41 RA3 10 19
42 D4/RB4 11 18 RB9
43 12 17 RB8
44 13 16 RB7/D7
45 D5/RB5 14 15
46
47 Note that RB6 is not available on pin 15 on this device (it is needed for VBUS
48 unlike the MX170 variant).
49
50 UART Connections
51 ----------------
52
53 UART1 is exposed by the RB13 and RB15 pins.
54
55 Data Signal Routing
56 -------------------
57
58 For one bit of intensity, two bits per colour channel:
59
60 D7 -> 2200R -> I
61
62 I -> diode -> R
63 I -> diode -> G
64 I -> diode -> B
65
66 D6 (not connected)
67
68 D5 -> 470R -> R
69 D4 -> 1000R -> R
70 D3 -> 470R -> G
71 D2 -> 1000R -> G
72 D1 -> 470R -> B
73 D0 -> 1000R -> B
74
75 HSYNC -> HS
76 VSYNC -> VS
77
78 Output Socket Pinout
79 --------------------
80
81 5 (GND) 4 (NC) 3 (B) 2 (G) 1 (R)
82
83 10 (GND) 9 (NC) 8 (GND) 7 (GND) 6 (GND)
84
85 15 (NC) 14 (VS) 13 (HS) 12 (NC) 11 (NC)
86
87 Output Cable Pinout
88 -------------------
89
90 1 (R) 2 (G) 3 (B) 4 (NC) 5 (GND)
91
92 6 (GND) 7 (GND) 8 (GND) 9 (NC) 10 (GND)
93
94 11 (NC) 12 (NC) 13 (HS) 14 (VS) 15 (NC)
95
96 References
97 ----------
98
99 https://en.wikipedia.org/wiki/VGA_connector
100
101 http://papilio.cc/index.php?n=Papilio.VGAWing
102
103 http://lucidscience.com/pro-vga%20video%20generator-2.aspx
104
105 https://sites.google.com/site/h2obsession/CBM/C128/rgbi-to-vga