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