I use the DP32 for my For Cheap Robots series. This tutorial is a must read for anybody using the DP32, because the configuration of this board means it takes a little more setup than other boards like the UC32 or the Arduino.

The DP32 is a small, Arduino compatible board, built to be integrated into projects requiring a small, no frills microcontroller. It has a powerful PIC32 microprocessor on board, plenty of digital inputs and outputs, several analogue inputs, and loads of other things like SPI and PWM pins hidden away. The reason I'm personally fond of this board is the built in breadboard, which allows you to place your electronics directly on board. Best of all, it's cheap!

I'm going to start this tutorial off by showing you the extra step you need to take before you can program your board. We'll use the example program Blinky for this.

Then, I'm going to show you how you can access some of the more advanced features that this board has, like analogue pins, PWM, and external interrupts!

Let's get started!


For more Instructables on building cheap robots, head to the For Cheap Robots collection, or for more things that I've done, check out my profile page!

For more info from Digilent on the Digilent Makerspace, check out the Digilent blog!

Step 1: What You'll Need

For this project, you're only going to need:

  • A DP32 from Digilent
  • A micro USB cable to program it with. (Picture from Powerlet.com)

For software, you're going to need to download MPIDE and install it.

Step 2: Installing the Drivers (Windows Only)

This step is only necessary for Windows users.

First, make sure that MPIDE has been installed and starts up properly. Close MPIDE and make sure that your DP32 is unplugged.

Now, find where MPIDE was installed (most likely in your "Program Files" folder). Navigate to:

mpide-0023-windows-20140316 ==> drivers ==> chipKIT Drivers

Opening up the "chipKIT Drivers" folder should reveal something similar to the first picture of this step. You'll want to open the USBDriverInstaller application down at the bottom of the list. That will give you a window like in the second picture. Clicking "Install Drivers" will start the process (I had to give the installer admin permission to install in the third picture).

After a couple of seconds, the installation is complete, and you should see a message like the fourth picture in this step.

Now you're ready to go! You'll only need to install these drivers once.

Step 3: Open Up Blink

Open MPIDE, and click the "File" tab on the top of the screen. Navigate to

File > Examples > Basics > Blink

and click to open up the Blink example sketch shown in the second picture.

Step 4: Bootloader Mode on the DP32

Plug your DP32 into the computer.

If you have programmed your DP32 before, your DP32 will immediately begin running this last program when it is given power. In order to program it, you will need to set it into bootloader mode.

If you have never programmed your DP32 before, it will start up in bootloader mode automatically. Otherwise, you'll have to start it up into bootloader mode.

To do this, simply press the RESET and BTN2/PGM buttons at the same time, then release the RESET button (while still holding down BTN2/PGM). This will start it up in bootloader mode.

You can tell that your DP32 is in bootloader mode because LD1 will flash somewhat rapidly. Once you see the flashing light, you can release BTN2/PGM.

NOTE FOR MAC USERS: When you set your DP32 to bootloader mode, your computer will pop up with the message in the second picture of this step. Go ahead and hit "cancel" to ignore it.

NOTE FOR WINDOWS USERS: When you set your DP32 to bootloader mode, your computer may pop up with a message (not pictured, because I couldn't duplicate it) saying that the drivers may not have installed.

Step 5: Programming the DP32

For anybody who has programmed another chipKIT board or an Arduino, this next step should be pretty familiar.

You first want to set your hardware by going into

Tools > Board > chipKIT

and selecting DP32.

Now you need to set which port your DP32 is connected to. You can do that by going into

Tools > Port

and selecting the port your DP32 is on. You can figure out which port this is by unplugging your DP32 and seeing which one disappears. This does mean that you'll have to go through the process of setting your DP32 into bootloader mode again, but you'll need to do it to find out which port to pick.

It's important to note that on Mac, your ports will look like picture 3 in this step.

Now that you've got the hardware and the port set, hit the upload arrow on the top left hand corner of the screen .(It's the arrow in the box just to the left of the triangle in the circle. Check picture 4 to see what you should see.)

Your program should upload without any problem, and LED1 on your DP32 should blink!

Step 6: More Tips and Tricks for the DP32

