| |
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
| Turn on the computer on your lab bench. |
| Create 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.). |
| Download the following file into your Introduction Lab
folder. You will need it for second part of the tutorials:
/ece/wolf/courses/ECE354/labs/TUT877.ASM |
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.
Comments:
| p. 19: The tutorial uses a PIC16F84, which is not the
chip we are using. That’s ok – do as the tutorial says. |
| p. 20: Save your project in your Lab0 folder that you
just created. |
| p. 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.
Comments:
| Close your previous MPLAB project before starting the
ICD tutorial. |
| p. 21: Instead of using the folder suggested in the
tutorial, use your own Lab0 folder. |
| p. 30: When clicking on "Options", a warning message
might appear regarding address range. Click "OK" and ignore. |
| p. 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.
Homework
| Familiarize 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." |
| Read Peatman Chapters 1&2. |
Things To Take Away
| Understand the difference between simulation and in-circuit debugging |
| Think of situations when simulation is preferable over in-circuit
debugging and vice versa. |
| Make 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. |
|