In this part, I’ll cover the MCU setup requirements and schematics for our project. This is part 3 of the PIC32 tutorial, if you haven’t read part 2 yet, grab it here.
I’ve drawn up a simple schematic in Eagle CAD outlining what we’ll be attempting. As you can see, the circuit is very simple, and does not require a lot of components to get things running.
[responsive imageid=’239′ size1=’0′ size2=’600′ size3=’1000′]
If we read through “2.0 Guidelines for getting started with 32-bit MCUs” in the PIC32MX1/2 Datasheet, there are a couple of requirements that need to be adhered to, in order for the breadboard setup to work and operate in a stable fashion. I strongly recommend reading this section in the datasheet, but I’ll briefly cover and reiterate some of these requirements here.
[responsive imageid=’220′ size1=’0′ size2=’600′ size3=’1000′]
The datasheet indicates a couple of pins that always have to be connected. The most important thing the MCU is going to need to function, is power. It seems fairly obvious that the voltage supply pins, Vdd all need to be connected. Whether the ADC module is used or not, the supply pin for this module, AVdd also need to be connected. This would also mean that the corresponding Vss and AVss pins need to be connected to ground. Also, since we’re not using the USB OTG module in this tutorial, we also need to connect the Vbus pin to Vdd.
[responsive imageid=’221′ size1=’0′ size2=’600′ size3=’1000′]
The PIC32MX1/2 MCUs are 3.3V devices. The datasheet states in “Table 29-4: DC Temperature and Voltage Specifications” that the Vdd supply voltage is typically in the range of 2.3V – 3.6V. We’ll be relying on the PICkit3 for now to supply more or less 3.3V to our setup.
Ceramic bypass capacitors with the value of 0.1µF with a 10-20V rating are connected to the AVdd and Vdd pins. The datasheet recommends low-ESR capacitors, with a resonance frequency of 20MHz and above.
A 10µF tantalum decoupling capacitor is connected VCap pin. The datasheet recommends a low-ESR (1Ω) Tantalum capacitor, and is required the stabilize the internal, on-chip voltage regulator. This voltage regulator supplies 1.8V to the MCU core.
The MCLR reset pin needs to be connected and kept high at Vih, which is equal to Vdd or around 3.3V. Pulling this pin low will result in a device reset. We’re going to connect MCLR to pin 1 on the PICkit 3, as the programmer will need to manipulate it during programming and debugging operations. You’ll notice in the schematic above that a 460Ω resistor (R3) has been placed in series to the pin. This adds some current limiting in case the MCLR pin has issues with ESD or EOS. The capacitor C5 is used to prevent unintentional resets.
The ICSP PGECx & PGEDx pins are not typically part of the application implementation, but needed nonetheless. These pins allow us to program and debug the MCU, where PGECx is the clock pin, and PGEDx is the data pin. If you look at the MCU pinout, there are several designated pins that can be used for debugging and programming. We’ll be using pins 4 & 5 for this purpose.
We won’t be connecting an external oscillator in this tutorial, and neither will the setup include a voltage regulator, as we’ll be relying on the PICkit 3 to supply power to the MCU.
Unused floating I/O pins need to be configured as outputs and driven low, or should be connected to ground with a 1kΩ to 10kΩ resistor, and configured as an input.
In Part 4, we’ll finally start doing some practical stuff.