use of mplab software
DESCRIPTION
Use of MPLab software. Paul Cockshott. PIC KIT. Get the kit. Kits are locked in cupboard Get from lab supervisor Plug into the usb port on your computer. MPLAB. How to use. create a project enter program assemble program down load program run program simulate. New project. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/1.jpg)
Use of MPLab software
Paul Cockshott
![Page 2: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/2.jpg)
PIC KIT
![Page 3: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/3.jpg)
Get the kit
Kits are locked in cupboard Get from lab supervisor Plug into the usb port on your computer
![Page 4: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/4.jpg)
MPLAB
![Page 5: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/5.jpg)
How to use
create a project enter program assemble program down load program run program simulate
![Page 6: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/6.jpg)
New project
![Page 7: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/7.jpg)
Select chip type PIC12f675
![Page 8: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/8.jpg)
Select tool
you should selectthe assembler tools(We do not provide basic)
![Page 9: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/9.jpg)
Name your project
![Page 10: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/10.jpg)
Skip adding files
![Page 11: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/11.jpg)
Resulting project file
Now click on File->New to get a new blank file
Type in your program. For the example copy
this from the web page. It may be quicker to cut
and paste.
![Page 12: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/12.jpg)
Save file
Once you have entered your program save it with the extension .asm
At this point the syntax highlighting will switch on.
![Page 13: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/13.jpg)
Add to project
Once the file is saved you can add it to your project
![Page 14: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/14.jpg)
Run the assembler
Goto the project menu Select Make
![Page 15: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/15.jpg)
Success! If it works you will get a message
like those oppositeExecuting: "C:\Program Files\MPLAB IDE\
MCHIP_Tools\mpasmwin.exe" /q /p12F675 "db.asm" /l"db.lst" /e"db.err"
Message[302] Y:\TEACHING\ASSEMBLER\DB.ASM 113 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] Y:\TEACHING\ASSEMBLER\DB.ASM 117 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] Y:\TEACHING\ASSEMBLER\DB.ASM 119 : Register in operand not in bank 0. Ensure that bank bits are correct.
Warning[207] Y:\TEACHING\ASSEMBLER\DB.ASM 225 : Found label after column 1. (inittim)
Loaded Y:\teaching\assembler\db.CODBUILD SUCCEEDED: Tue Sep 21
14:36:41 2004
![Page 16: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/16.jpg)
Correct errors If an error occurs you will
get a build fails message If you double click on the
error message you will be taken to the line with the error so that you can correct it
Error[113] Y:\TEACHING\ASSEMBLER\DB.ASM 117 : Symbol not previously defined (TRISIO9)
Message[302] Y:\TEACHING\ASSEMBLER\DB.ASM 119 : Register in operand not in bank 0. Ensure that bank bits are correct.
Warning[207] Y:\TEACHING\ASSEMBLER\DB.ASM 225 : Found label after column 1. (inittim)
Halting build on first failure as requested.
BUILD FAILED: Tue Sep 21 14:40:30 2004
![Page 17: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/17.jpg)
Select PICkit 1 programmer
![Page 18: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/18.jpg)
Program the chip
![Page 19: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/19.jpg)
Test on board
Pressing the button should cause one of the LEDs to go on or off.
![Page 20: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/20.jpg)
Simulator
If you go to the debug menu, and select the simulator tool then you can simulate the running of your program using an emulator.
This enables you to single step through your program
![Page 21: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/21.jpg)
Simulator toolbar
runanimate
step into
step over routine
step out of routine
reset
![Page 22: Use of MPLab software](https://reader035.vdocuments.net/reader035/viewer/2022081421/56813e11550346895da7f1d5/html5/thumbnails/22.jpg)
Running in emulation mode
The current line being executed is indicated by an arrow in the source window