Introduction: Getting Started With the DP32 From Digilent
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 info from Digilent on the Digilent Makerspace, check out the Digilent blog!
Step 1: What You'll Need
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!
We have a be nice policy.
Please be positive and constructive.