MICROCHIP dsPICDEM Technical data

dsPICDEM™ 1.1
Development Board
User’s Guide
2003 Microchip Technology Inc. Advance Information DS70099B
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 Microchip's 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 microchip’s 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 intended through suggestion only and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. No representation or warranty is given and no liability is assumed by Microchip Technology Incorporated with respect to the accuracy or use of such information, or infringement of patents or other intellectual property rights arising from such use or otherwise. Use of Microchip’s 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 intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron, dsPIC, K
EELOQ, MPLAB, PIC, PICmicro, PICSTART,
PRO MATE and PowerSmart are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
AmpLab, FilterLab, microID, MXDEV, MXLAB, PICMASTER, SEEVAL, SmartShunt and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A.
Application Maestro, dsPICDEM, dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, microPort, Migratable Memory, MPASM, MPLIB, MPLINK, MPSIM, PICkit, PICDEM, PICDEM.net, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, rfLAB, rfPIC, Select Mode, SmartSensor, SmartTel and Total Endurance are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
Serialized Quick Turn Programming (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.
© 2003, 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 Company’s quality system processes and procedures are for its PICmicro EEPROMs, microperipherals, non-volatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified.
®
8-bit MCUs, KEELOQ
®
code hopping devices, Serial
DS70099B-page ii Advance Information  2003 Microchip Technology Inc.
dsPICDEM™ 1.1
DEVELOPMENT BOARD
USER’S GUIDE

Table of Contents

Preface ........................................................................................................................... 1
Chapter 1. Introduction
1.1 Introduction ..................................................................................................... 7
1.2 Highlights ........................................................................................................ 7
1.3 dsPICDEM 1.1 Development Board Kit ......................................................... 7
1.4 dsPICDEM 1.1 Development Board Features ................................................ 8
1.5 Running the dsPICDEM 1.1 Demonstration Program .................................. 10
1.6 Reference Documents ................................................................................. 10
Chapter 2. Tutorial
2.1 Introduction ................................................................................................... 11
2.2 Highlights ...................................................................................................... 11
2.3 Tutorial Overview ......................................................................................... 11
2.4 Creating the Project ...................................................................................... 11
2.5 Building the Code ......................................................................................... 17
2.6 Programming the Chip ................................................................................. 19
2.7 Debugging the Code .................................................................................... 22
2.8 Summary ...................................................................................................... 26
Chapter 3. Demonstration Program Operation
3.1 Introduction ................................................................................................... 27
3.2 Highlights ...................................................................................................... 27
3.3 Demonstration Program Operation .............................................................. 27
3.4 Data and Control Flow .................................................................................. 34
3.5 dsPIC30F Demonstration Performance Metrics ........................................... 37
3.6 Board Self-Test Code Module Summary ...................................................... 40
Chapter 4. dsPICDEM™ 1.1 Development Hardware
4.1 dsPICDEM 1.1 Development Board Hardware Overview ............................ 41
Appendix A. Hardware Drawings and Schematics
A.1 Introduction .................................................................................................. 47
A.2 Highlights ..................................................................................................... 47
2003 Microchip Technology Inc. Advance Information DS70099B-page iii
dsPICDEM™ 1.1 Development Board User’s Guide
Appendix B. LCD Controller Specification
B.1 Overview ...................................................................................................... 55
B.2 LCD Controller Interface .............................................................................. 55
B.3 Commands ................................................................................................... 56
B.4 General Commands ..................................................................................... 58
B.5 Character Commands .................................................................................. 59
B.6 Pixel Commands .......................................................................................... 61
B.7 Column Commands ..................................................................................... 62
B.8 Examples ..................................................................................................... 63
Index .............................................................................................................................65
Worldwide Sales and Service .....................................................................................68
DS70099B-page iv Advance Information  2003 Microchip Technology Inc.

INTRODUCTION

HIGHLIGHTS

dsPICDEM™ 1.1
DEVELOPMENT BOARD
USER’S GUIDE

Preface

This chapter contains general information about this user’s guide and customer support that will be useful prior to using the dsPICDEM 1.1 Development Board.
Items discussed in this chapter are:
• About this Guide
• Warranty Registration
• Recommended Reading
• Troubleshooting
• Microchip On-Line Support
• Customer Change Notification Service
• Customer Support

ABOUT THIS GUIDE

This document describes how to use the dsPICDEM 1.1 Development Board. The manual layout is as follows:
Chapter 1: Introduction – This chapter introduces the dsPICDEM 1.1
Development Board and provides a brief description of the hardware.
Chapter 2: Tutorial – This chapter goes through a basic step-by-step process for
getting your dsPICDEM 1.1 Development Board up and running with the MPLAB In-Circuit Debugger 2 (ICD 2).
Chapter 3: Demonstration Program Operation – This chapter presents a
detailed description of the operational functionality of the sample code, which is preprogrammed into the dsPIC30F device.
Chapter 4: dsPICDEM 1.1 Development Board Hardware – This chapter
presents the features of the dsPICDEM 1.1 Development Board in more detail.
Appendix A: Hardware Schematics – This Appendix illustrates the
dsPICDEM 1.1 Development Board layout and hardware schematic diagrams.
Appendix B: LCD Controller Specification – This section presents the 122 x 32
Graphics LCD Controller Interface Specifications.
Index – This section provides cross-reference listing of terms, features and
sections of this document.
Worldwide Sales and Service – A listing of Microchip sales and service locations
and telephone numbers worldwide.
®
2003 Microchip Technology Inc. Advance Information DS70099B-page 1
dsPICDEM™ 1.1 Development Board User’s Guide
Conventions Used in This Guide
This manual uses the following documentation conventions:
TABLE 1: DOCUMENTATION CONVENTIONS
Description Represents Examples
Code (Courier font):
Plain characters Sample code
Filenames and paths
Square brackets [ ] Optional arguments pic30-as [main.s]
Curly brackets and pipe character: { | }
Lower case characters in quotes
Ellipses... Used to imply (but not show)
0xnnnn A hexadecimal number where n is a
Italic characters A variable argument; it can be either a
Interface (Arial font):
Underlined, italic text with right arrow
Bold characters A window or dialog button to click OK, Cancel
Characters in angle brackets < >
Documents (Arial font):
Italic characters Referenced books MPLAB IDE User’s Guide
Choice of mutually exclusive arguments; an OR selection
Type of data
additional text that is not relevant to the example
hexadecimal digit
type of data (in lower case characters) or a specific example (in upper case characters)
A menu selection from the menu bar File > Save
A key on the keyboard <Tab>, <Ctrl-C>
#define START c:\autoexec.bat
errorlevel {0|1}
"filename"
list
"list_option...,
[
"list_option"]
0xFFFF, 0x007A
char isascii (char, ch);
Documentation Updates
All documentation becomes dated, and this user’s guide is no exception. Since the dsPICDEM 1.1 Development Board User’s Guide and other Microchip tools are constantly evolving to meet customer needs, some actual dialogs and/or tool descriptions may differ from those in this document. Please refer to our web site to obtain the latest documentation available.
Documentation Numbering Conventions
Documents are numbered with a “DS” number. The number is located on the bottom of each page, in front of the page number. The numbering convention for the DS Number is: DSXXXXXA;
where:
XXXXX = The document number.
A = The revision level of the document.

WARRANTY REGISTRATION

Please complete the enclosed Warranty Registration Card and mail it promptly. Sending in your Warranty Registration Card entitles you to receive new product updates. Interim software releases are available at the Microchip web site.
DS70099B-page 2 Advance Information  2003 Microchip Technology Inc.

RECOMMENDED READING

This user’s guide describes how to use the dsPICDEM 1.1 Development Board. Other useful documents are listed below:
dsPIC30F Family Reference Manual (DS70046)
Consult this document for detailed information on the dsPIC30F device operation. The manual explains the operation of the dsPIC30F MCU family architecture and peripheral modules but does not cover the specifics of each device. Refer to the appropriate device data sheet, mentioned below, for device-specific information.
dsPIC30F Data Sheet, Motor Control and Power Conversion Family (DS70082)
Consult this document for information regarding the dsPIC30F Motor Control and Power Conversion devices. Reference information found in this data sheet includes:
• Device memory map
• Device pinout and packaging details
• Device electrical specifications
• List of peripherals included on the device
dsPIC30F Data Sheet, General Purpose and Sensor Families (DS70083)
Consult this document for information regarding the dsPIC30F Sensor and General Purpose devices. Reference information found in this data sheet includes:
• Device memory map
• Device pinout and packaging details
• Device electrical specifications
• List of peripherals included on the device
dsPIC30F Programmer’s Reference Manual (DS70030)
This manual is a software developer’s reference for the dsPIC30F 16-bit MCU family of devices. This manual describes the instruction set in detail and also provides general information to assist the user in developing software for the dsPIC30F MCU family.
dsPIC30F Family Overview, dsPIC High Performance 16-bit Digital Signal Controller (DS70043)
This document provides an overview of the features and functionality of the dsPIC product family. It helps determine how the dsPIC 16-bit Digital Signal Controller Family fits a specific product application. For detailed information about any of the functionality, refer to the dsPIC30F Family Reference Manual (DS70046).
MPLAB ASM30, MPLAB LINK30 and Utilities User’s Guide (DS51317)
This document details Microchip Technology’s language tools for dsPIC devices based on GNU technology. The language tools discussed are:
• MPLAB ASM30 Assembler
• MPLAB LINK30 Linker
• MPLAB LIB30 Archiver/Librarian
• Other Utilities
MPLAB C30 C Compiler User’s Guide (DS51284)
The purpose of this document is to help you use Microchip’s MPLAB C30 C compiler for dsPIC devices to develop your application. MPLAB C30 is a GNU-based language tool, based on source code from the Free Software Foundation (FSF). For more information about the FSF, see www.fsf.org.
Preface
®
2003 Microchip Technology Inc. Advance Information DS70099B-page 3
dsPICDEM™ 1.1 Development Board User’s Guide
Other GNU language tools available from Microchip are:
• MPLAB ASM30 Assembler
• MPLAB LINK30 Linker
• MPLAB LIB30 Librarian/Archiver
MPLAB IDE Simulator, Editor User’s Guide (DS51025)
Consult this document for more information pertaining to the installation and features of the MPLAB Integrated Development Environment (IDE) Software.
To obtain any of these documents, contact the nearest Microchip sales location (see back page) or visit the Microchip web site at: www.microchip.com.

THE MICROCHIP WEB SITE

Microchip provides online support on the Microchip World Wide Web (WWW) site. The web site is used by Microchip as a means to make files and information easily available to customers. To view the site, you must have access to the Internet and a web browser, such as, Netscape Navigator
The Microchip web site is available by using your favorite Internet browser to reach:
http://www.microchip.com
The web site provides a variety of services. Users may download files for the latest development tools, data sheets, application notes, user’s guides, articles and sample programs. A variety of information specific to the business of Microchip is also available, including listings of Microchip sales offices, distributors and factory representatives.
®
or Microsoft® Internet Explorer.
Technical Support
• Frequently Asked Questions (FAQ)
• Online Discussion Groups – conferences for products, development systems, technical information and more
• Microchip Consultant Program Member Listing
• Links to other useful web sites related to Microchip products
Engineer’s Toolbox
•Design Tips
• Device Errata
Other Available Information
• Latest Microchip Press Releases
• Listing of seminars and events
• Job Postings
DS70099B-page 4 Advance Information  2003 Microchip Technology Inc.

DEVELOPMENT SYSTEMS CUSTOMER NOTIFICATION SERVICE

Microchip started the customer notification service to help our customers keep current on Microchip products with the least amount of effort. Once you subscribe, you will receive e-mail notification whenever we change, update, revise or have errata related to a specified product family or development tool of interest.
Go to the Microchip web site at (http://www.microchip.com) and click on Customer Change Notification. Follow the instructions to register.
The Development Systems product group categories are:
• Compilers
•Emulators
• In-Circuit Debuggers
• MPLAB IDE
• Programmers
Here is a description of these categories:
Compilers – The latest information on Microchip C compilers and other language tools. These include the MPLAB C17, MPLAB C18 and MPLAB C30 C compilers; MPASM™ and MPLAB ASM30 assemblers; MPLINK™ and MPLAB LINK30 object linkers; MPLIB™ and MPLAB LIB30 object librarians.
Emulators – The latest information on Microchip in-circuit emulators. This includes the MPLAB ICE 2000 and MPLAB ICE 4000.
In-Circuit Debuggers – The latest information on Microchip in-circuit debuggers. These include the MPLAB ICD and MPLAB ICD 2.
MPLAB IDE – The latest information on Microchip MPLAB IDE, the Windows Integrated Development Environment for development systems tools. This list is focused on the MPLAB IDE, MPLAB SIM and MPLAB SIM30 simulators, MPLAB IDE Project Manager and general editing and debugging features.
Programmers – The latest information on Microchip device programmers. These include the PRO MATE programmer.
®
II device programmer and PICSTART® Plus development
Preface
2003 Microchip Technology Inc. Advance Information DS70099B-page 5
dsPICDEM™ 1.1 Development Board User’s Guide

CUSTOMER SUPPORT

Users of Microchip products can receive assistance through several channels:
• Distributor or Representative
• Local Sales Office
• Field Application Engineer (FAE)
• Corporate Applications Engineer (CAE)
• Hotline
Customers should call their distributor, representative or field application engineer (FAE) for support. Local sales offices are also available to help customers. See the back cover for a list of sales offices and locations.
Corporate Applications Engineers (CAEs) may be contacted at (480) 792-7627.
In addition, there is a Systems Information and Upgrade Line. This line provides system users a list of the latest versions of all of Microchip’s development systems software products. Plus, this line provides information on how customers can receive any currently available upgrade kits.
The Hotline Numbers are:
1-800-755-2345 for U.S. and most of Canada.
1-480-792-7302 for the rest of the world.
DS70099B-page 6 Advance Information  2003 Microchip Technology Inc.
DEVELOPMENT BOARD
5

Chapter 1. Introduction

1.1 INTRODUCTION

The dsPICDEM 1.1 Development Board Kit serves as a development and evaluation tool for the dsPIC30F High Performance Digital Signal Controllers.

1.2 HIGHLIGHTS

This chapter discusses:
• dsPICDEM 1.1 Development Board Kit
• dsPICDEM 1.1 Development Board Features
• Running the
• Reference Documents

1.3 dsPICDEM 1.1 DEVELOPMENT BOARD KIT

dsPICDEM 1.1 Demonstration Program
dsPICDEM™ 1.1
USER’S GUIDE
The dsPICDEM 1.1 Development Board Kit contains the following items:
• The dsPICDEM 1.1 Printed Circuit Board (Figure 1-1)
• Preprogrammed dsPIC30F6014 Plug-in Module (Figure 1-2)
• 9V DC Power Supply
• RS-232 Interface Cable
• dsPICDEM 1.1 Development Board Kit CD containing demonstration programs
FIGURE 1-1:
5
2
dsPICDEM 1.1 DEVELOPMENT BOARD
7
10
26
9
8 7
8
6
25
13
10
4
3
3
11
14
12
4
18
16
2003 Microchip Technology Inc. Advance Information DS70099B-page 7
1
dsPICDEM™ 1.1 Development Board User’s Guide
FIGURE 1-2: dsPIC30F6014 PLUG-IN MODULE

1.4 dsPICDEM 1.1 DEVELOPMENT BOARD FEATURES

The dsPICDEM 1.1 Development Board supports the following features:
Development Board Power
• Separate on-board +5V regulators for VDD and AVDD with direct input from 9V, AC/DC wall adapter
• 9V DC power source input jack for development board
• LED Power-on indicator
MPLAB ICD 2 and MPLAB ICE 4000 Connections
• MPLAB ICD 2 programming connector
• Jumper J8 for selection of processor interfaced to the MPLAB ICD 2 Debugger/Programmer
• Emulation header for connection to MPLAB ICE 4000 Emulator
• Pad location for 80-pin TQFP dsPIC device
Serial Communication Channels
• Two RS-232 communication channels
• 6-pin terminal block and configuration jumper for RS-485 and RS-422 communication on UART1 from the dsPIC device
• Single CAN communication channel
DS70099B-page 8 Advance Information  2003 Microchip Technology Inc.
Introduction
Voice-band Codec
• Si3000 Voice-band Codec chip
• Jumper J9 for selection of Si3000 Codec mode (Master/Slave)
• Socket U6, optional clock oscillator for Si3000 Voice-band Codec
• 4-pin header for the Codec Line In and Line Out
• One 3.5 mm phono jack for the Codec left and right speaker outputs
• One 3.5 mm phono jack for the Codec MIC input
• Codec reset push button switch
Analog
• Three 5 k Potentiometers (RP1-RP3)
• Microchip TC1047A Thermal Sensor (U9)
• MCP41010 Digital Potentiometer
• MCP602 Operational Amplifiers configured as low-pass filters for temperature sensor and digital potentiometer
Device Clocking
• 7.3728 MHz crystal, X3, for dsPIC device
• Socket U5, clock oscillator for dsPIC device (alternate clock source, X3 removed)
• Pad for 32.768 kHz crystal and load caps
Miscellaneous
• Reset push button switch and jumper (J10) for resetting the PIC18F242 LCD controller or the dsPIC device
• Four red LEDs (LED1-LED4)
• Four push button switches (SW1-SW4) for external input stimulus
• 122 x 32 dot addressable LCD
• PIC18F242 LCD controller
• 2 x 50 prototyping header for user hardware expansion (header not installed)
• Prototype area for user hardware
2003 Microchip Technology Inc. Advance Information DS70099B-page 9
dsPICDEM™ 1.1 Development Board User’s Guide

1.5 RUNNING THE dsPICDEM 1.1 DEMONSTRATION PROGRAM

The dsPICDEM 1.1 Development Board is supplied with a pre-loaded demonstration program that exercises principal CPU functions and peripheral options that interact with typical user application programs.
When you apply power to the dsPICDEM 1.1 Development Board, the LCD menu displays these demonstration functions:
• Data Acquisition Display
• Digital Signal Processing (DSP) Operations
• Dual Tone Multi-Frequency (DTMF) Generation
Switches SW2-SW4 select one of these three choices. Each choice offers a submenu, which provides for additional options using switches SW1-SW4.
Refer to Chapter 3. “Demonstration Program Operation” for full details on the demonstration code operation.

1.6 REFERENCE DOCUMENTS

The following documentation is available to support the use of the dsPICDEM 1.1 Development Board:
• dsPIC30F Family Reference Manual (DS70046)
• dsPIC30F Data Sheet, Motor Control and Power Conversion Family (DS70082)
• dsPIC30F Data Sheet, General Purpose and Sensor Families (DS70083)
• dsPIC30F Programmer’s Reference Manual (DS70030)
• dsPIC30F Family Overview, dsPIC High Performance 16-bit Digital Signal Controller (DS70043)
• MPLAB C30 C Compiler User’s Guide (DS51284)
• MPLAB ASM30, MPLAB LINK30 and Utilities User’s Guide (DS51317)
• MPLAB ICD 2 In-Circuit Debugger Quick Start Guide (DS51268)
• MPLAB ICE Emulator User’s Guide (DS51159)
You can obtain these reference documents from your nearest Microchip sales office (listed in the back of this document) or you can download them from the Microchip web site (www.microchip.com).
DS70099B-page 10 Advance Information  2003 Microchip Technology Inc.

2.1 INTRODUCTION

This chapter is a self-paced tutorial to get you started using the dsPICDEM 1.1 Development Board.

2.2 HIGHLIGHTS

Items discussed in this chapter include:
• Tutorial Overview
• Creating the Project
• Building the Code
• Programming the Chip
• Debugging the Code
• Summary
dsPICDEM™ 1.1
DEVELOPMENT BOARD
USER’S GUIDE

Chapter 2. Tutorial

2.3 TUTORIAL OVERVIEW

The tutorial program in Tut6014.s is written in assembly code. This program displays text on the LCD and flashes an LED. The source file is used with a linker script file (p30f6014.gld) and an include file (p30f6014.inc) to form a complete project. The tutorial is a simple project that uses a single source code file. More complex projects might use multiple assembler and compiler source files as well as library files and precompiled object files. For simplicity, this tutorial uses only one source file.
There are four steps to this tutorial:
1. Create a project in MPLAB IDE.
2. Assemble and link the code.
3. Program the chip with the MPLAB ICD 2.
4. Debug the code with the MPLAB ICD 2.

2.4 CREATING THE PROJECT

The first step is to create a project and a workspace in MPLAB IDE. Usually, you will have one project in one workspace.
Note: These instructions presume the use of MPLAB 6.31 or newer.
A project contains the files needed to build an application (source code, linker script files, etc.) along with their associations to various build tools and build options.
A workspace contains one or more projects and information on the selected device, debug tool and/or programmer, open windows and their location, and other IDE configuration settings.
2003 Microchip Technology Inc. Advance Information DS70099B-page 11
dsPICDEM™ 1.1 Development Board User’s Guide
MPLAB IDE contains a Project Wizard to help create new projects. Before starting, create a folder for the project files for this tutorial (C:\Tutorial is assumed in the instructions that follow). From the dsPICDEM 1_1 Development Board
code\Tutorial Code folder on the dsPICDEM 1.1 Development Kit CD, copy the Tut6014.s file into the C:\Tutorial folder.
Note: All files copied from the CD are read only. If the file needs to be edited, the
attributes will need to be changed.

2.4.1 Select a Device

1. Start MPLAB IDE.
2. Close any workspace that might be open (File>Close Workspace
3. From the Project
4. From the Welcome screen, click Next> to display the Project Wizard Step One
dialog (see Figure 2-1).
FIGURE 2-1: PROJECT WIZARD, STEP 1, SELECT A DEVICE
menu, select Project Wizard.
).
5. From the Device: pull-down list, select dsPIC30F6014 and click Next>. The
Project Wizard Step Two dialog displays (see Figure 2-2).
DS70099B-page 12 Advance Information  2003 Microchip Technology Inc.
Tutorial
FIGURE 2-2: PROJECT WIZARD, STEP 2, SELECT LANGUAGE
TOOLSUITE

2.4.2 Select Language Toolsuite

1. From the Active Toolsuite: pull-down menu, select Microchip C30 Toolsuite.
This toolsuite includes the assembler and linker that will be used (the C Compiler is not used).
2. In the Toolsuite Contents block, select MPLAB ASM30 Assembler (pic30-as.exe).
3. In the Location block, click Browse... and navigate to:
E:\MPLAB IDE\dsPIC_Tools\Bin\pic30-as.exe
4. With MPLAB LINK 30 Object Linker (pic30-Id.exe) selected in Toolsuite Contents, click Browse... and navigate to:
E:\MPLAB IDE\dsPIC_Tools\Bin\pic30-ld.exe
5. Click Next> to continue. The Project Wizard Step Three dialog displays (see Figure 2-3).
Note: The tool locations for your environment may be different from those shown
in this tutorial.
2003 Microchip Technology Inc. Advance Information DS70099B-page 13
dsPICDEM™ 1.1 Development Board User’s Guide
FIGURE 2-3: PROJECT WIZARD, STEP 3, NAME YOUR PROJECT

2.4.3 Name Your Project

1. In the Project Name text box, type MyProject.
2. Click Browse... and navigate to C:\Tutorial to place your project in the
Tutorial folder.
3. Click Next> to continue. The Project Wizard Step Four dialog displays
(see Figure 2-4).
DS70099B-page 14 Advance Information  2003 Microchip Technology Inc.
Tutorial
FIGURE 2-4: PROJECT WIZARD, STEP 4, ADD FILES TO PROJECT

2.4.4 Add Files to Project

1. Locate the C:\Tutorial folder and select the Tut6014.s file.
2. Click Add>> to include the file in the project.
3. Expand the E:\MPLAB IDE\dsPIC_Tools\support\gld folder and select the p30f6014.gld file.
4. Click Add>> to include the file in the project. There should now be two files in the project.
5. Click Next> to continue.
6. When the summary screen displays, click Finish.
After the project wizard completes, the MPLAB IDE project window shows the
Tut6014.s file in the Source Files folder and the p30f6014.gld file in the Linker Scripts folder (see Figure 2-5).
2003 Microchip Technology Inc. Advance Information DS70099B-page 15
dsPICDEM™ 1.1 Development Board User’s Guide
FIGURE 2-5: MPLAB IDE PROJECT WINDOW
A project and workspace has now been created in MPLAB IDE. MyProject.mcw is the workspace file and MyProject.mcp is the project file. Double-click the Tut6014.s file in the project window to open the file. MPLAB IDE should now look similar to Figure 2-6.
FIGURE 2-6: MPLAB IDE WORKSPACE WINDOWS
Project Window
Output Window
Source Code Window
DS70099B-page 16 Advance Information  2003 Microchip Technology Inc.

2.5 BUILDING THE CODE

In this project, building the code consists of assembling the Tut6014.s file to create an object file, Tut6014.o, and then linking the object file to create the Tut6014.hex and Tut6014.cof output files. The .hex file contains the data necessary to program the device and the .cof file contains additional information that lets you debug at the source code level.
Before building, there are settings required to tell MPLAB IDE where to find the include files and to reserve space for the extra debug code when the MPLAB ICD 2 is used.
The following line is near the top of the Tut6014.s file:
.include "p30f6014.inc"
This line causes a standard include file to be used. Microchip provides these files with all the Special Function Register (SFR) labels already defined for convenience.
To build the code, select Build Options>Project Options dialog displays, as shown in Figure 2-7.
FIGURE 2-7: BUILD OPTIONS
Tutorial
from the Project> menu. The Build
Browse to the location of the assembler Include file
2003 Microchip Technology Inc. Advance Information DS70099B-page 17
dsPICDEM™ 1.1 Development Board User’s Guide

2.5.1 Identify Assembler Include Path

1. Select the General tab.
2. At the Assembler Include Path, $(AINDIR) box, click Browse... and navigate
to:
E:\MPLAB IDE\dsPIC_Tools\support\inc
This path tells MPLAB IDE where to find the Include files.

2.5.2 Link for ICD 2

1. Select the MPLAB LINK30 tab to view the linker settings (see Figure 2-8).
2. Check Link for ICD 2.
3. Click OK. The text box closes while the linker reserves space for the debug code
used by the MPLAB ICD 2.
4. Click OK again to save these changes. The project is now ready to build.
FIGURE 2-8: MPLAB LINK30 BUILD OPTIONS
Check Link for ICD2
DS70099B-page 18 Advance Information  2003 Microchip Technology Inc.
Loading...
+ 50 hidden pages