UMass Amherst

Introduction Lab

horizontal rule


Lab Instructions

Lab instructions as PDF

In this lab you will familiarize yourself with the MPLAB Integrated Development Environment (IDE) and the MPLAB In-Circuit Debugger. You will learn how to setup projects, simulate code, and debug code while it is running on the actual chip. Please complete this lab by 2/4/04. This lab will not be graded.

Getting Started

bulletTurn on the computer on your lab bench.
bulletCreate a folder for your project files. This is necessary because multiple teams use the same computer and most projects require numerous files. See computer use guidelines on the lab page. Also, please note that the data on your computer is not being backed up. It is your responsibility to ensure you maintain backups of your projects (e.g., on diskette, uploaded to your ECS account, etc.).
bulletDownload the following file into your Introduction Lab folder. You will need it for second part of the tutorials:

Tutorial 1: MPLAB IDE

Go through the tutorial in Chapter 3 (pp.17-33) of "MPLAB IDE, Simulator, Editor Userís Guide." It is encouraged that you not just blindly step through the tutorial, but discuss with your lab partner what you are doing and why.

The MPLAB IDE software is already installed on your lab computer. If you have problems finding/starting MPLAB IDE notify a TA.


bulletp. 19: The tutorial uses a PIC16F84, which is not the chip we are using. Thatís ok Ė do as the tutorial says.
bulletp. 20: Save your project in your Lab0 folder that you just created.
bulletp. 23: The tutorial claims that when clicking "Add Node" the browse dialog will be displaying the same folder as your project folder. This is not necessarily true. Manually change to your project folder and save your file there.

After completing the tutorial, modify your project to target the PIC that is included in the MPLAB Kit. Ensure that your project can be simulated for the new platform.

Tutorial 2: MPLAB ICD

Go through the tutorial in Chapter 2 (pp. 19-41) of "MPLAB ICD Userís Guide." You will need the MPLAB hardware for this tutorial. Set it up as shown in Figure 1.4 of the ICS userís guide and connect to your workstation with the serial cable.


bulletClose your previous MPLAB project before starting the ICD tutorial.
bulletp. 21: Instead of using the folder suggested in the tutorial, use your own Lab0 folder.
bulletp. 30: When clicking on "Options", a warning message might appear regarding address range. Click "OK" and ignore.
bulletp. 38: Try to find the section in the PIC16F87X data sheet that the tutorial refers to.

After completing the tutorial take some time and step through the code instruction by instruction and correlate what you see with the flow chart in Figure 2.19.


bulletFamiliarize yourself with Chapter 4 "Projects Tutorial" (pp. 35-58) and Chapter 2 in Part 2 "Debugging and MPLAB SIM Simulator" (pp. 65-100) in "MPLAB IDE, Simulator, Editor Userís Guide."
bulletRead Peatman Chapters 1&2.

Things To Take Away

bulletUnderstand the difference between simulation and in-circuit debugging
bulletThink of situations when simulation is preferable over in-circuit debugging and vice versa.
bulletMake sure you understand how projects and files are used, because you will use the IDE in every project. You will not be able to assemble and download code into the PIC without integrating it into a project.
© 2004 University of Massachusetts Amherst. Site Policies.
This site is maintained by Tilman Wolf.