Page last updated: August 2010 by Kiran Nevaskar
Step 01 - Install MPLABDownload MPLAB and start the install process: Step 02 - Create a new ProjectStart 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 CompileCreate new file from the file menu or from the toolbar: Step 04 - SimulationSimulator can be started by Debugger Menu->Select Tool->MPLAB Double click on the line where you want to put break point. So that simulator will halt there while simulating or debugging:SIM. ![]() 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 programNow 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: |
Microchip - PIC32
Selection | File type icon | File name | Description | Size | Revision | Time | User |
---|---|---|---|---|---|---|---|
ċ
|
Download |
This program Blinks LEDs connected to PORTD of PIC32MX795F512L | 48k | v. 2 | Aug 15, 2010, 3:40 AM | Kiran Nevaskar |