PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to...
Transcript of PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to...
![Page 1: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/1.jpg)
PIC LAB
LAB#1: Introduction
By ENG. Tamar Jomaa
![Page 2: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/2.jpg)
MPLAB.
PROTEUS.
MikroC.
PIC-Simulator.
QL-Programmer
Software Tools:
![Page 3: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/3.jpg)
MPLAB:
![Page 4: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/4.jpg)
MPLAB:
Launch MPLAB
![Page 5: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/5.jpg)
Open a new Source file by choosing [FILE][NEW] or clicking on the icon on the toolbar
![Page 6: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/6.jpg)
Type in your program
![Page 7: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/7.jpg)
Rules for the Microchip assembler:
Comments begin with a ;
Labels (names) begin in column 1 (Leftmost) and by style should be UPPERCASE
Instructions should not begin in column 1 and by style should be lowercase
The last directive should be end(comments can come after)
![Page 8: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/8.jpg)
Save your file [FILE][SAVE AS] on your floppy or memory stick in a folder called tamar
![Page 9: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/9.jpg)
Rules for file naming:
Names should be not more than 32 alphanumeric characters, nor beginning with a number. An underscore is an acceptable character
The extension should always be .asm; e.g. lab1.asm
![Page 10: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/10.jpg)
The result after press save:
![Page 11: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/11.jpg)
Make a new peoject : [Project] [ProjectWizard]
![Page 12: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/12.jpg)
Hit the {Next} button (left)
![Page 13: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/13.jpg)
Step One: Pick the device you are going to use as the target, hit the{next} button
![Page 14: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/14.jpg)
Step Two: Select your Language Toolsuite.
![Page 15: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/15.jpg)
Step Three: Give your project a name and where it is going to reside This is usually in the same place as you saved your source file; desktop:/tamar in our example (right)
![Page 16: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/16.jpg)
Step Four: Find your source file, select it and hit the {Add}button (left), hit the {Next} button
![Page 17: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/17.jpg)
A summary of your project is given to allow you to back up and make any alterations . Hit the {Finish} button to complete your project setup file lab1.mcp
![Page 18: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/18.jpg)
:The result after press {finish}
![Page 19: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/19.jpg)
Press to lab1.asm to show the following:
![Page 20: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/20.jpg)
Then, run the program by choose project Bulid All
![Page 21: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/21.jpg)
In case of Successful program, you receive the following massage:
![Page 22: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/22.jpg)
To implement the program practically we only load the HEX file extension to the PIC
![Page 23: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/23.jpg)
See you in next lab to begin with hardware site.
![Page 24: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/24.jpg)
Assignment#1:
Download the following software tools: a) MPLAB. b) PROTEUS. c) MikroC. d) PIC-Simulator. e) QL-Programmer
![Page 25: PIC LAB - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/PIC-LAB1.pdf · Press to lab1.asm to show the following: Then, run the program by choose project Bulid All. In case of](https://reader033.fdocuments.in/reader033/viewer/2022042419/5f35dfe96004a858b157cf2d/html5/thumbnails/25.jpg)
Enjoy in PIC lab