17
Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W Microprocessor Technology

Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W

Embed Size (px)

Citation preview

Page 1: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W

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

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

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

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

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

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

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

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

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

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

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

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

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
Page 15: Lab Procedure: Opening an Existing MPLAB Projecttechnology.niagarac.on.ca/courses/ctec1904/OpenExistingMPLAB... · Lab Procedure: Opening an Existing MPLAB Project CTEC1904/2015W

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

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

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.)