1 Introduction
2 ------------
3
4 The BlinkPIC32 project provides software and circuit information to
5 demonstrate a trivial LED-blinking application using a PIC32 microcontroller,
6 in particular one with a DIP-28 profile that can be set up on a breadboard.
7
8 Contact, Copyright and Licence Information
9 ------------------------------------------
10
11 The author can be contacted at the following e-mail address:
12
13 paul@boddie.org.uk
14
15 Copyright and licence information can be found in the docs directory - see
16 docs/COPYING.txt and docs/gpl-3.0.txt for more information.
17
18
19
20 Using the Software
21 ==================
22
23 The software to be transferred to the microcontroller can be built as follows:
24
25 make
26
27 This should produce a file called blink.hex that can then be transferred to the
28 device. This will toggle an output that can be connected to a light-emitting
29 diode (LED) to demonstrate the operation of the program.
30
31
32
33 Hardware Details
34 ================
35
36 The following pinout provides a summary of the pertinent functions associated
37 with the pins on the microcontroller.
38
39 PIC32MX270F256B-50I/SP Pinout
40 -----------------------------
41
42 5 MCLR# 1 \/ 28 AVDD
43 cap RA0 2 27 AVSS
44 cap RA1 3 26 RB15 ap
45 cap PGED1/RB0 4 25 RB14 a
46 cap PGEC1/RB1 5 24 RB13 ap
47 cap RB2 6 23 VUSB3V3
48 cap RB3 7 22 RB11/PGEC2
49 VSS 8 21 RB10/PGED2
50 c RA2 9 20 VCAP
51 cp RA3 10 19 VSS
52 c RB4 11 18 RB9/TDO 5cp
53 cp RA4 12 17 RB8/TCK 5cp
54 VDD 13 16 RB7/TDI 5cp
55 5c TMS/RB5 14 15 VBUS 5
56
57 default pin supply limitation of -0.3V to VDD + 0.3V
58 5 = 5V-tolerant pin with supply limitation of -0.3V to 5.5V if VDD >= 2.3V
59 a = analogue/digital pin
60 c = permit change notification configuration
61 p = parallel master/slave port pin
62
63 Thus, there should be up to 5 5V-tolerant I/O pins.
64
65 The microcontroller can be set up to function normally in a breadboard circuit
66 and also be connected up to a programming circuit at the same time. This
67 permits immediate feedback about the programming of the device without the
68 need to connect and disconnect the programmer.
69
70
71
72 Breadboard Circuit
73 ==================
74
75 In order to be programmed and to function normally, the device needs to be
76 deployed in a circuit configured as follows:
77
78 PIC32MX270F256B-50I/SP
79 ----------------------
80 MCLR# 3.3V (via 10K pull-up resistor)
81 VSS GND
82 VDD 3.3V
83 VSS GND
84 VCAP GND (via 10µF capacitor)
85 VUSB3V3 3.3V
86 AVSS GND
87 AVDD 3.3V
88
89 "Figure 2-1: Recommended Minimum Connection" from the "PIC32MX1XX/2XX
90 28/36/44-pin Family Data Sheet" stipulates additional 0.1µF ceramic capacitors
91 between VDD and VSS and between AVDD and AVSS.
92
93
94
95 Demonstration Circuit
96 =====================
97
98 To test the software payload, the RA3 pin should be connected to a LED in
99 series with a 100 ohm resistor, routing to GND.
100
101 PIC32MX270F256B-50I/SP
102 ----------------------
103 RA3 LED -> GND (via 100 ohm resistor)
104
105
106
107 ICSP Programming Circuit
108 ========================
109
110 To avoid limitations with JTAG programming and associated limitations it may
111 impose on pin usage, the ICSP mechanism needs to be employed instead. The
112 circuit should resemble the following:
113
114 PIC32MX270F256B-50I/SP Arduino
115 ---------------------- -------
116 MCLR# A0
117 PGEC1/PGEC2 A2 (pulled up via 2K2 resistor to 3.3V)
118 PGED1/PGED2 A1 (via 220ohm resistor, then pulled up via 2K2
119 resistor to 3.3V)
120
121 The pull-up from MCLR# to VDD can apparently be left in place.
122
123 The Pickle and Nanu Nanu software are used for programming:
124
125 https://wiki.kewl.org/dokuwiki/projects:pickle
126 https://wiki.kewl.org/dokuwiki/projects:nanu-nanu
127
128 Nanu Nanu can be deployed in the 5V-16M configuration on an Arduino
129 Duemilanove with an "open drain" or "sink" circuit as described above. Then,
130 the pload program provided by Pickle can be used to write the boot.hex file as
131 follows (as a sufficiently privileged user):
132
133 ./pload program /dev/ttyUSB0 blink.hex
134
135 Note that the Pickle configuration file (~/.pickle or ~/.pickle/config) will
136 need to have the port and baudrate settings defined. For example:
137
138 DEVICE=/dev/ttyUSB0
139 BAUDRATE=115200
140 DEBUG=1
141
142
143
144 References
145 ==========
146
147 Basic PIC32 breadboard circuit:
148
149 http://umassamherstm5.org/tech-tutorials/pic32-tutorials/pic32mx220-tutorials/pic32mx220-breadboard
150
151 ArduPIC32 JTAG-based programmer:
152
153 http://www.microchip.com/forums/m653443.aspx
154 https://code.google.com/archive/p/ardupic32/