An Introduction To The MPLAB Integrated Development Environment

1y ago
3 Views
1 Downloads
1.37 MB
39 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Elise Ammons
Transcription

Microchip Technology Incorporated An Introduction to the MPLAB Integrated Development Environment This seminar is an introduction to the MPLAB Integrated Development Environment. My name is Darrel Johansen and I’m a manager for the Development Systems Group here at Microchip Technology. Page 1

What Is MPLAB IDE? MPLAB IDE is a software program that runs on your PC to provide a development environment for your embedded system design. www.microchip.com/mplab An Introduction to MPLAB IDE 2 What is MPLAB IDE? MPLAB IDE is a software program that runs on your development environment for your embedded microcontroller design. You can download MPLAB IDE for free at microchip.com/mplab. Page 2

Design Cycle 1. 2. 3. 4. 5. High Level Design Software Coding Generate Executable Test “Burn” into Device An Introduction to MPLAB IDE 3 The design cycle for developing an embedded controller application is: 1) Do the high level design – From the features and performance desired, decide which PICmicro or dsPIC device you need, then design the associated hardware circuitry. 2) Knowing which peripherals and pins control your hardware, write the software. Use either assembly language, which is directly translatable into machine code, or using a compiler that allows a more natural language for creating programs. With these Language Tools you can write and edit code that is more or less understandable, with constructs that help you organize your code. 3) Compile or assemble the software using a Language Tool to convert your code into machine code for the PICmicro device. This machine code will eventually becomes firmware, the code programmed into the microcontroller. 4) Test your code. Usually a complex program does not work exactly the way you might have imagined, and “bugs” need to be removed from your design to get it to act properly. 5) “Burn” your code into a microcontroller and verify that it executes correctly in your finished application. This seminar will show you how MPLAB can do steps 1 through 4. Step 5 will require some hardware and will be covered in another seminar. Page 3

First Project O Create Project O Build Project O Test Code with Simulator An Introduction to MPLAB IDE 4 This exercise will show you how to put together a project framework, how to build an application, and how to test it with the simulator to verify that it works as expected. Page 4

MPLAB Desktop An Introduction to MPLAB IDE 5 After you have downloaded and installed MPLAB IDE, you can start it up, and you’ll see a standard windows graphical user interface Page 5

MPLAB Desktop Menus An Introduction to MPLAB IDE 6 with menus Page 6

MPLAB Desktop Toolbar An Introduction to MPLAB IDE 7 toolbar icons Page 7

MPLAB Desktop Status Bar An Introduction to MPLAB IDE 8 and a status bar. Page 8

MPLAB Desktop An Introduction to MPLAB IDE 9 To get started, we’ll use the Project Wizard, which is selected from the Project menu. Many of our development boards and starter kits come with finished projects that you can load and examine. The Project Wizard makes it very easy to set up a new project. Page 9

Create A Project An Introduction to MPLAB IDE 10 The first thing the wizard asks for is to define which processor you are using. We’ll use one of the 16-bit dsPIC Digital Signal Controllers for this project. Page 10

Project Wizard An Introduction to MPLAB IDE 11 If you have installed any C compilers, they will show up in this list. If not, you may only see the free assemblers that come with MPLAB IDE. Note that all of Microchip’s C Compilers can be downloaded for free evaluation. Page 11

Project Wizard An Introduction to MPLAB IDE 12 Next we’ll browse to the folder to store our project and name it “ProjectX.” Page 12

Project Wizard An Introduction to MPLAB IDE 13 We have already written the code for this project, so we simply add them to our project, selecting them from the left file listing Page 13

Project Wizard An Introduction to MPLAB IDE 14 and pressing the “Add ” button Page 14

Project Wizard An Introduction to MPLAB IDE 15 to make them show up in the right pane. If you had not written any code yet, you easily can add files to the project later. Page 15

Project Wizard An Introduction to MPLAB IDE 16 And that’s all there is to creating the project. The summary screen tells us that we’re using a dsPIC33 processor with MPLAB C for the PIC30 (also called C30), and that the project is in a folder on drive C:. Page 16

Wizard An Introduction to MPLAB IDE 17 When we exit the project wizard, the project window will look like this. Page 17

Wizard An Introduction to MPLAB IDE 18 If the project window is not shown, pull down the View menu and select the project window. Page 18

Select Simulator An Introduction to MPLAB IDE 19 In order to test the code, we need a debug tool. MPLAB SIM is a debug tool. It is software simulator that can be used to test code on the PC. Page 19

Select Simulator An Introduction to MPLAB IDE 20 Select the Debugger Tool pull down menu Page 20

Select Simulator An Introduction to MPLAB IDE 21 .scroll over to “Select Tool” and the submenu will pop up so we can select “MPLAB SIM.” Page 21

Build Project An Introduction to MPLAB IDE 22 Now we can build the project by selecting “Build Project” under the project menu pull down Page 22

Or Build Project An Introduction to MPLAB IDE 23 or use the Build All icon from the tool bar. The output window will pop up and tell us if the project built correctly. Page 23

Set Initial Breakpoint Double click An Introduction to MPLAB IDE 24 If we double click on the file named “main.c” in the project window, it will open in the programmer’s text editor window. Here, we scrolled down to the function, “main.” Using the right mouse button, we set a breakpoint two lines into the function, as indicated by the red symbol with a “B.” Page 24

Run To Breakpoint An Introduction to MPLAB IDE 25 Next we select “Run” from the Debugger menu Page 25

