Microchip - PIC32

Page last updated: August 2010 by Kiran Nevaskar

Kit Details

  • Kit Name: PIC32 Ethernet Starter Kit (Part Number: DM320004)
  • Onboard Microcontroller: PIC32MX795F512L
  • Microcontroller Type: 32-bit
  • Official kit companion site: PIC32 Ethernet Starter Kit
  • Kit Price (Approx): USD 72
  • Buy Kit: microchipDIRECT

Software Development Tools

We have used:
  • C Compiler: C32 (included in MPLAB v8.53) Download
  • Assembler: Included along with C32 Package
  • IDE: MPLAB v8.53 Download
  • Programmer/Debugger: built into MPLAB v8.53
  • Operating System: Microsoft Windows 7 32-bit
 

Step 01 - Install MPLAB



Download MPLAB and start the install process:





Click on next to proceed further:




Check on Complete option so that C32 tool suite will get installed. During installation setup will ask about installing Hi-Tech tool suite for 8Bit devices you can select no as it is not required for PIC32:




Now setup is completer and tool is ready to use:


Step 02 - Create a new Project



Start MPLAB IDE:




Start Project Wizard by clicking on Project Menu:




Select appropriate device. In this case select device as PIC32MX795F512L:




Select Language Tool suite as Microchip C32 from drop down menu:




Create folder for project at required path and browse that folder:




As we are going to create new code file so skip this step by clicking next without adding any file
to project:




Following window will appear showing summery of the project:



Step 03 - Create new source file and Compile



Create new file from the file menu or from the toolbar:





Write the code in that file and then save that the file with .c extension. Here save file with name the file as led.c:




Now right click on Source files in workspace window and add code the file to project. Here add the file led.c:




Build the project by pressing Ctrl + F10 key simultaneously:
 

Step 04 - Simulation



Simulator can be started by Debugger Menu->Select Tool->MPLAB
SIM.
Double click on the line where you want to put break point. So that simulator will halt there while simulating or debugging:




For sake of understanding and easiness insert line numbers by
Edit Menu->Properties->C Files Tab-> Check o Line Number as shown
:




Now to see result we need to add variables/registers to watch window. Click on View Menu->Watch then click on drop down list and select PORTD & LATD registers and click on Add SFR button:




Now click on play button to run simulator and observe result in watch window:




As we have put break points click again and again play button to go ahead in the program:


Step 05 - Execute the program


Now connect Mini b USB Cable to target board. Windows will ask for drivers for Windows XP install drivers automatically and for Windows Vista and Windows 7
give this path in Device Manager 'C:\Program Files\Microchip\MPLAB IDE\PIC32MXSKit\Drivers' . Also Microchip provides video for installing drivers for Vista and Windows 7, included in CD and on website. After installing drivers select Programming/Debugging tool shown in image below. Select PIC32 Starter Kit in our case.




After successful connection & selection you will be able to see the following screen showing message. If in case you see some message about upgrading firmware of debugger, upgrade it. If it shows some error then contact Microchip for that or retry the above procedure of selecting and connecting debugger.




Now program the target device by clicking the icon encircled in below image:
 




Now while debugging repeat the procedure used during simulating except choosing debugger as simulator:













Attachments:


SelectionFile type iconFile nameDescriptionSizeRevisionTimeUser
ċ

Download
This program Blinks LEDs connected to PORTD of PIC32MX795F512L   48k v. 2 Aug 15, 2010, 3:40 AM Kiran Nevaskar
Comments