1 Introduction
2 ------------
3
4 This example demonstrates the generation of an analogue VGA signal from a
5 PIC32 microcontroller using the parallel mode (parallel master port, PMP)
6 peripheral. The result is not entirely satisfactory:
7
8 * Pixels are very narrow unless buffered using a flip-flop driven by the
9 peripheral, this being a characteristic of the way the peripheral works, it
10 normally being used to drive memory and display controllers.
11
12 * Introducing a flip-flop means that the final pixel from the pixel data
13 remains asserted and must be reset using a second DMA channel.
14
15 * Every fourth pixel is wider than the others, this apparently being an
16 artefact of the DMA transfer mechanism.
17
18 It might be possible introduce some kind of delay to the write strobe (PMWR)
19 and even out the pixel widths, but this has not been investigated.
20
21 It appears to be the case that the system and peripheral clock frequencies
22 need to be matched. In this example, a frequency of 48MHz has been chosen.
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 D7/PMD7/RA0 2 27
34 D6/PMD6/RA1 3 26 RB15/U1TX
35 D0/PMD0/RB0 4 25 RB14
36 D1/PMD1/RB1 5 24 RB13/(PMRD)/U1RX
37 D2/PMD2/RB2 6 23
38 PMWR/RB3 7 22 RB11/PGEC2
39 8 21 RB10/PGEC3
40 RA2 9 20
41 (PMA0)/RA3 10 19
42 HSYNC/OC1/RB4 11 18 RB9/PMD3/D3
43 12 17 RB8/PMD4/D4
44 13 16 RB7/PMD5/D5
45 VSYNC/OC2/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 A flip-flop is used to buffer the outputs:
59
60 Dn -> 74HC273:Dn
61 74HC273:Qn -> Qn
62 VCC -> 74HC273:MR#
63 PMWR -> 74HC273:CP
64
65 For two bits of intensity, two bits per colour channel:
66
67 Q7 -> 2200R -> I
68 Q6 -> 4700R -> I
69
70 I -> diode -> R
71 I -> diode -> G
72 I -> diode -> B
73
74 Q5 -> 470R -> R
75 Q4 -> 1000R -> R
76 Q3 -> 470R -> G
77 Q2 -> 1000R -> G
78 Q1 -> 470R -> B
79 Q0 -> 1000R -> B
80
81 HSYNC -> HS
82 VSYNC -> VS
83
84 Output Socket Pinout
85 --------------------
86
87 5 (GND) 4 (NC) 3 (B) 2 (G) 1 (R)
88
89 10 (GND) 9 (NC) 8 (GND) 7 (GND) 6 (GND)
90
91 15 (NC) 14 (VS) 13 (HS) 12 (NC) 11 (NC)
92
93 Output Cable Pinout
94 -------------------
95
96 1 (R) 2 (G) 3 (B) 4 (NC) 5 (GND)
97
98 6 (GND) 7 (GND) 8 (GND) 9 (NC) 10 (GND)
99
100 11 (NC) 12 (NC) 13 (HS) 14 (VS) 15 (NC)
101
102 References
103 ----------
104
105 https://en.wikipedia.org/wiki/VGA_connector
106
107 http://papilio.cc/index.php?n=Papilio.VGAWing
108
109 http://lucidscience.com/pro-vga%20video%20generator-2.aspx
110
111 https://sites.google.com/site/h2obsession/CBM/C128/rgbi-to-vga