lab procedure: opening an existing mplab...
TRANSCRIPT
![Page 1: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/1.jpg)
Lab Procedure: Opening an Existing MPLAB Project
CTEC1904/2015W Microprocessor Technology
![Page 2: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/2.jpg)
1. Connect the Board to PC First, plug the power supply into the jack on the PICTRAINER BOARD and then to an AC outlet. Boot up your PC and log in using your username and password. Plug in the red USB cable into a USB jack on the front panel of the PC. Windows 7 should recognize the PICkit 3 device as a “Human Interface Device” (HID).
![Page 3: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/3.jpg)
2. Download the Project Archive from the course web site or from Blackboard
![Page 4: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/4.jpg)
3. Save the Archive to the Desktop
![Page 5: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/5.jpg)
4. Extract the Archive
• Right click to use 7-‐Zip
![Page 6: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/6.jpg)
5. Open MPLAB IDE
• File | Open Workspace …
![Page 7: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/7.jpg)
Open MPLAB (2)
• Choose the project folder that you just extracted … and then the Workspace file …
![Page 8: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/8.jpg)
Project Opened
Work-‐space
Output Window Source Window
![Page 9: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/9.jpg)
6. Build, Program and Run • You can perform these steps either using the Project menu or the toolbars…
• Step 1 is “Build All”
![Page 10: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/10.jpg)
Build, Program and Run (2)
• In the Build tab of the Output window, you will see various messages … ul`mately “BUILD SUCCEEDED”
![Page 11: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/11.jpg)
Build, Program and Run (3)
• The build assembles the source code into PIC18F machine code.
• The Program bubon uploads the machine code to the PIC18F8722 microcontroller on the board, through the PICkit 3 device.
![Page 12: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/12.jpg)
Build, Program and Run (4)
• The PICkit3 tab in the Output window will show communica`ons messages between the PC and the PICkit 3 device.
• Looking for “Programming/Verify complete”
![Page 13: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/13.jpg)
Build, Program and Run (5)
The Run bubon starts the program on the PICTRAINER BOARD. MPLAB will show an anima`on at the bobom of the window, and a green arrow in the Source window (at the first instruc`on.)
![Page 14: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/14.jpg)
![Page 15: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/15.jpg)
7. Halt and Reset
The Halt bubon stops the program … the Source window places the green arrow at the instruc`on where the program was stopped at.
![Page 16: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/16.jpg)
Halt and Reset (2)
The Reset bubon sets the board to a “Power-‐On Reset” (POR) state, and puts the green arrow at the first instruc`on in the program.
![Page 17: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W](https://reader031.vdocument.in/reader031/viewer/2022022611/5b995d4b09d3f294728bcc0e/html5/thumbnails/17.jpg)
8. Close the Workspace
• File | Close Workspace
(If you have made changes to either the code or the workspace windows, you are prompted to save the workspace before MPLAB closes.)