It’s finally time to get our hands dirty. So far this tutorial has made a commotion about what we’ll be attempting, yet we haven’t lifted a single finger.
This is Part 4 of the PIC32 Tutorial, get Part 3 by clicking here.
First, we need to get the MCU onto the breadboard. To make sure the MCU is oriented correctly, we need to make sure of where pin 1 is located. At the one end of the MCU, there is a half circle indent, and just to the left of that is where pin 1 is located. Make sure you do not plug your MCU in upside down, as you’ll risk frying the chip, or simply sit with nothing happening at all. These MCUs are fairly cheap, so if you’re going to order some from your supplier, I do recommend you get a few extra. There’s nothing more annoying than frying or even bricking a chip, and you have to end up waiting for shipping to get new parts delivered to you.
[responsive imageid=’97’ size1=’0′ size2=’600′ size3=’1000′]
The next step is to connect the Vdd supply wires, the red ones in the image above. These will eventually give a supply of 3.3V to the respective pins. Pins that need to be connected to Vss are pins 13 (Vdd), 15 (VBus), 23 (VUSB3V3) and 28 (AVdd). Also ensure you connect the Vss pins, also referred to as ground pins. The Vss pins are pins 8 (Vss), 19 (Vss) and 27 (AVss). You’ll notice I’ve placed a red and black wire at the bottom of the above image, just below pins 2 and 3, which will connect to the 6-pin header, where we will eventually plug in the PICkit 3 programmer.
Once again, I would like to mention, keeping the wires short and tidy, might just help save a lot of effort debugging your circuit in the future. It’s so ridiculously easy to unhook a wire. Also, longer wires introduce more stray or parasitic capacitance and inductance, although some folks have mentioned, that they haven’t had any problems with loopy spaghetti setups on this particular MCU.
The next step involves simply plugging in our components. I prefer clipping the leads on the components, so they sit as close as possible to the board. This will help us to avoid accidentally short circuiting or disconnecting something by unhooking and pushing things about on the board.
[responsive imageid=’98’ size1=’0′ size2=’600′ size3=’1000′]
There are 4 (unpolarized) ceramic capacitors, and two resistors which you simply need to plug in. If you’re unsure or it’s unclear from the images above where these components exactly need to plug in, refer back to the schematic in Part 3. There is only one Tantalum capacitor on the board for the VCap pin 20. Be careful and pay attention here! The Tantalum capacitor on pins 19 and 20 is polarised, and you need to connect the positive lead on pin 20, and the negative on the Vss pin 19. The positive end is typically noted by a + sign on the front of the capacitor coating. The ones I brought had leads of equal lengths, so it’s best to get the pole orientations from the cap casing.
The last bit is to connect the 6 pin header. This needs to be connected to allow us to hook up the PICkit 3 to program the MCU. It’s important to keep the wires short, and make sure they make good contact. The image above shows the blue PGD data wire, and the green wire which is the PGC ICSP clock signal. The brown wire is for the MCLR pin and is also connected to Vdd via a 10kΩ, 460Ω resistor and a 0.1µF ceramic decoupling capacitor. Refer to the schematic for details.
Once you’ve added the wires for the ICSP 6-pin header, we should be ready to proceed to the next step, where we can test the setup and see if we can get the PICkit 3 programmer to successfully connect to the PIC32MX250F128B MCU.