Getting Started With DsPIC30F Digital Signal Controllers User's Guide

  • View
    194

  • Download
    0

Embed Size (px)

Transcript

Getting Started with dsPIC30F Digital Signal Controllers Users Guide

2005 Microchip Technology Inc.

DS70151A

Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained in their particular Microchip Data Sheet. Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchips Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. Microchip is willing to work with the customer who is concerned about the integrity of their code. Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as unbreakable.

Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchips code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.

Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchips products as critical components in life support systems is not authorized except with express written approval by Microchip. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.

Trademarks The Microchip name and logo, the Microchip logo, Accuron, dsPIC, KEELOQ, microID, MPLAB, PIC, PICmicro, PICSTART, PRO MATE, PowerSmart, rfPIC, and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. AmpLab, FilterLab, Migratable Memory, MXDEV, MXLAB, PICMASTER, SEEVAL, SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. Analog-for-the-Digital Age, Application Maestro, dsPICDEM, dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, Linear Active Thermistor, MPASM, MPLIB, MPLINK, MPSIM, PICkit, PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, rfLAB, rfPICDEM, Select Mode, Smart Serial, SmartTel, Total Endurance and WiperLock are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. 2005, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper.

Microchip received ISO/TS-16949:2002 quality system certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona and Mountain View, California in October 2003. The Companys quality system processes and procedures are for its PICmicro 8-bit MCUs, KEELOQ code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchips quality system for the design and manufacture of development systems is ISO 9001:2000 certified.

DS70151A-page ii

2005 Microchip Technology Inc.

Getting Started with dsPIC30F Digital Signal Controllers Table of ContentsPreface ........................................................................................................................... 1 Chapter 1. The dsPIC30F Digital Signal Controller1.1 1.2 1.3 1.4 2.1 2.2 2.3 2.4 2.5 2.6 3.1 3.2 3.3 3.4 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10 4.11 4.12 Introduction ................................................................................................. 7 Architecture ................................................................................................. 7 Device Variants ......................................................................................... 13 Applications ............................................................................................... 14 Introduction ............................................................................................... 15 MPLAB IDE ............................................................................................... 15 Language Tools ........................................................................................ 16 Debugging Tools ....................................................................................... 17 Programming Tools ................................................................................... 20 Development Boards ................................................................................ 21 MPLAB IDE Overview ............................................................................... 25 Projects and Workspaces ......................................................................... 26 Creating a Project ..................................................................................... 26 Building Code ............................................................................................ 30 MPLAB SIM Overview .............................................................................. 33 Opening the Project .................................................................................. 34 Selecting the Simulator ............................................................................. 34 Resetting the Code ................................................................................... 35 Stepping Through the Code ...................................................................... 35 Running the Code ..................................................................................... 36 The Debug Toolbar and Hotkeys .............................................................. 36 Breakpoints ............................................................................................... 37 Watch Window .......................................................................................... 38 Simulator Settings ..................................................................................... 39 Stopwatch ................................................................................................. 40 Trace Buffer .............................................................................................. 41

Chapter 2. The Microchip Development Tools

Chapter 3. MPLAB Integrated Development Environment

Chapter 4. The MPLAB SIM Simulator

2005 Microchip Technology Inc.

DS70151A-page iii

Getting Started with dsPIC30F Digital Signal ControllersChapter 5. The MPLAB ICD 2 In-Circuit Debugger5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.10 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 6.10 6.11 6.12 6.13 6.14 7.1 7.2 7.3 8.1 8.2 8.3 8.4 8.5 8.6 8.7 9.1 9.2 MPLAB ICD 2 Overview ........................................................................... 43 Setting Up the MPLAB ICD 2 .................................................................... 44 Programming the dsPIC Device ............................................................... 46 Resetting the Code ................................................................................... 46 Stepping Through the Code ...................................................................... 47 Running the Code ..................................................................................... 48 The Debug Toolbar and Hotkeys .............................................................. 48 Breakpoints ............................................................................................... 49 Watch Window .......................................................................................... 50 Advanced Breakpoints .............................................................................. 52 MPLAB ICE 4000 Overview ...................................................................... 55 Opening the Project .................................................................................. 57 Special Emulator Devices ......................................................................... 57 Selecting the MPLAB ICE 4000 ................................................................ 58 MPLAB ICE 4000 Settings ........................................................................ 59 Resetting the Code ................................................................................... 61 Stepping Through the Code ...................................................................... 61 Running the Code ..................................................................................... 62 The Debug Toolbar and Hotkeys .............................................................. 62 Breakpoints ............................................................................................... 63 Watch Window .......................................................................................... 64 Stopwatch .................