MICROCHIP MPLAB ICD USER’S GUIDE

MPLAB-ICD
USER'S GUIDE
USER’S GUIDE
Information contained in this publication regarding device applications and the like is intended by way of suggestion only. 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. Use of Microchip’s products as critical components in life support systems is not authorized except with express written approval by Microchip.
1999 Microchip Technology Incorporated. All rights reserved. The Microchip logo and n ame, PIC , P IC MASTER , PICSTAR T, PRO M ATE, a nd PI C micro a re re gis tered rademarks of
Microchip Technology Incorporated in the U.S.A. and other countries. MPLAB, and In-Circuit Serial Programming (ICSP) are trademarks of Microchip Technology in the U.S.A. and other countries.
All product/company trademarks mentioned herein are the property of their respective companies.
1999 Microchip Technology Inc. DS51184A
MPLAB™-ICD User’s Guide
DS51184A 1999 Microchip Technology Inc.
MPLAB™-ICD USER’S GUIDE
Table of Contents
General Information ...................................................................................1
Introduction ..................................................................................... 1
Highlights ........................................................................................1
About This Guide .......................................... .... ............................ ..1
Warranty Registration .....................................................................2
Recommended Reading .................................................................3
Troubleshooting ..............................................................................3
The Microchip Internet Web Site ....................................................4
Development Systems Customer Notification Service ................... 5
Customer Support ................. ..... ..... .... ............................ ..... ..... ......7
Chapter 1. MPLAB-ICD Preview ..............................................................9
1.1 Introduction ..................................................................................... 9
1.2 Highlights ........................................................................................9
1.3 What is MPLAB-ICD ............. ..... ..... .... ............................ ..... ..... .... ..9
1.4 How MPLAB-ICD Helps You ........................................................10
1.5 Trade-offs of Using MPLAB-ICD ...................................................10
1.6 MPLAB-ICD Components ........................................... ..................11
1.7 MPLAB Integrated Development Environment .............................13
1.8 MPLAB Development Tools ..........................................................14
Chapter 2. MPLAB-ICD Installation.......................................................15
2.1 Introduction ................................................................................... 15
2.2 Highlights ......................................................................................15
2.3 MPLAB-ICD Kit Components ........................ .... ............................15
2.4 Host Computer System Requirements .........................................16
2.5 Installing the Hardware .................................................................17
2.6 Installing the Software ..................................................................18
1999 Microchip Technology Inc. DS51184A-page iii
MPLAB™-ICD User’s Guide
Chapter 3. Getting Started with MPLAB-ICD .......................................19
3.1 Introduction ...................................................................................19
3.2 Highlights ......................................................................................19
3.3 Communicating with MPLAB-ICD .................................................19
3.4 MPLAB-ICD Operations ................................................................20
3.5 Getting the Most from MPLAB – Using Projects ...........................21
Chapter 4. MPLAB-ICD Basic Functions..............................................23
4.1 Introduction ...................................................................................23
4.2 Highlights ......................................................................................23
4.3 The MPLAB-ICD Dialog ................................................................23
4.4 Program Execution ........................................................................28
4.5 Breakpoints ...................................................................................28
4.6 How to use MPLAB-ICD ................................................................29
Chapter 5. Demo Board Example of Use..............................................31
5.1 Introduction ...................................................................................31
5.2 Highlights ......................................................................................31
5.3 A/D Example Overview .................................................................31
5.4 A/D Example Main Routine ...........................................................32
5.5 A/D Example Source Code ...........................................................34
Chapter 6. MPLAB-ICD Menu Options..................................................37
6.1 Introduction ...................................................................................37
6.2 Highlights ......................................................................................37
6.3 File Menu ......................................................................................37
6.4 Debug Menu ..................................................................................37
6.5 Options Menu ................................................................................38
Chapter 7. Troubleshooting ..................................................................39
7.1 Introduction ...................................................................................39
7.2 Highlights ......................................................................................39
7.3 Common Problems .......................................................................39
DS51184A-page iv 1999 Microchip Technology Inc.
Table of Contents
Appendix A. MPLAB-ICD Hardware ......................................................41
A.1 Introduction ................................................................................... 41
A.2 MPLAB-ICD Module and Header ..................................................41
A.3 MPLAB-ICD Demo Board .............................................................46
Glossary ....................................................................................................51
Introduction ................................................................................... 51
Highlights ...................................................................................... 51
Terms ............................................................................................ 51
Index ..... ......... ........ ......... ....... .......... ....... .......... ....... .......... ....... ......... ........59
Worldwide Sal e s a nd Se rvice. ..................... ......................................... ...62
1999 Microchip Technology Inc. DS51184A-page v
MPLAB™-ICD User’s Guide
DS51184A-page vi 1999 Microchip Technology Inc.

