Working with the e-pucks requires a development environment and a couple of supporting programs are required. This section describes how to acquire and install these.
On a Windows machine about 1.1GB of disk space is required. The e-pucks also support code development on Unix machines. Unix-users can download the required programs from www.e-puck.org -> Software ->Development tools -> Windows / Unixes.
A Bluetooth connection is required. If necessary we will purchase a couple of USB Bluetooth adapters. Please let us know if nobody in your group has a Bluetooth dongle, we have a few to spare.
Microchip`s MPLAP IDE
The e-pucks have a PIC processor as their CPU, a family of processors developed by Microchip. The PIC processor is one of the most widely used processors in the world and can be used to anything from controlling a color display to high speed digital signal processing to controlling almost any type of robot. To program them we use Microchip`s IDE MPLAP, which is a free, integrated toolset for the development of embedded applications.
This can be downloaded from www.microchip.com. Select Development Tools in the design area -> MPLAB IDE under software -> scroll all the way to the bottom of the page and select the newest version of MPLAB IDE (e.g. MPLAB IDE v8.83)(a large file). Save the zip file somewhere on your machine where you can find it. Unzip it and run setup. Do a complete installation. When asked if you want to install the Hi-Tech compiler select no. At any time during the installation windows might ask you if you want to install Micro Chip`s MPLAB. If it does, select yes.
To be able to compile the code for the specific PIC processor that controls the e-pucks the compiler C30 is needed. This can be found under:
http://www.eecs.harvard.edu/ssr/teaching/epucks/installation or you can get it directly from microchip.
www.microchip.com -> Development tools under design-> Compilers under software -> MPLAB C Compiler for dsPIC DSCs -> Link named: Special free version for academic use are available here (located just above the download area at the bottom of the page) - > MPLAB C Compiler for PIC24 and dsPIC v3.30c. Run the downloaded file. Use the Versioned Directory Name. When asked for installation type select LITE. We`ll use the LITE version because this does not require a license and we can use it without any restrictions. The only difference to the Pro version is that it does not optimize the code size as efficiently. If you write a seriously long program capable of beating the other soccer teams blindfolded or solving the Longleat hedge Maze in UK or Davis` Mega Maze here in Massachusetts we can use the full version for free for 60 days. But don`t download that now.
Tiny bootloader is needed for downloading the code (hex files) onto the e-pucks. This can be found under: http://www.eecs.harvard.edu/ssr/teaching/epucks/installation or you can get it at etc.ugal.ro.
http://www.etc.ugal.ro/cchiculita/software/tinyblddownload.htm. Select Download Tiny PIC Bootloader and select the newest version at the top of the page, not under history.
Save and unzip it some place where you would like it to be, e.g. in the program folder. If you`d like, you can make a shortcut to the tinybldWin executable file and locate this on your desktop since you will be using this often. Unix-users can download the program from www.e-puck.org -> Software ->Development tools -> Windows / Unixes.
After installation you can delete all the downloaded zip files and extracted folders, except the Tiny bootloader folder.
Epuck project and tutorial location
Create a folder on your computer you want to contain the epuck tutorials and the semester project e.g. C:\Projects\E-pucks\Tutorials\
Copy and unzip library.zip with all *.c *.h and *.asm files to C:\Projects\E-pucks\Libraries
Copy the relevant tutorial/lab to C:\Projects\E-pucks\Tutorials
Preparing MPLAB IDE for programming of the e-pucks
Open MPLAB IDE. Open the tutorial via File->Open Workspace->browse to the location of the tutorial and open the workspace.
Before you can compile the project the correct compiler tools and library locations must be selected.
Selecting the required compiler tools is done as in the following:
Project -> Select Language Toolsuite (See the dialog box below and follow the steps)
1. From the Active Toolsuite pull-down menu, select Microchip C30 Toolsuite. This toolsuite
includes the compiler, assembler and linker that will be used.
2. In the Toolsuite Contents block, select MPLAB ASM30 Assembler (pic30-as.exe).
3. In the Location block, click browse and navigate to:
4. In the Toolsuite Contents block, select MPLAB C30 C Compiler (pic30-gcc.exe).
5. In the Location block, click browse and navigate to:
6. In the Toolsuite Contents block, select MPLAB LINK 30 Object Linker (pic30-Id.exe)
In the Location block, click browse and navigate to:
Close the selection language toolsuite by clicking ok.
To enable the libraries downloaded in the above go to Project->Build Options->
Project->Directories. Select "Include search path" in the dropdown. Enter the path
to the libraries. Eg. C:\Projects\E-pucks\Libraries.
Add the same under "Assembler include search path"
The last thing to do before compilation is correcting the reference to the linker file. Right click the p30f6014A.gld file under Linker Script below the *.c, *.h and assembly files in the left bottom of the MPLAB workspace and correct the reference to:
C:\...\Microchip\mplabc30\v3.25\Support\dsPIC30F\gld\ to find p30f6014a.gld
During the first compilation MPLAB IDE will probably notify you that the compiler files have been moved since last compilation. You should use the MPLAB IDE selected locations.
You should now be ready to compile the project. Go to project -> Build All, press ctrl + F10 or click the icon with the two arrows pointing downwards.
The output build window should inform you that the build has succeeded.
From here on you should follow the tutorial/lab instructions or start developing your own code.
Design by Christian Ahler
CS266 - E-pucks