Run To Breakpoint Or An Introduction to MPLAB IDE 26 or the green arrow on the tool bar. Page 26

Set Initial Breakpoint An Introduction to MPLAB IDE 27 Now we can single step through the code from our breakpoint. Use the Debugger menu pulldown Page 27

Set Initial Breakpoint Or An Introduction to MPLAB IDE 28 or the toolbar icon to step. Page 28

Set Initial Breakpoint An Introduction to MPLAB IDE 29 We can continue stepping through the code Page 29

Set Initial Breakpoint An Introduction to MPLAB IDE 30 Page 30

Set Initial Breakpoint An Introduction to MPLAB IDE 31 Page 31

Set Initial Breakpoint An Introduction to MPLAB IDE 32 Page 32

Watch Window An Introduction to MPLAB IDE 33 And that’s how to get started. If you want to look at variables and their values, you can open the Watch window, which is on the View pulldown, and add variables to be viewed. Page 33

Summary: The Next Step O Other main debugging features: O Step-Into/Step-Over An Introduction to MPLAB IDE 34 Once you are familiar with these basic steps, you are ready to go on to explore the power of the MPLAB tool. You might wish to explore the difference between Step-Into and Step-Over. Page 34

Summary: The Next Step O Other main debugging features: Step-Into/Step-Over O Trace O An Introduction to MPLAB IDE 35 As an alternative to breakpoints, you can choose to trace your code with a record of instruction execution Page 35

Summary: The Next Step O Other main debugging features: Step-Into/Step-Over O Trace O Change variable in Watch window O An Introduction to MPLAB IDE 36 You can change variable values in the Watch window to see the effects on your application Page 36

Summary: The Next Step O Other main debugging features: Step-Into/Step-Over O Trace O Change variable in Watch window O Complex breakpoints O An Introduction to MPLAB IDE 37 And you can set complex breakpoints on particular variable values or sequences of events. Page 37

Summary: The Next Step O Other main debugging features: Step-Into/Step-Over O Trace O Change variable in Watch window O Complex breakpoints O Many, many other features: O Tabbed editor Color highlighted text Version control support Macros Custom hot keys Free C compilers Powerful plug-ins Mouse over variable Stimulus generator Dockable windows An Introduction to MPLAB IDE HW Debuggers Programmers Third party tools Data Monitor and Control Interface Stopwatch Code coverage 38 There is a lot more to MPLAB than we’ve covered here. Some features are listed here. All are covered in the on-line documentation that comes with MPLAB. Once you have the basics mastered, it’s easy to explore and find valuable tools to assist in your development efforts. Page 38

Download MPLAB and Try It! WWW.MICROCHIP.COM/MPLAB An Introduction to MPLAB IDE 39 If you haven’t already done it, now is the time to get started with MPLAB IDE. For an overview of more of Microchip’s development tools, you might wish to view the web seminar titled “An Introduction to Microchip’s Development Tools.” To get MPLAB for free, simply go to our web site at microchip.com/mplab. This is the end of our presentation. Thank you for your time. Page 39

MPLAB Integrated Development Environment This seminar is an introduction to the MPLAB Integrated Development Environment. My name is Darrel Johansen and I'm a manager for the Development Systems Group here at Microchip Technology. Page 2 An Introduction to MPLAB IDE 2

Related Documents:

MPLAB X CCS C Compiler Tutorial How to install the CCS C Compiler inside MPLAB X Before the CCS C Compiler can be used inside MPLAB X, the CCS C MPLAB X Plug-in must be installed. This process can be done inside MPLAB X. 1. Launch MPLAB X. 2. From the MPLAB X menu, select Tools - Plugins 3.

MPLAB C18 C Compiler The layout of this document: –Installing MPLAB C18: A step-by-step guide through the installation process of MPLAB C18 Compiler. –Configuring MPLAB IDE: MPLAB IDE setup for use with MPLAB C18. Basics of MPLAB IDE configuration to run your Program

MPLAB SIM MPLAB ICE 2000 MPLAB ICD 2 MPLAB ICE 4000 MPLAB IDE Debugger The other debug engines are hardware devices, while MPLAB SIM is a software program, running on your PC. MPLAB SIM provides many of the same features as in-circuit emulators and in-circuit debuggers.

Chapter 1: MPLAB IDE Preview – An overview of what MPLAB IDE is and how it works. Chapter 2: MPLAB IDE Installation – How to install MPLAB IDE on your computer. Chapter 3: Getting Started with MPLAB IDE – A Tutorial – How to begin using MPLAB IDE. Chapter 4: MPLAB IDE Projects Tuto

MPLAB X IDE The latest information on Microchip MPLAB X IDE, the Windows Integrated Development Environment for dev elopment systems tools. This list is focused on the MPLAB IDE, MPLAB ID E Project Manager, MPLAB Editor and MPLAB SIM simu

MPLAB Harmony provides a MPLAB Harmony Configurator (MHC) MPLAB X IDE plug-in that can be installed in MPLAB X IDE to help you create your own MPLAB Harmony applications. To create a new MPLAB

MPLAB Harmony provides a convenient MPLAB X IDE plug-in configuration utility, the MPLAB Harmony Configurator (MHC), which you can use to easily create MPLAB Harmony-based projects. This tutorial will show you how to use the MHC to quickly create your first MPLAB Harmony application using the following steps: Step 1: Create a New Project

Starting MPLAB SIM MPLAB Desktop You should already be familiar with MPLAB IDE before going through this seminar. You might want to watch the “Introduction to MPLAB” seminar first. The MPLAB IDE desktop has all the standard