Introduction

Highlights

MPLAB™-ICD USER’S GUIDE

General Information

This first chapter contains general information that will be useful to know before using MPLAB-ICD.
The information you will garner from this chapter:
• About this Guide
• Recommended Reading
• Warranty Registration
• Troubleshooting
• The Microchip Internet Web Site
• Development Systems Customer Notification Service

About This Guide

Document Layout
This document describes how to use MPLAB-ICD as a development tool to debug firmware on a target board. The manual layout is as follows:
• Customer Support
Chapter 1: MPLAB-ICD Preview – What MPLAB-ICD is and how it works.
Chapter 2: MPLAB-ICD Installation – How to install MPLAB-ICD hard­ware and software and establish communications.
Chapter 3: Getting Started with MPLAB-ICD – How to get MPLAB-ICD up and running.
Chapter 4: MPLAB-ICD Basic Functions – The basic functions of MPLAB-ICD.
Chapter 5: Demo Board Example of Use – The menu options of MPLAB-ICD.
Chapter 6: MPLAB-ICD Menu Options – The menu options of MPLAB-ICD.
Chapter 7: Troubleshooting – How to solve common problems.
Appendix A: MPLAB-ICD Hardware – A description of the header, module and demo board hardware.
1999 Microchip Technology Inc. DS51184A-page 1
MPLAB™-ICD User’s Guide
Glossary – A glossary of terms used in this guide.
Index – 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.
Conventions Used in this Guide
This manual uses the following documentation conventions:
Documentation Conventions
Description Represents Examples
Angle Brackets: < > Delimiters for special keys. <TAB>, <ESC> Italic characters Referenced books.
Courier Font User entered code or sample
Underlined, Italics Text with Right Arrow
0xnnn 0xnnn represents a hexadeci-
In-text Bold Characters Designates a button. OK, Cancel
code. Defines a menu selection from
the menu bar.
mal number where n is a hexa­decimal digit.
MPLAB User’s Guide
#define ENIGMA
File > Save
0xFFFF, 0x007A
Updates
All documentation becomes dated, and this user’s guide is no exception. Since MPLAB, MPLAB-ICD, and other Microchip tools are constantly evolving to meet customer needs, some MPLAB dialogs and/or tool descriptions may differ from those in this document. Please refer to our web site to obtain the latest documentation available.

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.
DS51184A-page 2 1999 Microchip Technology Inc.

Recommended Reading