The DP32 is full of all kinds of hidden treasures, so I threw together a diagram for you guys that shows which pins have what connected to them. There's everything here from UARTs to PWM!

The DP32 is a surprisingly capable little board, which is why I picked it for my For Cheap Robots series. Very soon I'll post an Instructable I've been working on for a while now, where I turn this board into a fully functioning robot, and you'll get to see how convenient it is to have that breadboard built onto the platform.

As always, please comment if you've got any questions, suggestions, or if you just want to say "hi"! I'm looking forward to seeing how all of you use this board!

<p>I have a problem.... when i plug in my dp32 into the compter, led 1 does not light up at all, the computer doesn't even recognize it's presence, what should i do? </p>
Which step were you at?<br><br>After using the DP32 for a while I've learned some things. One of these is that bootloader mode starts up when the RESET button is released while holding down BTN2/PGM. I've re-written step 4 to reflect this.<br><br>Was that what you were having trouble with?
<p>i did exactly as you have instructed, yet nothing seems to happen, is the chip faulty?</p><p>Thanks.</p>
<p>Hi Jay,</p><p>Thanks for your info</p><p>btw, I see that the xtal=8Mhz, does this mean that the SYSCLK = 8mhz?</p><p>gG</p>
<p>Oh wow! I'm so sorry it's taken me this long to notice this comment!</p><p>I believe SYSCLK actually operates at 40 MHz.</p>
<p>Hi JayWeeks, your pin map is VERY useful!! </p><p>However, it shows the SPI1 MOSI is on Pin 18 AND Pin 7 and there is no SCK shown. Your DP32 <a href="http://www.digilentinc.com/Data/Products/CHIPKIT-DP32/chipKIT%20DP32_rm.pdf" rel="nofollow">reference manual</a> says the following:</p><p>SPI: Synchronous serial port. Pin 9 (SS), Pin 18 (MOSI), Pin 7 (SCK), Pin 10 (MISO). This uses SPI1 on the PIC32 Microcontroller. The second SPI is implemented as Pin 14 (SS), Pin 2 (MOSI), Pin 13 (MISO), and Pin 8 (SCK).</p><p>Can you update your pin map? :)</p><p>Thanks!!<br></p>
<p>You are totally correct! Thanks for the catch!</p><p>Unfortunately I'm not... <em>really</em> in a position to update the diagram right now 'cause I'm away on an internship (at <em>NASA!</em> :D). I <em>will</em> however put a note in there for now, and send a message to one of my co-workers asking them to update it. We'll see what happens.</p><p>That said, based off the board defs, the second SPI isn't set up for MPIDE to use. I am reluctant to put it on the pinout diagram unless it's easy for mid-level users (like myself) to use, because I feel that may be misleading. If you got the second SPI to work, tho, I'd <em>love</em> to hear about it!</p><p>Thanks again!</p>
<p>Cool board. It is nice as there is a lot that can be done with it.</p><p>I have to admit, being the geek I didn't read instructions. What, why can't I upload my little sketch. Oh press &quot;RESET&quot; while holding BTN2. Releast &quot;RESET&quot; then release BTN2. </p>
<p>Oh I totally know what you mean. It actually took me a little trial and error to come up with that step because while it's explained in the reference manual (available at the bottom of the DP32's product page here &lt;http://preview.tinyurl.com/Digilent-DP32&gt;) it's not explained very clearly.</p>
<p>awesome thanks!</p>
You're welcome! Thanks for reading!
Nice ! I didn't really know about micro usb and it's difference with mini .
Yep! It's a very subtle difference, and it's messed me up before too.
<p>What an awesome amount of information, definitely newbie friendly! Thanks for sharing!</p>
I'm very happy to hear that! I try very hard to make this as easy to use as possible.<br><br>(PS. Your hair is amazing!)

About This Instructable




Bio: I build robots out of boxes! I love teaching what I've learned and seeing people add their own ideas to what they've learned ... More »
More by JayWeeks:Speed PID using Digilent Gear-Motors and Encoders! Getting Started With the Pmod HB5: Part 1 Resistive Touch Screen on the DP32 
Add instructable to: