Lab 1 - Programming The Pic16f887 Using Mplab and Proteus Isis
Lab 1 - Programming The Pic16f887 Using Mplab and Proteus Isis
PROTEUS ISIS
This lab demonstrates how to design a single digit decimal counter that is able to count the
number of high input given at the switch. It also presents ISIS Proteus as a tool to simulate
the design.
Objective:
Learning Outcome:
Able to write and compile an assembly language program using MPLAB IDE.
Able to embed the .HEX file into the PIC16F887
Able to use Proteus software to simulate embedded system circuit.
Equipment/Components:
Equipment/Component
MPLAB IDE
PROTEUS ISIS
Value
-
Quantity
1
1
Experiment 1:
1. Create a new folder in computers local disk (C:). Rename the folder as you wish.
2. Study the flow chart and the program in Figure 1 and Figure 2. Compare and match the
flow chart with the program.
3. Launch MPLAB IDE.
4. Open a new project (apply the following procedures):
a. Project->Project Wizard->next.
b. Step 1: Select a device (select PIC16F887)->next.
c. Step 2: Select a language toolsuite (select Microchip MPASM Toolsuite)->next.
d. Step 3: Create a new project file (Browse to the folder that you have created in 1.) >Write any name->Save->Next.
e. Step 4: Add existing file. (for new project->click next, for existing project->
browse from the list and select the corresponding .asm file->add->next)->Finish.
5. Create a new .asm file and add it into the project file opened in 5:
a. File->New.
b. Write the program given in Figure 1 in the editor.
c. Save the program (File->Save As). Browse to the folder that you have created in 1.
Give any name to the file, make sure to put .asm as file extension.
d. Project->Add Files to Project->Select the file that you have created in 6(c)->Open.
6. Build the project. (Project->Build All). If the program was built successfully, you should
have a file with .HEX in the folder created in 1.
1
Figure 2
3
Experiment 2:
1. Launch ISIS Proteus.
2. Construct the circuit in Figure 3.
3. Save the circuit in the same folder created in Experiment 1.
4. Store the program written in Experiment 1 into the PIC16F887:
a. Double click the PIC16F887 (The Edit Component page will appear).
b. At the Program File option (browse for the .HEX file obtained in Experiment 1) >Open->OK.
5. Play the circuit (click the triangle button at the left bottom).
6. Click the BUTTON switch on the circuit. Observe.
Experiment 3:
1. Program the PIC16f887.
2. Construct the circuit in Figure 3 on the breadboard.
3. Observe.
Exercises:
1. Write comments for each instruction in the program given in Figure 1.
2. Replace the 7-segment display with a 14-segment display. Modify the program so that
instead of counting up, it shows letters in alphabetical order (A->B->C->Z->A) with
every click on BUTTON switch (use Proteus and MPLAB). Attach your program with this
report.