EE 361L Digital Systems And Computer Design Laboratory

2y ago
10 Views
2 Downloads
375.11 KB
8 Pages
Last View : 7d ago
Last Download : 3m ago
Upload by : Javier Atchley
Transcription

EE 361L Digital Systems and Computer Design LaboratoryUniversity of HawaiiDepartment of Electrical EngineeringWorking with the PIC16F84 – A Quick and Dirty TutorialVersion 2.0Date: 08/26/2003This document is a quick and dirty tutorial on programming the PIC16F84Amicrocontroller using the C programming language.MPLAB IDE is a user-friendly environment provided by Microchip (manufacturersof PIC micro-controllers) for program compilation, simulation & testing andprogramming the micro-controllers.HI-Tech PICC compiler is used to compile source programs in C and worksseamlessly with the MPLAB IDE.Section I provides an introductory tutorial on the MPLAB IDE using the sample Cprogram given for Lab 2.1. Section II provides basic information on simulation in theMPLAB IDE environment followed by another section on programming the microcontroller using the PICSTART hardware device.For complete information on the MPLAB IDE, please refer to the MPLAB IDESimulator & Editor User’s Guide at the following ro/devenv/manual/51025e.pdf .

I. Using the MPLAB Integrated Development Environment (IDE)1. Start MPLAB IDE. You will get the window as shown in Figure 1.Figure 1. Screen shot of MPLAB IDE.2. Go to the icon Project and click on the Project Wizard (Project- Project Wizard).Select the PIC16F84A device. The IDE asks you to choose the compiler, linker andassembler. Choose the HI-TECH PICC Toolsuite. The IDE now asks for a Projectname and the destination directory for the files of the Project.Figure 2. Screen shot of Project Wizard.

3. Add the source file piclab1.c to the Source file by right-clicking on the SourceFiles icon on the Project window. Click on the icon Debugger and on the Select Toolicon. Choose MPLAB Sim (Debugger- SelectTool- MPLAB Sim). This enables theuser to simulate his/her programs after the compilation process.Figure 3. Adding Source files & Initialising MPLAB Sim.4. Click on the icon Project. Click on the Build All icon (Project- Build All). Youshould get a screen that looks like Figure 4 if the build is successful. In short, this isthe compilation process and is quite similar to the other C compilers that you mighthave used. If the build is unsuccessful, check for syntax errors and the build options(Project- Build Options). The build option provides the user with some controlparameters for deriving the object files.Congratulations, you have successfully finished the orientation to the MPLAB IDE.As a reminder, this tutorial intended to provide instructions for the first-time user ofMPLAB IDE. For complete information on the capabilities of the MPLAB IDE,please visit the Microchip website at http://www.microchip.com. The next section

contains basic information on Simulation using the MPLAB IDE, followed by asection on programming the micro-controller using the PICSTART hardware.Figure 4. Successful compilation & build.II. SimulationSimulation in the MPLAB IDE provides the user with the ability to check for programcorrectness. The design process is shown below in Figure 5. As you can see, Simulationreduces the overhead and the costs involved for a design review and incorporatingchanges to meet the design requirements.

Problem definitionInitial DesignMake requiredchangesSimulationNoMeets allrequirements?YesSystem set-up onboardBoard-level testingNoMeets allrequirements?YesDesign releaseFigure 5. Design process.1. After the build is complete, click on the icon Debugger of the IDE. Click onAnimate (Debugger- Animate). The IDE executes your C program (actually, themachine code but it keeps track of the association) and highlights which statement ofyour C program is being currently executed as in Figure 6. Click on Debugger, youwill find commands like Run, Halt, Step Over, Step Into, Reset and Stop Watch.Explore these commands.

Figure 6. Animation.2. Click on the icon View on the main command line. You will find icons Disassembly,Hardware Stack, Program Memory, File Registers, EEPROM, Watch andSpecial function registers. Explore these commands.III. Programming using the PICSTART PLUS hardwareOnce your simulation is complete and you are satisfied that your design works the wayyou wanted it to be, you are ready to download the machine code on to the microcontroller (Re-usability?). The BUILD process produces a file of the format called theHEX format, which is a standard from Intel.First, make sure that the programmer hardware is connected to the computer. Thehardware looks like the device shown in Figure 7. You are required to place the micro-

controller on to the programmer hardware in the right way. Refer to instructions on theprogrammer for placement of the micro-controller.Figure 7. PICSTART Plus1. From the main menu of the MPLAB IDE, select Programmer- SelectProgrammer- PICSTART Plus.2. Select Configure- Configuration Bits. Set the configuration bits as shown inFigure 8. Also make sure Configure- Device lists PIC 16F84A as the device. Ifnot, change it to the PIC 16F84A.Figure 8. Configuration Bits Window3. From the programmer menu, enable the programmer (Programmer- EnableProgrammer). If the programmer hardware is connected properly, you would beable to execute all the following commands:Blank Check: This checks if the micro-controller is blank.

Program: This is used to program the PIC micro-controller. The HEX file inthe project is downloaded through the cable on to the micro-controller.Verify: This verifies that the program has be loaded properly into the microcontroller.Read: This will read the contents of the PIC micro-controller.Once the Program operation is successful, the user can place the micro-controller onhis/her system and evaluate if the system design is complete.

seamlessly with the MPLAB IDE. Section I provides an introductory tutorial on the MPLAB IDE using the sample C program given for Lab 2.1. Section II provides basic information on simulation in the MPLAB IDE environment followed by another section on programming

Related Documents:

Digital inclusion is defined in various ways and is often used interchangeably with terms such as digital skills, digital participation, digital competence, digital capability, digital engagement and digital literacy (Gann, 2019a). In their guide to digital inclusion for health and social care, NHS Digital (2019) describe digital

The Adept software will indicate the FPGA you have in the Basys2 board. For example, the following figure indicates that the FPGA is the 250 type (roughly 250 thousand gates). The boards

Digital Media Middle East & Middle Eastern Digital Media Awards 29-30 Nov 2022 Riyadh Digital Media Africa & African Digital Media Awards 12-13 July 2022 Virtual Digital Media LATAM & LATAM Digital Media Awards 16-18 Nov 2022 Mexico City Digital Media India & Indian Digital Media Awards 08-10 Mar 2022 Virtual Digital Media Asia &

Digital Communication Systems The term digital communication covers a broad area of communications techniques, including digital transmission and digital radio. Digital transmission, is the transmitted of digital pulses between two or more points in a communication system. Digital radio, is the transmitted of

In October 2016 the Digital Partnership established the Digital Office for Scottish Local Government (Digital Office). It supports councils to become digital businesses through delivery of a work programme focused on Digital Leadership, Digital Foundations and Digital Services. It has a small core team that provides support and digital expertise.

What is our 'digital legacy' Our digital legacy is what remains of us digitally once we die. When we die our digital footprint can inform our digital legacy. Our digital legacy is becoming increasingly important Digital Death Survey 2018. Digital Assets.

Digital Rights & Responsibilities Digital Safety & Security Digital Health & Wellness Digital Citizenship Elements 1st REP - Grades K-2 RESPECT - Digital Etiquette EDUCATE - Digital Literacy PROTECT - Digital Rights & Responsibilities 2nd REP - Grades 3-5 RESPECT - Digital Access

A02 transactions for nonpermanent employees, including: TAU Limited Term T&D assignments Retired Annuitants Emergency 3. 120 transactions for employees who may have been placed in a duplicate position number as a result of the mass update. Departments should run a MIRS report to identify affected employees. In order to limit the fallout and manual processing required, departments should not .