pic lab - site.iugaza.edu.pssite.iugaza.edu.ps/tjomaa/files/pic-lab1.pdf · press to lab1.asm to...

25
PIC LAB LAB#1: Introduction By ENG. Tamar Jomaa

Upload: others

Post on 10-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

: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

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

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

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

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

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

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

Enjoy in PIC lab