1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/README.txt Mon Oct 15 21:59:18 2018 +0200
1.3 @@ -0,0 +1,154 @@
1.4 +Introduction
1.5 +------------
1.6 +
1.7 +The BlinkPIC32 project provides software and circuit information to
1.8 +demonstrate a trivial LED-blinking application using a PIC32 microcontroller,
1.9 +in particular one with a DIP-28 profile that can be set up on a breadboard.
1.10 +
1.11 +Contact, Copyright and Licence Information
1.12 +------------------------------------------
1.13 +
1.14 +The author can be contacted at the following e-mail address:
1.15 +
1.16 +paul@boddie.org.uk
1.17 +
1.18 +Copyright and licence information can be found in the docs directory - see
1.19 +docs/COPYING.txt and docs/gpl-3.0.txt for more information.
1.20 +
1.21 +
1.22 +
1.23 +Using the Software
1.24 +==================
1.25 +
1.26 +The software to be transferred to the microcontroller can be built as follows:
1.27 +
1.28 +make
1.29 +
1.30 +This should produce a file called blink.hex that can then be transferred to the
1.31 +device. This will toggle an output that can be connected to a light-emitting
1.32 +diode (LED) to demonstrate the operation of the program.
1.33 +
1.34 +
1.35 +
1.36 +Hardware Details
1.37 +================
1.38 +
1.39 +The following pinout provides a summary of the pertinent functions associated
1.40 +with the pins on the microcontroller.
1.41 +
1.42 +PIC32MX270F256B-50I/SP Pinout
1.43 +-----------------------------
1.44 +
1.45 + 5 MCLR# 1 \/ 28 AVDD
1.46 + cap RA0 2 27 AVSS
1.47 + cap RA1 3 26 RB15 ap
1.48 + cap PGED1/RB0 4 25 RB14 a
1.49 + cap PGEC1/RB1 5 24 RB13 ap
1.50 + cap RB2 6 23 VUSB3V3
1.51 + cap RB3 7 22 RB11/PGEC2
1.52 + VSS 8 21 RB10/PGED2
1.53 + c RA2 9 20 VCAP
1.54 + cp RA3 10 19 VSS
1.55 + c RB4 11 18 RB9/TDO 5cp
1.56 + cp RA4 12 17 RB8/TCK 5cp
1.57 + VDD 13 16 RB7/TDI 5cp
1.58 + 5c TMS/RB5 14 15 VBUS 5
1.59 +
1.60 + default pin supply limitation of -0.3V to VDD + 0.3V
1.61 +5 = 5V-tolerant pin with supply limitation of -0.3V to 5.5V if VDD >= 2.3V
1.62 +a = analogue/digital pin
1.63 +c = permit change notification configuration
1.64 +p = parallel master/slave port pin
1.65 +
1.66 +Thus, there should be up to 5 5V-tolerant I/O pins.
1.67 +
1.68 +The microcontroller can be set up to function normally in a breadboard circuit
1.69 +and also be connected up to a programming circuit at the same time. This
1.70 +permits immediate feedback about the programming of the device without the
1.71 +need to connect and disconnect the programmer.
1.72 +
1.73 +
1.74 +
1.75 +Breadboard Circuit
1.76 +==================
1.77 +
1.78 +In order to be programmed and to function normally, the device needs to be
1.79 +deployed in a circuit configured as follows:
1.80 +
1.81 +PIC32MX270F256B-50I/SP
1.82 +----------------------
1.83 +MCLR# 3.3V (via 10K pull-up resistor)
1.84 +VSS GND
1.85 +VDD 3.3V
1.86 +VSS GND
1.87 +VCAP GND (via 10µF capacitor)
1.88 +VUSB3V3 3.3V
1.89 +AVSS GND
1.90 +AVDD 3.3V
1.91 +
1.92 +"Figure 2-1: Recommended Minimum Connection" from the "PIC32MX1XX/2XX
1.93 +28/36/44-pin Family Data Sheet" stipulates additional 0.1µF ceramic capacitors
1.94 +between VDD and VSS and between AVDD and AVSS.
1.95 +
1.96 +
1.97 +
1.98 +Demonstration Circuit
1.99 +=====================
1.100 +
1.101 +To test the software payload, the RA3 pin should be connected to a LED in
1.102 +series with a 100 ohm resistor, routing to GND.
1.103 +
1.104 +PIC32MX270F256B-50I/SP
1.105 +----------------------
1.106 +RA3 LED -> GND (via 100 ohm resistor)
1.107 +
1.108 +
1.109 +
1.110 +ICSP Programming Circuit
1.111 +========================
1.112 +
1.113 +To avoid limitations with JTAG programming and associated limitations it may
1.114 +impose on pin usage, the ICSP mechanism needs to be employed instead. The
1.115 +circuit should resemble the following:
1.116 +
1.117 +PIC32MX270F256B-50I/SP Arduino
1.118 +---------------------- -------
1.119 +MCLR# A0
1.120 +PGEC1/PGEC2 A2 (pulled up via 2K2 resistor to 3.3V)
1.121 +PGED1/PGED2 A1 (via 220ohm resistor, then pulled up via 2K2
1.122 + resistor to 3.3V)
1.123 +
1.124 +The pull-up from MCLR# to VDD can apparently be left in place.
1.125 +
1.126 +The Pickle and Nanu Nanu software are used for programming:
1.127 +
1.128 +https://wiki.kewl.org/dokuwiki/projects:pickle
1.129 +https://wiki.kewl.org/dokuwiki/projects:nanu-nanu
1.130 +
1.131 +Nanu Nanu can be deployed in the 5V-16M configuration on an Arduino
1.132 +Duemilanove with an "open drain" or "sink" circuit as described above. Then,
1.133 +the pload program provided by Pickle can be used to write the boot.hex file as
1.134 +follows (as a sufficiently privileged user):
1.135 +
1.136 +./pload program /dev/ttyUSB0 blink.hex
1.137 +
1.138 +Note that the Pickle configuration file (~/.pickle or ~/.pickle/config) will
1.139 +need to have the port and baudrate settings defined. For example:
1.140 +
1.141 +DEVICE=/dev/ttyUSB0
1.142 +BAUDRATE=115200
1.143 +DEBUG=1
1.144 +
1.145 +
1.146 +
1.147 +References
1.148 +==========
1.149 +
1.150 +Basic PIC32 breadboard circuit:
1.151 +
1.152 +http://umassamherstm5.org/tech-tutorials/pic32-tutorials/pic32mx220-tutorials/pic32mx220-breadboard
1.153 +
1.154 +ArduPIC32 JTAG-based programmer:
1.155 +
1.156 +http://www.microchip.com/forums/m653443.aspx
1.157 +https://code.google.com/archive/p/ardupic32/