This user’s guide describes how to use MPLAB-ICD. The user may also find the data sheets for specific microcontroller devices informative in developing firmware.
README.ICD
For the latest information on using MPLAB-ICD, read the README.ICD file (ASCII text file) included with the MPLAB-ICD software. The README.ICD file contains update information that may not be included in this document.
README.XXX
For the latest information on other Microchi p tools (MPLA B, MPASM, etc.), read the associated README files (ASCII text file) included with the MPLAB software.
MPLAB User’s Guide (DS51025)
Comprehensive guide that describes installation and features of Microchip’s MPLAB Integrated Development Environment, as well as the editor and simulator functions in the MPLAB environment.
MPASM User’s Guide with MPLINK and MPLIB (DS33014)
General Information
This user’s guide describes how to use the Microchip PICmicro assembler (MPASM), the linker (MPLINK) and the librarian (MPLIB).
Technical Library CD-ROM (DS00161)
This CD-ROM contains comprehensive data sheets for Microchip PICmicro
devices available at the time of print. To obtain this disk, contact the nearest Microchip Sales and Service location (see back page) or download individual data sheet files from the Microchip website (http://www.microchip.com).
Embedded Control Handbook Vol.1 & 2 (DS00092 & DS00167)
These handbooks contain a wealth of information about microcontroller applications. To obtain these documents, contact the nearest Microchip Sales and Service location (see back page).
The application notes described in these manuals are also obtainable from Microchip Sales and Service locations or from the Microchip web site (http://www.microchip.com).
Microsoft Windows Manuals
This manual assumes that users are familiar with Microsoft Windows operating system. Many excellent references exist for this software program, and should be consulted for general operation of Windows.

Troubleshooting

See Chapter 7 for information on common problems.
®
1999 Microchip Technology Inc. DS51184A-page 3
MPLAB™-ICD User’s Guide

The Microchip Internet Web Site

Microchip provides on-line support on the Microchip World Wide Web (WWW) site.
The web site is used by Microchip as a means t o make files and informa tion easily available to customers. To view the site, the user must have access to the Internet an d a web browser, such as Netscape Internet Explorer®. Files are also available for FTP download from our FTP site.
Connecting to the Microchip Internet Web Site
The Microchip website is available by using your favorite Internet b r owser to attach to:
http://www.microchip.com
The file transfer site is available by using an FTP program/client to connect to:
ftp://ftp.microchip.com
The website and file transfer site provide a variety of services. Users may download files for the latest Development Tools, Data Sheets, Application Notes, User’s Guides, Article s, and Sample Programs. A variety of Micr ochip specific business i nformation is also available, including list ings of Microchi p sales offices, distributors, and factory representatives. Other data availab le for consideration is:
®
Navigator or Microsoft
®
• Latest Microchip Press Releases
• Technical Support Section with Frequently Asked Questions
• Design Tips
• Device Errata
•Job Postings
• Microchip Consultant Program Member Listing
• Links to other useful web sites related to Microchip Products
• Conferences for products, Development Systems, technical information and more
• Listing of seminars and events
DS51184A-page 4 1999 Microchip Technology Inc.
General Information

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 to one of our list servers, you will receive email notification whenever we change, update, revise or have errata related to that product family or development tool. See the Microchip WWW page for other Microchip list servers.
The Development Systems list names are:
• Compilers
• Emulators
• Programmers
• MPLAB
• Otools
Once you have determined the names of the lists that you are interested in, you can subscribe by sending a message to:
listserv@mail.microchip.com
Compilers
with the following as the body:
subscribe <listname> yourname
Here is an example:
subscribe mplab John Doe
To UNSUBSCRIBE from these lists, send a message to:
listserv@mail.microchip.com
with the following as the body:
unsubscribe <listname> yourname
Here is an example:
unsubscribe mplab John Doe
The following sections provide descriptions of the available Development Systems lists.
The latest information on Microchip C compilers, Linkers, and Assemblers. These include MPLAB-C17, MPLAB-C18, MPLINK, MPASM as well as the Librarian, MPLIB for MPLINK.
To SUBSCRIBE to this list, send a message to:
listserv@mail.microchip.com
with the following as the body:
subscribe compilers yourname
1999 Microchip Technology Inc. DS51184A-page 5
MPLAB™-ICD User’s Guide
Emulators
The latest information on Microchip In-Circuit Emulators. These include MPLAB-ICE and PICMASTER.
To SUBSCRIBE to this list, send a message to:
listserv@mail.microchip.com
with the following as the body:
subscribe emulators yourname
Programmers
The latest information on Microchip PICmicro device programmers. These include PRO MATE II and PICSTART Plus.
To SUBSCRIBE to this list, send a message to:
listserv@mail.microchip.com
with the following as the body:
subscribe programmers yourname
MPLAB
Otools
The latest information on Microchip MPLAB, the Windows Integrated Development Environment for development systems tools. This list is focused
on MPLAB, MPLAB-SIM, MPLAB’s Project Manager and general editing and debugging features. For specific information on MPLAB compilers, linkers, and assemblers, subscribe to the COMPILERS list. For specific information on MPLAB emulators, subscribe to the EMULATORS list. For specific information on MPLAB device programmers, please subscribe to the PROGRAMMERS list.
To SUBSCRIBE to this list, send a message to:
listserv@mail.microchip.com
with the following as the body:
subscribe mplab yourname
The latest information on other development system tools provided by Microchip. For specific information on MPLAB and its integrated tools refer to the other mail lists.
To SUBSCRIBE to this list, send a message to:
listserv@mail.microchip.com
with the following as the body:
subscribe otools yourname
DS51184A-page 6 1999 Microchip Technology Inc.

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)
• Hot line
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 listing of sales offices and locations.
Corporate applications engineers (CAEs) may be contacted at (480) 786-7627.
In addition, there is a Systems Information and Upgrade Line. This line provides system users a listing 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.
General Information
The Hot Line Numbers are: 1-800-755-2345 for U.S. and most of Canada, and 1-480-786-7302 for the rest of the world.
1999 Microchip Technology Inc. DS51184A-page 7
MPLAB™-ICD User’s Guide
NOTES:
DS51184A-page 8 1999 Microchip Technology Inc.

Chapter 1. MPLAB-ICD Preview

1.1 Introduction

This section gives you a preview of MPLAB-ICD (In-Circuit Debugger) features and functions, as well as its hardware and software elements.

1.2 Highlights

Topics covered in this chapter:
• What is MPLAB-ICD
• How MPLAB-ICD Helps You
• Trade-Offs of Using MPLAB-ICD
• MPLAB-ICD Components
• MPLAB Integrated Development Environment (IDE)
• MPLAB Development Tools
MPLAB™-ICD USER’S GUIDE
• Host Computer System Requirements

1.3 What is MPLAB-ICD

MPLAB-ICD is a low cost evaluation kit for the PIC16F87X series microcontrollers. Utilizing the In-Circuit Debugging capability of the PIC16F87X and Microchip’s In-Circuit Serial Programming™ (ICSP™) protocol, the MPLAB-ICD is a programmer as well as an in-circuit debugger. It operates under the MPLAB IDE, connects to an application, and runs like the actual PIC16F87X microcontroller in the design.
MPLAB-ICD is intended to be used as an evaluation and debugging aid in a laboratory environme nt.
The MPLAB-ICD offers these features:
• Real-time code execution
• In-circuit debugging
• Built-in programmer
• 3.0V to 5.5V operating range
• Operation from voltage (V
• Operating frequencies from 32 kHz to 20 MHz
• Source level and symbolic debugging
• MPLAB user interface
• Microsoft Windows
DD) supplied by the target application
®
3.X/95/98 compatible
• RS-232 Interface
1999 Microchip Technology Inc. DS51184A-page 9
MPLAB™-ICD User’s Guide

1.4 How MPLAB-ICD Helps You

The MPLAB-ICD allows you to:
• Debug your source code in your own application
• Debug your hardware in real-time
• Program a target PIC16F87X using Microchip’s ICSP protocol

1.5 Trade-offs of Using MPLAB-ICD

Due to the built-in in-circuit debugging capability of the PIC16F87X and ICSP function offered by the Debugger, the MPLAB-ICD will use the following on­chip resources:
• MCLR/V
• RB3 reserved for low-voltage programming
Note: MPLAB-ICD does not suppor t low-voltage programming. Disable
• RB6 and RB7 reserved for programming and in-circuit debugging
• Six (6) general purpose file registers reserved for debug monitor: 70h, 1EBh to 1EFh
• First program memory location (address 0x000) must be a NOP instruc­tion
• Program memory 0x1F00-0x1FFF reserved for Debug Code
• One stack level not available
PP shared for programming
this function while using the ICD.
DS51184A-page 10 1999 Microchip Technology Inc.

1.6 MPLAB-ICD Components

The MPLAB-ICD consists of four basic components:
1. MPLAB-ICD Module
2. MPLAB-ICD Header
3. MPLAB-ICD Demo Board
4. MPLAB software
MPLAB™-IDE
MPLAB-ICD Preview
4
1
RS232
MPLAB-ICD Module
Figure 1.1: MPLAB-ICD Components
1.6.1 MPLAB-ICD Module
The MPLAB-ICD Module contains all debugging, programming, and control
logic. It is connected to the PC’s serial port via a 9-pin serial cable and to the MPLAB-ICD Header or target using a 6-wire modular cable. This module contains the firmware to provide serial communications to the PC, to drive the MPLAB-ICD communications to the Header/target board, and to program a target PIC16F87X using ICSP, all from the MPLAB IDE. The module is powered from the target application and requires 70 mA (max) in addition to what the target consumes.
1.6.2 MPLAB-ICD Header
The MPLAB-ICD Module connects to the MPLAB-ICD Header via a 9-inch modular cable. For in-circuit emulation, a PIC16F877 needs to be plugged into the header which then plugs into a 28-pin or 40-pin PIC16F87X DIP socket on an application or the MPLAB-ICD Demo Board. The MPLAB-ICD Header is powered by the target application, from a 3.0V to 5.5V source.
MPLAB-ICD Hea de r
2
Power in
3
MPLAB-ICD Demo Board
The modular cable also can be plugged into a modular connector on the application circuit with the appropriate connections to the PIC16F87X to allow in-circuit emulation of QFP and DIE parts.
1999 Microchip Technology Inc. DS51184A-page 11
MPLAB™-ICD User’s Guide
1.6.3 MPLAB-ICD Demo Board
The Demo Board is provided for demonstration/evaluation of the PIC16F87X in the absence of a target application board. It is connected to the MPLAB-ICD Module via the MPLAB-ICD Header. The PIC16F877 can be unplugged from the Header and plugged directly into the demo board for stand-alone operation.
The Demo Board (Figure 1.2) has the following hardware features:
1. 40- and 28-pin sockets. See Appendix A for how to use stand -offs to select the desired pin count socket.
2. Eight DIP switches to connect/disconnect each of the eight LEDs to/from their respective PORTC pin.
3. Eight red LEDs connected to PORTC for displaying 8-bit binary values.
4. Two push-button switches, one for RESET and one for external stimulus on RB0.
5. A potentiometer for analog input on RA0.
6. A small prototyping area.
7. A connector area to access the I/O pins of the PIC16F87X for expansion prototyping.
8. A jumper to select the RC oscillator (approximately 2 MHz) or an external crystal.
9. Socket for external crystal.
10. A connector for a 9V, 0.75A power supply , similar to the PICSTAR T programmer power supply .
11. Pr ovisions for a MAX 232 and associat ed hardware that may be po pu­lated to add RS-232 capability.
®
Plus
2
9
1
10
8
7
3
TO ICD MODULE
6
11
1998
ADVANCED TRANSDATA CO.
11
4
5
Figure 1.2: MPLAB-ICD Demo Board
DS51184A-page 12 1999 Microchip Technology Inc.
MPLAB-ICD Preview
1.6.4 MPLAB Software
The MPLAB software runs in the Windows 3.1/95/98 environment. It provides full display, modification, and control of the target application under emulation.

1.7 MPLAB Integrated Development Environment

The MPLAB desktop provides an environment for developing and debugging your application. MPLAB-ICD is integrated into the MPLAB IDE.
This document covers the basic setup and operation of the MPLAB-ICD, but it does not cover all functions of the MPLAB IDE. Read the
(DS51025) to get a full understanding of the features and debug
Guide
capabilities of the MPLAB IDE.
MPLAB User’s
1999 Microchip Technology Inc. DS51184A-page 13
MPLAB™-ICD User’s Guide

1.8 MPLAB Development Tools

The MPLAB IDE integrates several tools to provide a complete development environment.
MPLAB Project Manager
Use the Project Manager to create a project and wor k with the speci fic files related to the proj ect. When using a proj ect, source c ode is rebuilt and downloaded to the simulator or emulator with a single mouse click.
• MPLAB Editor
Use the MPLAB Editor to create and edit text files such a s sourc e files, code, and linker script files.
• MPLAB-SIM Simulator
The software simulator models the instructi on execution and I/O of the PICmicro Microcontrollers (MCUs).
• MPLAB-ICE Emulator
The MPLAB-ICE emulator us es hardware to e mulate PICmi cros in real time, either with or without a target system.
• MPASM Universal Assembler/MPLINK Relocatable Linker/
MPLIB Librarian
The MPASM assembler allows source code to be assembled without leaving MPLAB. MPLINK creates the final application by linking relocat­able modules from MPASM and MPLAB-C17 (PIC17CXXX C compiler). MPLIB manages custom libraries for maximum code reuse.
®
•PRO MATE
Develop code with the simulator or an emulator, assemble or compile it, and then use one of these tools to program devices. This can all be accomplished with MPLAB. Although PRO MATE II does not require MPLAB to operate, programming is easier using MPLAB.
•PICMASTER
These emulators use hardware to emulate PICmicros in real time, either with or wi thou t a ta rget s ystem . MPLA B-ICE is th e ne west em ulato r from Microchip.
• Third Party Tools
Many other companies have development tools for Microchip products that work with MPLAB. Consult the (DS00104).
II and PICSTART® Plus Programmers
®
and PICMASTER-CE Emulators
Microchip Third Party Guide
DS51184A-page 14 1999 Microchip Technology Inc.
Loading...
+ 49 hidden pages