1 Introduction
2 ============
3
4 The CommonPIC32 distribution contains library code and examples demonstrating
5 various features and applications of MIPS-based products in the PIC32
6 microcontroller family. The following examples are provided:
7
8 demo A demonstration of an assortment of peripherals, changing pin
9 output levels (to turn LEDs on and off) and communicating using a
10 UART peripheral.
11
12 vga A collection of examples investigating approaches to provide an
13 vga-cpu analogue VGA signal, displaying the contents of the
14 vga-dual microcontroller's memory on a suitable display. Each example has
15 vga-pmp documentation describing its approach, benefits and limitations,
16 vga-timer but a summary is provided below.
17
18 To build each example, run a command of the following form in the top-level
19 directory of this distribution:
20
21 make -C examples/demo
22
23 Here, the demo example is built.
24
25 Although it should be possible to build different examples without cleaning
26 previous build artefacts, it can be useful to run a command of the following
27 form to start again with no build products:
28
29 make -C examples/demo clean
30
31 Deploying the software requires a suitable method of programming a PIC32
32 microcontroller. This is described below in the ICSP programming section.
33
34
35
36 Contact, Copyright and Licence Information
37 ==========================================
38
39 The author can be contacted at the following e-mail address:
40
41 paul@boddie.org.uk
42
43 Copyright and licence information can be found in the docs directory - see
44 docs/COPYING.txt and docs/gpl-3.0.txt for more information.
45
46
47
48 Breadboard Circuit
49 ==================
50
51 In order to be programmed and to function normally, the device needs to be
52 deployed in a circuit configured as follows:
53
54 PIC32MX270F256B-50I/SP
55 ----------------------
56 MCLR# 3.3V (via 10K pull-up resistor)
57 VSS GND
58 VDD 3.3V
59 VSS GND
60 VCAP GND (via 10µF capacitor)
61 VUSB3V3 3.3V
62 AVSS GND
63 AVDD 3.3V
64
65 "Figure 2-1: Recommended Minimum Connection" from the "PIC32MX1XX/2XX
66 28/36/44-pin Family Data Sheet" stipulates additional 0.1µF ceramic capacitors
67 between VDD and VSS and between AVDD and AVSS.
68
69
70
71 ICSP Programming Circuit
72 ========================
73
74 To avoid limitations with JTAG programming and being unable to enable
75 JTAG-associated pins for other uses, the ICSP mechanism needs to be employed
76 instead. The circuit should resemble the following:
77
78 PIC32MX270F256B-50I/SP Arduino
79 ---------------------- -------
80 MCLR# A0
81 PGEC1/PGEC2 A2 (pulled up via 2K2 resistor to 3.3V)
82 PGED1/PGED2 A1 (via 220ohm resistor, then pulled up via 2K2
83 resistor to 3.3V)
84
85 The pull-up from MCLR# to VDD can apparently be left in place.
86
87 The Pickle and Nanu Nanu software are used for programming:
88
89 https://wiki.kewl.org/dokuwiki/projects:pickle
90 https://wiki.kewl.org/dokuwiki/projects:nanu-nanu
91
92 Nanu Nanu can be deployed in the 5V-16M configuration on an Arduino
93 Duemilanove with an "open drain" or "sink" circuit as described above.
94 Typically, the following commands can be used to build and deploy Nanu Nanu to
95 the Arduino board:
96
97 make
98 make -f 5V-16M.mk 57600
99
100 The 5V-16M.mk file may need adjusting to use the appropriate UART device. Note
101 that the indicated baud rate of 57600 is specifically related to the default
102 Arduino bootloader's capabilities.
103
104 Pickle can be built using the familiar convention:
105
106 make
107 make install
108
109 The Makefile may need adjusting to indicate alternative installation locations
110 and file ownership, although it may also be possible to override the default
111 settings on the command line.
112
113 With both tools deployed, the pload program provided by Pickle can be used to
114 write the appropriate .hex file as in the following example (either as a
115 privileged user or with access to the serial device granted via the
116 appropriate group membership):
117
118 ./pload program /dev/ttyUSB0 examples/demo/demo.hex
119
120 Note that the Pickle configuration file (~/.pickle or ~/.pickle/config) will
121 need to have the baud rate setting defined. For example:
122
123 BAUDRATE=115200
124
125 This indicates the rate used to transfer data to the PIC32.
126
127
128
129 References
130 ==========
131
132 Basic PIC32 breadboard circuit:
133
134 http://umassamherstm5.org/tech-tutorials/pic32-tutorials/pic32mx220-tutorials/pic32mx220-breadboard