UNIVERSITY OF PERPETUAL HELP SYSTEM DALTA
LAS PINAS CAMPUS
COLLEGE OF ENGINEERING
ELECTTRICAL ENGINEERING DEPARTMENT
EXPERIMENT NO: 1
INTRODUCTION TO MPLAB X IDE AND MPASM
SUBMITTED BY:
DALISAY, EZEKIEL S.
SUBMITTED TO:
ENGR. EDUARD DARYLL TAN, REE, RME, CLAD(R), PMP(R)
INSTRUCTOR
2ND TERM SY. 2016-2017
INTROFUCTION TO MPLAB X IDE AND MPASM
Purpose:
Introduce the environment of MPLAB X IDE
Familiarize the common buttons, techniques, and procedure
Objective:
to familiarize with MPLAB X IDE
to know how to create a project
to implement In Circuit Serial Programming
to practice the PICDEM2 Plus Development Board
to know how to build, program and debug
to know how to create a breakpoint
to know how to view register/variables in watch window/variable window
Competency Rating:
0 1 2 3 4 5 6 7 8 9 10
CODING SECTION:
VALIDATION AND VERIFICATION SECTION:
TASK 1: Familiarized with MPLAB X IDE
Figure 1. Familiarized with MPLAB X IDE
TASK 2: How to Create/Open a Project
Figure 2. How to Create/Open a Project
TASK 3: In-Circuit Serial Programming (ICSP) AND TASK 4: Familiarized with PICDEM2
Plus
Figure 3. Familiarized with PICDEM2 Plus
TASK 5: Build, Program and Debug
Figure 4. Clean and Build
Figure 5.Run Main Project Completed
Figure 6. Output of Task 5
TASK 6: Know how to view register/variables in watch window/ variable window
Figure 7. Register/variables in watch window/ variable window
Task 7: Know how to create a breakpoint
Figure 8. Know how to create a breakpoint
Figure 9. Output of Task 7
SET-UP:
DISCUSSION OF RESULTS:
The first experiment on the MPLAB X IDE and MPASM the code was uploaded to the
PIC which is connected to the PICkit3 to the computer the LEDs RB0, RB1, RB2 and
RB3 has an initial value of 0101 or OFF-ON-OFF-ON.
I observed that the PICKIT 3 is not working in any value of voltage but then it is better
used if the voltage is set near 5V. Further observation is that the program is not working
whenever you place an external source when you already use the PICKIT 3 to power
your device.
Debugging takes time whenever there is wrong input or deleted word in the template.
after debugging the line automatically when to "GOTO" with an arrow point to it.
CONCLUSION:
Based from the experiment Introduction to MPLAB X IDE and MPASM I conclude
that in this experiment we just had familiarized the basic parts and explore the programming
environment of the MPLAB X IDE. We use the following materials and equipment PICDEM2
plus Development Board, PIC18446k22, PICkit3 In-Circuit Programmer. As discussed in the
results we cannot supply the PICDEM2 plus Development board using both 9V battery and using
the PICKIT3 because there will be an error, so we can conclude that whenever we dont have a
battery or an adaptor we can still perform the experiment because the PICKIT3 is able to supply
power to the Development Board. Every changes that we made on the code changes the value of
the LEDs RB0, RB1, RB2 and RB3 to turn ON(1) or OFF(0).
RECOMMENDATIONS FOR APPLICATION PROJECTS
The field of programming is very wide and it can be applied in real word. Here
are some examples: web programming, OS development, artificial intelligence,
operations management tools, databases, game development
REFERENCES
[1]Microprocessor & Microcontroller by A.P.Godse, D.A.Godse
[2]https://learn.org/directory/category/Computer_Science/Software_Programming/Software_Ap
plications_Programming.html
[3]https://www.physicsforums.com/threads/applications-of-programming-in-the-real-
world.143392/
ANSWERS TO QUESTIONS
Task 5: What is the output of the LEDs RB0, RB1, RB2, and RB3?
- RB0 OFF, RB1 ON, RB2 OFF, RB3 ON
Task 6:
Click Step Into button one. Where does the arrow points?
- BANKSEL TRISB
Monitor the registers as you click Step Into button again. Thrice. Where does the arrow points?
- BANKSEL LATB
What register changes?
- TRISB
What now are the new values of the register that changed?
- 0X00
Task 7:
Click Play button. Where did the code stopped?
- MOVWF LATB
What register changed?
- LATB
What is the new value of the register that changed?
- 0xBB
What is the output of the LEDs RB0, RB1, RB2, and RB3?
- RB0 ON, RB1 ON, RB2 OFF, RB3 ON
How can you relate the register of the LATB to the output of the LEDs?
- Combination of the LEDs RB1 and RB3 or RB0 and RB2 corresponds on the value
register whether it is ON(1) or OFF(0).
Click Play button again. Where did the code stops?
- btfss STATUS, Z
What register changes?
- Var1, LATB
What is the new value of the register that changes?
- 0xAA
What is the output of the LEDs RB0, RB1, RB2 and RB3?
- RB0 OFF, RB1 ON, RB2 OFF, RB3 ON
Click Step Into button 15x while monitoring Var1. What did you noticed?
- Var1 decreases
What part of code brought this changes?
- DECF Var1