1.1 --- a/examples/vga-cpu/README.txt Thu May 02 23:21:32 2019 +0200
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,119 +0,0 @@
1.4 -Introduction
1.5 -------------
1.6 -
1.7 -This example demonstrates the generation of an analogue VGA signal from a
1.8 -PIC32 microcontroller using general output pins. Instead of using DMA, which
1.9 -was the focus of the VGAPIC32 project and is a central feature of the
1.10 -approaches demonstrated by other examples (vga, vga-dual, vga-pmp, vga-timer),
1.11 -here the CPU is given the task of transferring pixel data to the output pins.
1.12 -
1.13 -Instead of a timer interrupt condition initiating DMA transfers, the interrupt
1.14 -is handled and a routine invoked to issue the necessary load and store
1.15 -instructions in a loop. Otherwise, the use of the timer to generate sync
1.16 -pulses is as in the other examples and the general display state machine is
1.17 -largely the same.
1.18 -
1.19 -The resulting picture is more pleasing than that produced by most of the DMA
1.20 -examples in that the display pixels have consistent widths. Moreover, the
1.21 -pixels are also narrower than those produced by the vga-timer example. It is
1.22 -possible to generate a display with something approaching 200 pixels
1.23 -horizontally, with 160 pixels being demonstrated.
1.24 -
1.25 -However, the CPU now spends a lot of time occupied in an interrupt request
1.26 -handler generating pixels. This seems less elegant than using DMA, but in
1.27 -practice, the CPU may be effectively stalled where DMA transfers dominate
1.28 -access to the RAM. Even if, in such situations, the CPU may be able to access
1.29 -flash memory to load instructions, programs typically end up accessing RAM at
1.30 -some point, and this would effectively limit the concurrency within the
1.31 -system. Certainly, this approach seems to result in slower programs than the
1.32 -plain DMA-based approach.
1.33 -
1.34 -One potential advantage of this approach is in the flexibility that might be
1.35 -achieved by manipulating the pixel data. With DMA, data is transferred as it
1.36 -is found and is generally not transformed (although there are some features in
1.37 -the PIC32 DMA controller for certain kinds of data), whereas we might envisage
1.38 -supporting display modes employing fewer bits for the output signal, reducing
1.39 -the number of colours but also the size of the framebuffer.
1.40 -
1.41 -Hardware Details
1.42 -================
1.43 -
1.44 -The pin usage of this solution is documented below.
1.45 -
1.46 -PIC32MX270F256B-50I/SP Pin Assignments
1.47 ---------------------------------------
1.48 -
1.49 -MCLR# 1 \/ 28
1.50 -HSYNC/OC1/RA0 2 27
1.51 -VSYNC/OC2/RA1 3 26 RB15/U1TX
1.52 - D0/RB0 4 25 RB14
1.53 - D1/RB1 5 24 RB13/U1RX
1.54 - D2/RB2 6 23
1.55 - D3/RB3 7 22 RB11/PGEC2
1.56 - 8 21 RB10/PGEC3
1.57 - RA2 9 20
1.58 - RA3 10 19
1.59 - D4/RB4 11 18 RB9
1.60 - 12 17 RB8
1.61 - 13 16 RB7/D7
1.62 - D5/RB5 14 15
1.63 -
1.64 -Note that RB6 is not available on pin 15 on this device (it is needed for VBUS
1.65 -unlike the MX170 variant).
1.66 -
1.67 -UART Connections
1.68 -----------------
1.69 -
1.70 -UART1 is exposed by the RB13 and RB15 pins.
1.71 -
1.72 -Data Signal Routing
1.73 --------------------
1.74 -
1.75 -For one bit of intensity, two bits per colour channel:
1.76 -
1.77 -D7 -> 2200R -> I
1.78 -
1.79 -I -> diode -> R
1.80 -I -> diode -> G
1.81 -I -> diode -> B
1.82 -
1.83 -D6 (not connected)
1.84 -
1.85 -D5 -> 470R -> R
1.86 -D4 -> 1000R -> R
1.87 -D3 -> 470R -> G
1.88 -D2 -> 1000R -> G
1.89 -D1 -> 470R -> B
1.90 -D0 -> 1000R -> B
1.91 -
1.92 -HSYNC -> HS
1.93 -VSYNC -> VS
1.94 -
1.95 -Output Socket Pinout
1.96 ---------------------
1.97 -
1.98 - 5 (GND) 4 (NC) 3 (B) 2 (G) 1 (R)
1.99 -
1.100 - 10 (GND) 9 (NC) 8 (GND) 7 (GND) 6 (GND)
1.101 -
1.102 - 15 (NC) 14 (VS) 13 (HS) 12 (NC) 11 (NC)
1.103 -
1.104 -Output Cable Pinout
1.105 --------------------
1.106 -
1.107 - 1 (R) 2 (G) 3 (B) 4 (NC) 5 (GND)
1.108 -
1.109 - 6 (GND) 7 (GND) 8 (GND) 9 (NC) 10 (GND)
1.110 -
1.111 - 11 (NC) 12 (NC) 13 (HS) 14 (VS) 15 (NC)
1.112 -
1.113 -References
1.114 -----------
1.115 -
1.116 -https://en.wikipedia.org/wiki/VGA_connector
1.117 -
1.118 -http://papilio.cc/index.php?n=Papilio.VGAWing
1.119 -
1.120 -http://lucidscience.com/pro-vga%20video%20generator-2.aspx
1.121 -
1.122 -https://sites.google.com/site/h2obsession/CBM/C128/rgbi-to-vga