paul@46 | 1 | Introduction
|
paul@46 | 2 | ------------
|
paul@46 | 3 |
|
paul@46 | 4 | This example demonstrates the generation of an analogue VGA signal from a
|
paul@46 | 5 | PIC32 microcontroller using general output pins. It follows on from the work
|
paul@46 | 6 | done in the VGAPIC32 project. The result is not entirely satisfactory:
|
paul@46 | 7 |
|
paul@46 | 8 | * Every fourth pixel is wider than the others, this apparently being an
|
paul@46 | 9 | artefact of the DMA transfer mechanism.
|
paul@46 | 10 |
|
paul@46 | 11 | It might be possible to introduce some kind of delay and even out the pixel
|
paul@46 | 12 | widths, but this has not been investigated with hardware. However, unlike the
|
paul@46 | 13 | vga-pmp example, there is no accompanying signal to potentially orchestrate
|
paul@46 | 14 | the staging of individual pixels at a slightly delayed rate. Potentially, the
|
paul@46 | 15 | peripheral clock signal might be generated and processed to make such a
|
paul@46 | 16 | signal.
|
paul@46 | 17 |
|
paul@46 | 18 | Unlike the vga example, this example employs two DMA channels for pixel data
|
paul@46 | 19 | which are interleaved to investigate a potential remedy for the wide pixel
|
paul@46 | 20 | effect. Unfortunately, despite each channel contributing every other word (or
|
paul@46 | 21 | group of four pixels), the effect persists. However, the picture is perhaps
|
paul@46 | 22 | more stable than in the vga example.
|
paul@46 | 23 |
|
paul@89 | 24 | One significant problem with this example is that scrolling causes the DMA
|
paul@89 | 25 | channels to become ordered incorrectly. This does not affect the vga-timer
|
paul@89 | 26 | example which also employs two DMA channels.
|
paul@89 | 27 |
|
paul@46 | 28 | Hardware Details
|
paul@46 | 29 | ================
|
paul@46 | 30 |
|
paul@46 | 31 | The pin usage of this solution is documented below.
|
paul@46 | 32 |
|
paul@46 | 33 | PIC32MX270F256B-50I/SP Pin Assignments
|
paul@46 | 34 | --------------------------------------
|
paul@46 | 35 |
|
paul@46 | 36 | MCLR# 1 \/ 28
|
paul@46 | 37 | HSYNC/OC1/RA0 2 27
|
paul@46 | 38 | VSYNC/OC2/RA1 3 26 RB15/U1TX
|
paul@46 | 39 | D0/RB0 4 25 RB14
|
paul@46 | 40 | D1/RB1 5 24 RB13/U1RX
|
paul@46 | 41 | D2/RB2 6 23
|
paul@46 | 42 | D3/RB3 7 22 RB11/PGEC2
|
paul@46 | 43 | 8 21 RB10/PGEC3
|
paul@46 | 44 | RA2 9 20
|
paul@46 | 45 | RA3 10 19
|
paul@46 | 46 | D4/RB4 11 18 RB9
|
paul@46 | 47 | 12 17 RB8
|
paul@46 | 48 | 13 16 RB7/D7
|
paul@46 | 49 | D5/RB5 14 15
|
paul@46 | 50 |
|
paul@46 | 51 | Note that RB6 is not available on pin 15 on this device (it is needed for VBUS
|
paul@46 | 52 | unlike the MX170 variant).
|
paul@46 | 53 |
|
paul@46 | 54 | UART Connections
|
paul@46 | 55 | ----------------
|
paul@46 | 56 |
|
paul@46 | 57 | UART1 is exposed by the RB13 and RB15 pins.
|
paul@46 | 58 |
|
paul@46 | 59 | Data Signal Routing
|
paul@46 | 60 | -------------------
|
paul@46 | 61 |
|
paul@46 | 62 | For one bit of intensity, two bits per colour channel:
|
paul@46 | 63 |
|
paul@46 | 64 | D7 -> 2200R -> I
|
paul@46 | 65 |
|
paul@46 | 66 | I -> diode -> R
|
paul@46 | 67 | I -> diode -> G
|
paul@46 | 68 | I -> diode -> B
|
paul@46 | 69 |
|
paul@46 | 70 | D6 (not connected)
|
paul@46 | 71 |
|
paul@46 | 72 | D5 -> 470R -> R
|
paul@46 | 73 | D4 -> 1000R -> R
|
paul@46 | 74 | D3 -> 470R -> G
|
paul@46 | 75 | D2 -> 1000R -> G
|
paul@46 | 76 | D1 -> 470R -> B
|
paul@46 | 77 | D0 -> 1000R -> B
|
paul@46 | 78 |
|
paul@46 | 79 | HSYNC -> HS
|
paul@46 | 80 | VSYNC -> VS
|
paul@46 | 81 |
|
paul@46 | 82 | Output Socket Pinout
|
paul@46 | 83 | --------------------
|
paul@46 | 84 |
|
paul@46 | 85 | 5 (GND) 4 (NC) 3 (B) 2 (G) 1 (R)
|
paul@46 | 86 |
|
paul@46 | 87 | 10 (GND) 9 (NC) 8 (GND) 7 (GND) 6 (GND)
|
paul@46 | 88 |
|
paul@46 | 89 | 15 (NC) 14 (VS) 13 (HS) 12 (NC) 11 (NC)
|
paul@46 | 90 |
|
paul@46 | 91 | Output Cable Pinout
|
paul@46 | 92 | -------------------
|
paul@46 | 93 |
|
paul@46 | 94 | 1 (R) 2 (G) 3 (B) 4 (NC) 5 (GND)
|
paul@46 | 95 |
|
paul@46 | 96 | 6 (GND) 7 (GND) 8 (GND) 9 (NC) 10 (GND)
|
paul@46 | 97 |
|
paul@46 | 98 | 11 (NC) 12 (NC) 13 (HS) 14 (VS) 15 (NC)
|
paul@46 | 99 |
|
paul@46 | 100 | References
|
paul@46 | 101 | ----------
|
paul@46 | 102 |
|
paul@46 | 103 | https://en.wikipedia.org/wiki/VGA_connector
|
paul@46 | 104 |
|
paul@46 | 105 | http://papilio.cc/index.php?n=Papilio.VGAWing
|
paul@46 | 106 |
|
paul@46 | 107 | http://lucidscience.com/pro-vga%20video%20generator-2.aspx
|
paul@46 | 108 |
|
paul@46 | 109 | https://sites.google.com/site/h2obsession/CBM/C128/rgbi-to-vga
|