+ All Categories
Home > Documents > PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf ·...

PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf ·...

Date post: 21-Jun-2020
Category:
Upload: others
View: 22 times
Download: 0 times
Share this document with a friend
60
2001 Microchip Technology Inc. DS39565A PICDEM TM 18R Demonstration Board User’s Guide M
Transcript
Page 1: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

2001 Microchip Technology Inc. DS39565A

PICDEMTM 18RDemonstration Board

User’s Guide

M

Page 2: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Note the following details of the code protection feature on PICmicro® MCUs.

• The PICmicro family meets the specifications contained in the Microchip Data Sheet.• Microchip believes that its family of PICmicro microcontrollers is one of the most secure products 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 knowl-

edge, require using the PICmicro microcontroller in a manner outside the operating specifications contained in the data sheet. The person doing so may be 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 product.

If you have any further questions about this matter, please contact the local sales office nearest to you.

Information contained in this publication regarding deviceapplications and the like is intended through suggestion onlyand may be superseded by updates. It is your responsibility toensure that your application meets with your specifications.No representation or warranty is given and no liability isassumed by Microchip Technology Incorporated with respectto the accuracy or use of such information, or infringement ofpatents or other intellectual property rights arising from suchuse or otherwise. Use of Microchip’s products as critical com-ponents in life support systems is not authorized except withexpress written approval by Microchip. No licenses are con-veyed, implicitly or otherwise, under any intellectual propertyrights.

DS39565A - page ii

Trademarks

The Microchip name and logo, the Microchip logo, PIC, PICmicro,PICMASTER, PICSTART, PRO MATE, KEELOQ, SEEVAL,MPLAB and The Embedded Control Solutions Company are reg-istered trademarks of Microchip Technology Incorporated in theU.S.A. and other countries.

Total Endurance, ICSP, In-Circuit Serial Programming, FilterLab,MXDEV, microID, FlexROM, fuzzyLAB, MPASM, MPLINK,MPLIB, PICC, PICDEM, PICDEM.net, ICEPIC, MigratableMemory, FanSense, ECONOMONITOR, Select Mode, dsPIC,rfPIC and microPort are trademarks of Microchip TechnologyIncorporated in the U.S.A.

Serialized Quick Term Programming (SQTP) is a service markof Microchip Technology Incorporated in the U.S.A.

All other trademarks mentioned herein are property of theirrespective companies.

© 2001, Microchip Technology Incorporated, Printed in theU.S.A., All Rights Reserved.

Printed on recycled paper.

2001 Microchip Technology Inc.

Microchip received QS-9000 quality system certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona in July 1999. The Company’s quality system processes and procedures are QS-9000 compliant for its PICmicro® 8-bit MCUs, KEELOQ® code hopping devices, Serial EEPROMs and microperipheral products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001 certified.

Page 3: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

TM

PICDEM 18R USER’S GUIDE12Table of Contents

PrefaceIntroduction ................................................................................................ 1

Highlights ................................................................................................... 1

About This Guide ....................................................................................... 1

Warranty Registration ................................................................................ 3

Recommended Reading ............................................................................ 3

Troubleshooting ......................................................................................... 4

The Microchip Internet Web Site ............................................................... 4

Development Systems Customer Notification Service .............................. 5

Customer Support ..................................................................................... 6

Chapter 1. Introduction to the PICDEM 18R Board1.1 Introduction ..................................................................................... 7

1.2 Highlights ........................................................................................ 7

1.3 The Demonstration Kit: What’s In The Box ..................................... 7

1.4 The PICDEM 18R Demonstration Board ........................................ 8

1.5 The On-Board Monitor Firmware .................................................. 10

1.6 The Host Software ........................................................................ 11

Chapter 2. Getting Started with the PICDEM 18R Board2.1 Highlights ...................................................................................... 13

2.2 Host Computer Requirements ...................................................... 13

2.3 Using the PICDEM 18R Board for the First Time ......................... 13

2001 Microchip Technology Inc. DS39565A-page iii

Page 4: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

Chapter 3. Configuring the PICDEM 18R Board3.1 Highlights ...................................................................................... 19

3.2 Memory Mapping .......................................................................... 19

3.3 The Configuration Switches .......................................................... 20

3.4 The Complex Programmable Logic Device (CPLD)...................... 21

3.5 Memory Devices ........................................................................... 23

3.6 Oscillator Configurations ............................................................... 24

3.7 On-Board Controls and Displays................................................... 25

3.8 RS-232 Port .................................................................................. 26

3.9 Modular ICD 2 Connector ............................................................. 26

Chapter 4. The On-Board Monitor Firmware4.1 Highlights ...................................................................................... 27

4.2 On-Board Monitor Overview.......................................................... 27

4.3 APIs for External Memory Devices ............................................... 28

Chapter 5. Using the Host Software5.1 Highlights ...................................................................................... 31

5.2 Host Software Overview................................................................ 31

5.3 The Host Software Window........................................................... 31

5.4 The Host Software Commands ..................................................... 33

5.5 Notes on Using the Host Software ................................................ 36

Chapter 6. Troubleshooting

6.1 Highlights ...................................................................................... 37

6.2 Common Issues ............................................................................ 37

6.3 The Diagnostic Tests .................................................................... 38

DS39565A-page iv 2001 Microchip Technology Inc.

Page 5: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Table of Contents

Appendix A. PICDEM 18R Board Technical Information A.1 Highlights ...................................................................................... 43

A.2 Block Diagram .............................................................................. 43

A.3 PICDEM 18R Board Schematics .................................................. 44

A.4 Pinouts for Memory and Prototype Headers................................. 45

Appendix B. PICDEM 18R Software CDB.1 Highlights ...................................................................................... 47

B.2 What’s on the CD.......................................................................... 47

Appendix C. PICDEM 18R Demonstration SoftwareC.1 Highlights ...................................................................................... 49

C.2 The Tutorials................................................................................. 49

Index ..........................................................................................................51

Worldwide Sales and Service..................................................................54

2001 Microchip Technology Inc. DS39565A-page v

Page 6: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

NOTES:

DS39565A-page vi 2001 Microchip Technology Inc.

Page 7: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

TM

PICDEM 18R USER’S GUIDE12Preface

IntroductionThis chapter contains general information about this manual and contacting customer support.

HighlightsTopics covered in this chapter:

• About this Guide

• Recommended Reading

• Warranty Registration

• Troubleshooting

• The Microchip Internet Web Site

• Development Systems Customer Notification Service

• Customer Support

About This Guide

Document LayoutThis document describes how to use the PICDEM 18R Demonstration Board for the PICmicro® PIC18C601 and PIC18C801 ROMless microcontrollers. The manual layout is as follows:

• Chapter 1: Introduction to the PICDEM 18R Board – What the PICDEM 18R Board is, and what features are available.

• Chapter 2: Getting Started with the PICDEM 18R Board – Describes how to connect and begin to use the PICDEM 18R Board.

• Chapter 3: Configuring the PICDEM 18R Board – Describes in greater detail the features of the Demonstration Board, and how to modify its hardware configuration.

• Chapter 4: The On-Board Monitor Firmware – Provides an overview of the on-board monitor and its use in application development.

• Chapter 5: Using the Host Software – Provides an overview of the host software, and how to program the Demonstration Board.

• Chapter 6: Troubleshooting – Provides information on solving common problems.

2001 Microchip Technology Inc. DS39565A-page 1

Page 8: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

• Appendix A: PICDEM 18R Board Technical Information – Provides the block diagram and detailed schematics of the PICDEM 18R board, as well as pinouts for the prototype connectors.

• Appendix B: PICDEM 18R Software CD – Provides a summary of the software on the accompanying CD-ROM.

• Appendix C: PICDEM 18R Demonstration Software – Provides a brief description of the demonstrations and tutorials for various solutions imple-mented with the PIC18C601 and PIC18C801 controllers.

• Worldwide Sales and Service – Lists Microchip sales and service loca-tions and telephone numbers worldwide.

Conventions Used in this GuideThis manual uses the following documentation conventions:

Documentation Conventions

Description Represents Examples

Code (Courier font):

Plain characters Sample code,file names and paths

#define STARTc:\autoexec.bat

Angle brackets: < >

Variables <label>, <exp>

Square brackets [ ] Optional arguments MPASMWIN [main.asm]

Curly brackets and pipe character: { | }

Choice of mutually exclusive arguments,an OR selection

errorlevel {0|1}

Lower case charac-ters in quotes

Type of data “filename”

Ellipses... Used to imply (but not show) additional text that is not relevant to the example

list [“list_option..., “list_option”]

0xnnn A hexadecimal number where ’n’ is a hexadecimal digit

0xFFFF, 0x007A

Italic characters A variable argument; it can be either a type of data (in lower case characters) or a specific example (in uppercase characters)

char isascii (char, ch);

DS39565A-page 2 2001 Microchip Technology Inc.

Page 9: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Preface

Documentation UpdatesAll documentation becomes dated, and this user’s guide is no exception. Since MPLAB® IDE, MPLAB® C1X 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 ConventionsDocuments 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:

Warranty RegistrationPlease 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.

Recommended ReadingThis user’s guide describes how to use the PICDEM 18R Demonstration Board. The data sheets contain current information on programming the specific microcontroller devices.

Interface (Arial font):

Underlined, italic text with right arrow

A menu selection from the menu bar

File > Save

Bold characters A window or dialog button to click

OK, Cancel

Characters in angle brackets < >

A key on the keyboard <Tab>, <Ctrl-C>

Documents (Arial font):

Italic characters Referenced books MPLAB® IDE User’s Guide

Documentation Conventions (Continued)

Description Represents Examples

XXXXX = The document number.

A = The revision level of the document.

2001 Microchip Technology Inc. DS39565A-page 3

Page 10: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

MPLAB® IDE User’s Guide (DS51025)

Comprehensive guide that describes installation and features of Microchip’s MPLAB Integrated Development Environment (IDE), as well as the editor and simulator functions in the MPLAB environment.

MPASMTM User’s Guide with MPLINKTM Object Linker and MPLIBTM Object Librarian (DS33014)

Describes how to use Microchip Universal PICmicro Microcontroller Assembler (MPASM), Linker (MPLINK), and Librarian (MPLIB).

Technical Library CD-ROM (DS00161)

This CD-ROM contains comprehensive data sheets for Microchip PICmicro® MCU 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 web site (http://www.microchip.com).

Embedded Control Handbook (DS00711)

This handbook consists of several documents that 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).

PICmicroTM Mid-Range MCU Family Reference Manual (DS33023) and PICmicro® 18C MCU Family Reference Manual (DS39500)

These manuals explain the general details and operation of the mid-range and advanced MCU family architecture and peripheral modules. They are designed to complement the device data sheets.

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.

TroubleshootingSee Chapter 6 for information on common problems.

The Microchip Internet Web SiteMicrochip 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, the user must have access to the Internet and a web browser, such as Netscape® Communicator or Microsoft® Internet Explorer®. Files are also available for FTP download from our FTP site.

DS39565A-page 4 2001 Microchip Technology Inc.

Page 11: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Preface

Connecting to the Microchip Internet Web Site

The Microchip web site is available by using your favorite Internet browser 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 web site 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, Articles, and Sample Programs. A variety of Microchip specific business information is also available, including listings of Microchip sales offices, distributors and factory representatives. Other data points available for consideration are:

• 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

Development Systems Customer Notification ServiceMicrochip 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 email notification whenever we change, update, revise or have errata related to your specified product family or development tool of interest.

Go to the Microchip WWW web page (http://www.microchip.com) and click on Customer Change Notification under Items of Interest. Follow the instructions to register.

The Development Systems product group categories are:

• Compilers

• Emulators

• In-Circuit Debuggers

• MPLAB IDE

• Programmers

2001 Microchip Technology Inc. DS39565A-page 5

Page 12: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

Here is a description of these categories:

Compilers - The latest information on Microchip C compilers, linkers and assemblers. These include MPLAB® C17 C compiler, MPLAB® C18 C compiler, MPLINKTM Object Linker (as well as the MPLIBTM Object Librarian) and MPASMTM Assembler.

Emulators - The latest information on Microchip in-circuit emulators. These include the MPLAB® ICE 2000 and PICMASTER® Emulator.

In-Circuit Debuggers - The latest information on Microchip in-circuit debuggers. This includes the MPLAB® ICD.

MPLAB - The latest information on Microchip MPLAB® IDE, the Windows Integrated Development Environment for development systems tools. This list is focused on the MPLAB IDE, MPSIMTM Simulator, MPLAB IDE Project Manager and general editing and debugging features.

Programmers - The latest information on Microchip PICmicro device programmers. These include the PRO MATE® II device programmer and PICSTART® Plus development programmer.

Customer SupportUsers 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 listing 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 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.

The Hotline Numbers are:

1-800-755-2345 for U.S. and most of Canada, and

1-480-792-7302 for the rest of the world.

DS39565A-page 6 2001 Microchip Technology Inc.

Page 13: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

TM

PICDEM 18R USER’S GUIDE12Chapter 1. Introduction to the PICDEM 18R Board

1.1 IntroductionThe PICDEM 18R Demonstration Board Kit has been created to introduce developers to Microchip’s latest family of high-end devices — the ROMless microcontroller. The board provides sufficient hardware to investigate the many possible interfaces to both 8-bit and 16-bit external memory devices, using both FLASH and SRAM. Ample prototype area, as well as access to all bus and control signals, allows developers to experiment with new applications for this family of controllers. The provided on-board monitor firmware and host interface software allows users to load and execute code, and fully evaluate the performance of ROMless controller based prototypes.

1.2 HighlightsThis chapter covers the following:

• PICDEM 18R Demonstration Kit contents

• PICDEM 18R Demonstration Board features

• The On-Board Monitor Interface

• The Host Software

1.3 The Demonstration Kit: What’s In The BoxYour Demonstration Kit contains the following items:

1. The PICDEM 18R Demonstration Board, complete with a MicrochipPIC18C801 microcontroller

2. A universal power supply (110-230 VAC input, 9 VDC output) for theDemonstration Board

3. A serial cable (DB9, M/F connectors) for use in programming and com-municating with the board

4. The PICDEM 18R Software CD-ROM, containing the host interfacesoftware and other Microchip development tools

5. This manual6. A Warranty Registration card

2001 Microchip Technology Inc. DS39565A-page 7

Page 14: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

1.4 The PICDEM 18R Demonstration BoardThe PICDEM 18R board has the most common features to begin developing applications with ROMless microcontrollers. The pre-programmed firmware allows developers to use the board with the PIC18C801 right out of the box, with no additional programming or configuration. Much of the hardware configuration is done by changing on-board switch settings, so the examination of new configurations is a simple process. All that is needed to program the board with user software is a PC-compatible computer with an available serial port. (See the “Getting Started” chapter for more detailed information.)

Figure 1.1: PICDEM 18R Board

1a

2

3a

20

5

6

7

8

9

10

11

12

13

3b

1b

14 15

4

16

17

18

19

18

DS39565A-page 8 2001 Microchip Technology Inc.

Page 15: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Introduction to the PICDEM 18R Board

Features on the PICDEM 18R board include:

1. MICROCONTROLLER SOCKETS: Two PLCC sockets are provided forthe user’s choice of Microchip PICmicro ROMless microcontrollers. Theoptions are a 68-pin socket (1a) for the PIC18C601, and an 84-pinsocket (1b) for the PIC18C801. The board is equipped from the factorywith a PIC18C801 high-end microcontroller installed in the 84-pinsocket.

2. FLASH MEMORY: A 29F160-compatible FLASH RAM device provides2 Mbyte of program storage. The device may be configured in either8-bit or 16-bit modes.

3. SRAM MEMORY: Two SRAM devices are provided, only one of whichmay be used at any given time. The AS7C1026 (3a) provides 64 Kwordsof storage, organized in 16-bit mode. The AS7C1024 (3b) provides128 Kbytes of storage, organized in 8-bit mode. The device that is actu-ally used is determined by the addressing mode used by the micro-controller, and is selected by the configuration switches (below).

4. CONFIGURATION SWITCHES: Four DIP switches are provided toquickly change the Demonstration Board’s operating mode. Thesedetermine the microcontroller being used, the memory bus width, andthe memory device(s) used. Settings are described in detail inChapter 3.

5. COMPLEX PROGRAMMABLE LOGIC DEVICE (CPLD): The PICDEM18R board uses a Xilinx® XC9536 CPLD to manage board configurationand the control signals for the memory devices, based on a factory-loaded configuration file. Changing the configuration file and the device’sgate programming are discussed in greater detail in Chapter 3.

6. EEPROM: A 24LC16 serial EEPROM is included for the use of develop-ers in creating a full range of prototype devices. This is a 16 Kbits devicewhich is programmable by a two-wire I2CTM interface.

7. OSCILLATOR OPTIONS: The Demonstration Board is prefabricatedwith a crystal (6.144 MHz). The board can also be configured to use anRC oscillator, or a prefabricated (“canned”) oscillator module. A socket(Y2) is provided for the latter.

8. RESET PUSH BUTTON: This switch is tied to the MCLR pin on the con-troller, and is used to reset the program currently loaded into memory.

9. USER-DEFINED PUSH BUTTONS: These two switches are connectedto digital I/O pins on the microcontroller (RB4 and RB5 of PORTB), andare available for user designated purposes.

10. USER-DEFINED POTENTIOMETER: A 10 kOhm potentiometer is con-nected to an analog I/O pin of the microcontroller (RA0 of PORTA). Thisis available as a user designated analog input.

11. LED BANK: A group of eight LEDs is provided for on-board diagnosticuse, as well as other user defined purposes.

Note: Only one microcontroller may be installed on the DemonstrationBoard at any time.

2001 Microchip Technology Inc. DS39565A-page 9

Page 16: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

12. LCD CONNECTOR: This 14-pin header allows the user to connect astandard LCD controller module (such as the Hitachi HD4478 or equiv-alent) to the Demonstration Board.

13. POWER LED: This shows when power is applied to the DemonstrationBoard.

14. RJ-11 (SIX-WIRE) ICD 2 MODULAR CONNECTOR: This allows theDemonstration Board to be connected to Microchip MPLAB ICD 2 sys-tems for microcontroller debugging.

15. RS-232 (DB9M) CONNECTOR: This allows the Demonstration Board tobe programmed through a standard serial connection. The RS-232 con-nector can also be used as a standard serial port for prototype applica-tions.

16. POWER CONNECTOR: A 2.5 mm barrel jack connector provides apower input from the supplied external power adapter. An on-board full-wave bridge allows for either AC or DC power input. On-board regulatorsprovide separate +5 VDC sources for analog and digital circuits.

17. CPLD PROGRAMMING CONNECTOR (JTAG CONNECTOR): Thisallows for the direct reprogramming of the CPLD array.

18. MEMORY DAUGHTER BOARD HEADERS: These two 28-pin connec-tors provide a complete selection of address, data and control linesbetween the PICDEM 18R board and external memory devices. Addressand data are provided in both multiplexed and de-multiplexed forms.This allows users to work with memory devices other than the FLASHand SRAM devices provided, by adding their own prototype memoryboards.

19. PROTOTYPE AREA HEADER: This group of connectors provides a fullcomplement of I/O bus signals, as well as analog and digital powersources, for use with the prototype area (below).

20. PROTOTYPE AREA: Two adjacent grids (12x55 and 5x45) are providedfor users to breadboard additional circuitry for development. The four-layer construction of the board provides access to all address, data, andcontrol signals on two layers, with separate power and ground layers onthe other two.

1.5 The On-Board Monitor FirmwareThe PICDEM 18R Demonstration Board also comes with preloaded monitor firmware. The firmware provides a general purpose host interface for verifying and programming memory, as well as a bootloader and an on-board diagnostic system. Its features and operation are discussed in Chapter 4.

DS39565A-page 10 2001 Microchip Technology Inc.

Page 17: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Introduction to the PICDEM 18R Board

1.6 The Host SoftwareAlso provided with the PICDEM 18R Demonstration Kit is a host software package for use on Microsoft Windows based systems. Together with the on-board monitor firmware, this software provides a simple interface for reading, verifying and programming on-board memory, as well as verifying board operation. The application is compatible with all 32-bit versions of Windows, and only requires an available serial port to communicate with the Demonstration Board.

The software is covered in more detail in Chapter 5.

2001 Microchip Technology Inc. DS39565A-page 11

Page 18: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

NOTES:

DS39565A-page 12 2001 Microchip Technology Inc.

Page 19: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

TM

PICDEM 18R USER’S GUIDE12Chapter 2. Getting Started with the PICDEM 18R Board

2.1 HighlightsThis chapter will cover the following topics:

• Hardware and Software Requirements for the Host Computer

• Setting Up the Test System

• Establishing Communications

2.2 Host Computer RequirementsTo communicate with and program the PICDEM 18R board, you must have a system that meets the following hardware and software requirements:

• PC-compatible system with an Intel® 80486 class or higher processor, or equivalent

• A minimum of 16 MB RAM

• A minimum of 5 MB available hard drive space

• CD-ROM drive (for use with the accompanying CD)

• One available standard serial port, with a matching COM port available through the operating system

• Microsoft Windows 95, Windows 98, Windows NT 4.0 or Windows 2000

2.3 Using the PICDEM 18R Board for the First TimeFor evaluating the PICDEM 18R board, the simplest configuration uses a host computer connected directly to the board using a serial cable. Creating this setup involves the following steps:

1. Installing the Host Software2. Connecting the PICDEM 18R board to the Host System3. Starting the Host Software

2.3.1 Installing the Host SoftwareThe installation of the host software package is completely automated, and does not require any user intervention or configuration once the process is started. The process is identical for all 32-bit Windows operating systems.

2001 Microchip Technology Inc. DS39565A-page 13

Page 20: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

Users with Windows NT® and Windows 2000® desktops do NOT need to have administrative rights to their systems for this installation. Closing all background applications before proceeding is helpful, but not required.

To install the host software:

1. Insert the PICDEM 18R Software CD into your system’s CD-ROM drive.2. Double-click on "My Computer", then on the icon for the CD-ROM.3. Double-click on the "Setup.exe" icon. Installation will proceed automati-

cally, and take 1-2 minutes.

Alternatively, run the installation by selecting Run from the Start menu. At the dialog box, enter

x:\setup

where "x" is the drive letter of your CD-ROM.

The installation process will install the host software package, as well as a collection of source code files, tutorials and demonstrations. All files are installed by default in the directory "PICDEM-18R" under the root level of your hard drive.

The source code and tutorials and their directory structures are covered in more detail in Chapter 5. The demonstration/tutorial software is also covered in Appendix C.

2.3.2 Connecting the PICDEM 18R BoardThe basic connections are shown in Figure

1. Power down the host system. (This isn’t strictly necessary, but it’s alwaysa good safety idea — particularly if you need to re-arrange cables ormove the system.)

2. Unbox and unwrap the board, and set it on a non-conductive surfacenear the host system.

3. If it isn’t installed already, install the PIC18C801 controller in the largerof the two PLCC sockets (U2). Check that the controller is completelyseated, and that all pins are making contact.

Note: It is possible that some organizations may implement a desktopcomputer policy sufficiently restrictive to prevent the user from load-ing any software at all. In theory, this can be done with any 32-bitWindows operating system on a network — including Windows 95®.If this describes your situation, contact your local InformationServices provider for assistance in installing this software.

DS39565A-page 14 2001 Microchip Technology Inc.

Page 21: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Getting Started with the PICDEM 18R Board

.

Figure 2.1: Connections between the PICDEM 18R Board and the Host Computer

4. Set all four configuration switches (S1) to the OFF position (closer to theprototype area of the board).

5. Connect the serial cable (supplied in the kit) to the RS-232 connector onthe board, then to the open serial port on your computer.

6. Connect the barrel plug of the power supply to the Power Input jack onthe board.

7. Plug the power adapter into your wall socket or power strip.8. Check the PICDEM 18R board. The green Power LED should be lit. If it

isn’t, check all connections with the power supply and the board. Foradditional assistance, refer to Chapter 6 ("Troubleshooting").

Host Computer

Serial Port(COM1 orCOM2)

9 VDC fromPower Supply

PICDEM 18R Board

Serial Cable

Serial Port

(DB9 to DB9)

Note: Most PC-compatible desktop computers have two serial ports: oneis a DB9 male (pin) connector, while the other may be either a DB9male or DB25 male connector. If your available serial port is the lat-ter, you will need to use a DB25F-to-DB9M port adapter, some-times known as an “external modem adapter”. Check with yourlocal electronics parts store or your Information Services providerfor additional information.

2001 Microchip Technology Inc. DS39565A-page 15

Page 22: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

9. Press and hold the RESET and top user push buttons (S5 and S6);release the RESET button, then S6. All 8 LEDs should flash momentarilyand then turn off, indicating that the monitor firmware routine is operat-ing. If the LEDs do not flash or turn off, verify that the DIP switches areall in the OFF position, and that the processor is properly installed. Foradditional assistance, refer to Chapter 6 ("Troubleshooting") .

10. Power up the host system.

2.3.3 Starting the Host SoftwareWith the software installed and PICDEM 18R board connected, all you need to do is to actually start the host software and confirm communications.

1. From the Start menu, select Programs > Microchip PICDEM 18R >PICDEM 18R;ORFrom a command window (DOS window on Windows 95/98), enter

C:\PICDEM-18R\MCHPPRGRMR.EXE

However it is started, the Host Program window should appear (Figure 2.2).

Figure 2.2: Host Program Window on Start-up

2. On the toolbar, select either Primary (FLASH) or Secondary (SRAM)memory. Select the appropriate COM port from the drop-down menu.

3. From the Operation menu, select Read. Alternatively, use the shortcutcombination <Ctrl-R>.

4. The main window will fill with a grid of hexadecimal digits and their equiv-alent display characters, starting at 000000h (for FLASH), or 020000h(for SRAM). This confirms that the board and software are working prop-erly (Figure 2.3).

DS39565A-page 16 2001 Microchip Technology Inc.

Page 23: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Getting Started with the PICDEM 18R Board

Figure 2.3: Host Program Reading Memory

If a "Command Error" dialog box appears ("Did not receive ACK from board...."), verify that the board is properly connected, and that the proper serial port is selected. For additional assistance, refer to Chapter 6 ("Troubleshooting").

When you can read the on-board memory devices, you are ready to continue with evaluating and programming the board.

2001 Microchip Technology Inc. DS39565A-page 17

Page 24: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

NOTES:

DS39565A-page 18 2001 Microchip Technology Inc.

Page 25: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

TM

PICDEM 18R USER’S GUIDE12Chapter 3. Configuring the PICDEM 18R Board

3.1 HighlightsThis chapter will cover the following topics:

• Memory Mapping

• The Configuration Switches

• The Complex Programmable Logic Device (CPLD)

• Memory Devices

• Oscillator Configurations

• On-Board Controls and Displays

• RS-232 Port

• Modular ICD 2 Connector

3.2 Memory MappingFor the PICDEM 18R board, all memory external to the controllers is divided into two categories. Primary memory consists of the on-board FLASH memory, and is controlled by signal CS1#. Secondary memory consists of on-board SRAM, and is controlled by signal CS2#.

The Primary memory, or FLASH, is the device that is normally mapped into the controller’s memory space when operating under the on-board monitor. For either Controller mode, the first 128 Kbyte of the FLASH is the software write-protected area containing the monitor itself, as well as the boot loader and the memory-mapped I/O region. All FLASH memory available above this is user programming area, to the extent that the selected controller can address it. This is shown in the diagram in Figure 3.1 (following page).

The Secondary memory is available as a single 128 Kbyte block. When the on-board monitor is running and requested by the host software, Secondary memory is located into the memory space starting at 020000h (128K), immediately above the write-protected space. When the board is operating in PIC18C601 mode, the CS2# signal is generated by the CPLD (Section 3.4).

When the on-board monitor is disabled, the entire memory space is available for user programming. The Secondary memory may be located anywhere from 002000h (8K) to the limit of the controller’s address space.

A complete discussion of device memory mapping, Boot RAM and memory-mapped I/O (the CSELIO region) is beyond the scope of this manual. A detailed discussion is provided in DS39541, the PIC18C601/801 Device Data Sheet. Additional information on implementing ROMless interfaces is also available from the Microchip Web site.

2001 Microchip Technology Inc. DS39565A-page 19

Page 26: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

Figure 3.1: Memory Maps for the PICDEM 18R Board(Monitor Mode)

3.3 The Configuration SwitchesThe four DIP switches on the Demonstration Board control the basic configuration. Their functions are listed in Table 3.1.

2 MB FLASH

Bootloader and CSELIO Region

000000h

1FFFFFh

128 KB SRAM

Memory Assignment for

PIC18C801 000000h

03FFFFh

Memory Assignment for

PIC18C601

NOPs

Software Write protected

and memory-mapped I/O region

User code area

020000h

Bootloader and CSELIO Region

020000h

128 KB FLASH

01FFFFh 01FFFFh

Contains boot loader, on-board tester

Unavailable

May be swappedinto memory at 02000hunder software control

DS39565A-page 20 2001 Microchip Technology Inc.

Page 27: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Configuring the PICDEM 18R Board

Table 3.1: PICDEM 18R Configuration Switch Settings

3.4 The Complex Programmable Logic Device (CPLD)

The many different memory configurations available to the PIC18C601 and PIC18C801 microcontrollers creates a difficult situation. Each configuration requires a different combination of control signals and address/data demultiplexing in order to work. While these arrangements are clearly defined in the supporting documentation, accommodating all the required hardware configurations on one circuit board is extremely challenging. Implementing the proper configuration by just a combination of multiple jumpers and switches could prove to be too taxing for even the most patient developer.

SwitchNumber

Name Function

1 MCU_SEL Selects active socket and defines micro-controller mode.OFF: PIC18C801 (Default)ON: PIC18C601

2 BW_SEL Defines the memory bus width.OFF: 16-bit (Default)ON: 8-bit

3 FLASH_DIS Enables or disables the primary (FLASH) memory.OFF: Enable FLASH memory, disable CS1_EXT# signal (Default)ON: Disable FLASH memory, enable CS1_EXT# signal

4 SRAM_DIS Enables or disables the SRAM (secondary memory).OFF: Enable SRAM, disable CS2_EXT# signal (Default)ON: Disable SRAM, enable CS2_EXT# signal

Note 1: Even though switch 1 selects the active socket, it does not com-pletely disable the other socket. For this reason, only one con-troller socket can be occupied at any time. DO NOT leave botha PIC18C601 and PIC18C801 in their respective sockets at thesame time!

2: Do not change any of the other configuration switches while theboard is powered on.

2001 Microchip Technology Inc. DS39565A-page 21

Page 28: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

To simplify the process, the Demonstration Board uses a Xilinx® CPLD to manage board configuration. Based on the settings of the configuration switches and values stored in configuration registers, the CPLD generates the necessary control signals (Chip Select, Write Enable and AD Demultiplexing) for each of the on-board memory devices. In addition, the CPLD also manages the memory-mapped write to the LED control bank, as well as the two general-purpose I/O chip select signals available to the user.

3.4.1 Configuration RegistersOn board power-up, the CPLD uses the current value of configuration switch 1 to enable the controller configuration. This in turn determines the values of register CS_CONFIG, a two-bit write-only register (Table 3.2). The register is located in the CSELIO region of memory, at an offset of 0EFh from the CSELIO base address; user software may modify this register. As this is a write-only register, users must implement a shadow register to track its value.

Table 3.2: CS_CONFIG REGISTER BITS

The SWAP_CS bit can be particularly useful, by allowing users to program external FLASH devices using Chip Select 2.

3.4.2 Chip Select SignalsThe CPLD generates three additional signals for the management of the LED bank, as well as the user Chip Selects. They are listed in Table 3.3.

Bit Bit Name and Description

0 PIC601_CS2_EN: Control bit to generate CS2# for addresses ≥ 20000h0 = Do not generate CS2# (default)1 = Generate CS2# for addresses ≥ 20000h

Note: This bit is ignored in PIC18C801 mode.

1 SWAP_CS: Swap CS1# and CS2#.0 = Do not swap chip select signals (default)1 = Swap chip select signals

Note: To avoid the accidental execution of unprogrammed code, set theSWAP_CS bit when executing code from within the Boot RAMonly. Clear CS_SWAP before exiting Boot RAM.

DS39565A-page 22 2001 Microchip Technology Inc.

Page 29: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Configuring the PICDEM 18R Board

Table 3.3: CPLD Managed Chip Select Signals

3.4.3 Programming the CPLDThe gate array of the CPLD is determined by a preloaded configuration file (which is also provided with the Demonstration Kit on the software CD along with VHDL source file). The device may be directly reprogrammed through the JTAG connector.

A discussion of CPLD programming is beyond the scope of this guide. A number of hardware and software tools for creating VHDL configuration files and programming CPLDs are available on the market. Users who need more information on this topic may check the Xilinx Web site, at www.xilinx.com.

3.5 Memory Devices

3.5.1 FLASH MemoryThe 29F160D device provided with the Demonstration Board can be config-ured to operate in either 8-bit or 16-bit mode. Configuration switch 2 (Section 3.3 and Table 3.1) selects the mode.

The PICDEM 18R monitor firmware is pre-programmed into the on-board FLASH memory. If the FLASH is erased, it must be reprogrammed. This can be done with either:

• the MPLAB ICD 2 system, or

• any PIC18C658/858, acting as a programmer

The source code for the Microchip PIC18C658 programmer (which is pin-compatible with the PIC18C601) is provided with the Demonstration Board on the accompanying CD-ROM. Use this file with the supplied host software to reprogram the FLASH.

I/O CS Signal

Location Description

DO_EN0 CSELIO+000h Latch enable (active high) to write to 8-bit LED port register: this signal automatically handles WRH# and WRL# conditions

IO_CS1# CSELIO+002h Memory-mapped I/O, Chip Select 1 (active low): available to user, must be gated with WRH#, WRL# or OE# to perform memory-mapped Write or Read operation

IO_CS#2 CSELIO+004h Memory-mapped I/O, Chip Select 2 (active low): available to user, must be gated with WRH#, WRL# or OE# to perform memory-mapped Write or Read operation

2001 Microchip Technology Inc. DS39565A-page 23

Page 30: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

3.5.2 SRAMUnlike the FLASH memory, on-board SRAM can only operate in one mode. For this reason, two devices are provided. The AS7C1026 chip operates in 16-bit mode, and provides 64 Kword of storage (equivalent to 128 Kbyte). The AS7C1024 chip operates in 8-bit mode, and provides 128 Kbyte. Only one device may be used at any given time; this is automatically selected by configuration switch 2.

3.5.3 Using External Memory Developers are not limited to using the memory devices provided on the PICDEM 18R board. Any number of different FLASH and SRAM devices can be connected via the memory prototype headers. In doing this, however, it is necessary to disable one or both of the on-board memories.

To use an external memory device, set either configuration switch 3 or 4 to ON. This disables the FLASH or SRAM, while activating the CS1_EXT# or CS2_EXT# signal. (See Table 3.1 for details.) These signals will select any devices present on the memory expansion header using Chip Select 1 or Chip Select 2, respectively. Setting both switches to ON will disable all on-board memory.

Do not switch between on-board and external memory devices without resetting the board; otherwise, erratic operation may result. Also keep in mind that disabling FLASH memory also disables the resident monitor firmware. This will make it impossible to access the board with the host software.

3.5.4 EEPROMThe 24LC16 serial EEPROM provided has no set function on the Demonstration Board. It is provided strictly for the convenience of users in the development of applications.

The EEPROM has a capacity of 16 Kbits, and is programmed by the I2C interface at device address 0.

3.6 Oscillator ConfigurationsThe Demonstration Board is designed to accommodate three different types of main oscillator:

• Crystal-controlled oscillator

• RC oscillator

• Self-contained oscillator module (“canned” oscillator)

As it is shipped, the board is configured with a crystal-controlled oscillator, using a soldered 6.144 MHz crystal. While this arrangement provides the greatest frequency accuracy and stability, it may not be suitable for all applications (i.e., low power consumption designs). To implement the other options, it will be necessary for users to make changes to the board.

DS39565A-page 24 2001 Microchip Technology Inc.

Page 31: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Configuring the PICDEM 18R Board

3.6.1 Oscillator ModuleA socket (Y2) has been provided for use with standard “canned” oscillators. Before populating this socket, it will be necessary to de-solder and remove the on-board crystal (Y1). If the RC oscillator option has been previously used, it will be necessary to remove R21 and C27.

It is the user’s responsibility to select a module with a frequency compatible with the controller.

3.6.2 RC OscillatorThe on-board crystal (Y1) must be de-soldered and removed. If the oscillator module has been installed, it will be necessary to remove it from its socket (Y2).

The RC network for the oscillator is not provided, and must be added by the user. Pads R21 and C27 (located in the vicinity of Y1) are provided for the addition of these components. The nominal values for these components are 4.7 kOhm and 33 pF, respectively. If a different clock frequency is needed, it is the user’s responsibility to select the values of these components to obtain a frequency compatible with the controller.

3.7 On-Board Controls and Displays

3.7.1 RESET (MCLR) SwitchThe RESET switch (MCLR, or S5) has two distinct uses.

To reset an application programmed into the PICDEM 18R board to its default state: Press and release the RESET switch.

To return a programmed board to control of the resident monitor firmware ("Return-to-Monitor" Reset):

1. Press and hold both the RESET switch and S6,2. Release the RESET switch, then3. Release S6.

The board will respond by briefly flashing all eight LEDs.

Note: The Return-to-Monitor Reset will only work if the on-board FLASHhas been neither disabled nor erased.

2001 Microchip Technology Inc. DS39565A-page 25

Page 32: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

3.7.2 User Potentiometer and SwitchesPotentiometer R24 and switches S6 and S7 are provided for analog and digital inputs for user defined applications. As noted, the potentiometer is connected to an analog pin of PORTA, while the switches are connected to digital pins of PORTB.

Several of the tutorials described in Appendix C demonstrate how these controls can be used in applications.

3.7.3 LCD Display HeaderConnector LCD1 provides an interface for an optional external LCD display device. Specifically, it is designed to be compatible with display modules using the Hitatchi HD4478 controller, or its equivalent. The LCD is used in the 4-bit write-only mode; since no read capability is provided, all operations with the display are followed with delays to compensate for display delays.

The interface provides four data lines and two control lines. Since these signals are multiplexed with some of the A/D converter channels, it is important to verify that the A/D module is disabled before attempting to write to the display.

3.7.4 LED BankIn addition to their use as a visual reset indicator and in the on-board diagnostic routine, the eight LEDs (D1 through D8) are also available for user defined applications. The LEDs are controlled by a write-only register, located at the CSELIO base address. Any user developed code needs to provide a shadow register to read the status of the LEDs.

3.8 RS-232 PortAs previously noted, the RS-232 serial port is used with the on-board monitor firmware and host software to program memory devices. The port is not used exclusively for this; however, it may be used in conjunction with the microcontroller’s USART module for any compatible application that the developer may wish to prototype.

3.9 Modular ICD 2 ConnectorIn addition to being a stand-alone demonstration unit, the PICDEM 18R board can also be used as a target board with the Microchip MPLAB® ICD 2 module. The six-wire modular plug (J2) provides all the necessary signal connections to MPLAB ICD 2. Please refer to the instructions with MPLAB ICD 2 for more information.

DS39565A-page 26 2001 Microchip Technology Inc.

Page 33: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R USER’S GUIDE12

Chapter 4. The On-Board Monitor Firmware

4.1 HighlightsThis chapter covers the following:

• On-Board Monitor Overview

• APIs for External Memory Devices

4.2 On-Board Monitor OverviewThe PICDEM 18R board is preprogrammed with the necessary firmware to make it functional directly out of the box. This on-board firmware (also referred to in this manual as the resident monitor) works in conjunction with the host software to provide a general purpose interface to the board. Users can use the software/firmware combination to examine and clear memory, as well as program HEX code directly to the on-board devices. The firmware also provides a simple bootloader and on-board diagnostic routine.

Figure 4.1: High Level Operation of the Monitor Firmware

Power-Up

RB4 == 0? Jump to 20000h

and Execute User Code

Done

YES

NO

RB5 == 0?

NO Perform On-Board

YES

Flash 8 LEDs

Host Command?

Return ACK

Execute Command

Return Result

YES

NO Successful?

Display rolling LEDs forever

Display blinking error code

forever

YES

NO

Diagnostics

2001 Microchip Technology Inc. DS39565A-page 27

Page 34: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

The on-board monitor is stored in the FLASH device, starting at address 00h. When the FLASH is enabled, the monitor is invoked whenever the "Return-to-Monitor" Reset is used (Section 3.7.1). A simplified flow chart of the monitor power-up sequence is shown in Figure 4.1.

4.3 APIs for External Memory DevicesTo make the PICDEM 18R board more useful to developers, the monitor firmware also implements a flexible mechanism to support new types of memory devices. All of the necessary memory management routines are loaded into Boot RAM on power-up; these can be modified by loading new routines through the host software.

Additionally, a standard set of Applications Programming Interfaces, or APIs, are used to support any user supplied routines. These are detailed in the sections below.

In order to enforce reasonable type checking, a Microchip linker script (memrtnes.lkr) has been provided with the host software files. It is recommended that developers who wish to add their own memory devices either use this, or format any code according to the restrictions spelled out in the file. For additional guidance, developers should use the assembler file flash29f.asm as a reference for creating new memory routines.

4.3.1 Memory Write APIPurpose Write an 8-bit value to a memory location defined by a 32-bit

address

Prototype WREG Write (DWORD Address, BYTE byte, BYTE Flag)

Input Address:Byte:Flag:

32-bit address of the location8-bit data being written8-bit value which specifies the location of byte in terms of the total data to be written, as well as current MCU mode

Flag conforms to the formatxxxx tbddwhere:xxxx is unusedt is the controller type:

0 = PIC18C6011 = PIC18C801

b is the bus width:0 = 8-bit1 = 16-bit

dd is the data position:00 = first byte being written01 = last byte being written10 = only byte being written11 = intermediate byte being written

DS39565A-page 28 2001 Microchip Technology Inc.

Page 35: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

The On-Board Monitor Firmware

4.3.2 Memory Erase API

Output WREG: Result code for this functionIf WREG==00h

Function was successfulELSE

There was an error, which may beexplained by the value

Purpose Erase all available memory locations

Prototype WREG Erase (BYTE flag)

Input Flag: 8-bit value which defines current MCU mode (data location variables not used).See Section 4.3.2 (Memory Erase API) for explanation.

Output WREG: Result code for this functionIf WREG==00h

Function was successfulELSE

There was an error, which may beexplained by the value

2001 Microchip Technology Inc. DS39565A-page 29

Page 36: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

NOTES:

DS39565A-page 30 2001 Microchip Technology Inc.

Page 37: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

TM

PICDEM 18R USER’S GUIDE12Chapter 5. Using the Host Software

5.1 HighlightsThis chapter will cover the following topics:

• Host Software Overview

• The Host Software Window

• Host Software Commands

• Using the Software

5.2 Host Software OverviewThe software provided with the PICDEM 18R board is the second part of the interface between the board and the user. While the resident monitor (described in the previous chapter) actually implements the functionality, the host software provides the user-friendly GUI for manipulating on-board memory. All features are accessible from a single window, and allow users to:

• Examine memory contents

• Examine Intel HEX files (INHX8M, INHX85, INHX32)

• Program memory devices

• Execute loaded programs

• Erase memory devices

• Perform host-enabled board diagnostics

5.3 The Host Software WindowAs previously noted, the entire functionality of the host software can be accessed from the one window (Figure 5.1). This window has four main areas, discussed in more detail below. From top to bottom, they are:

• the Menu Bar

• the Toolbar

• the Main Window

• the Status Bar

2001 Microchip Technology Inc. DS39565A-page 31

Page 38: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

Figure 5.1: Typical Host Software Window

5.3.1 The Menu BarThe menu bar provides a list of main choices with drop-down submenus, presented in standard Windows format. Many of the principle commands are also accessible through shortcut key combinations.

The complete list of commands is discussed in detail in Section 5.4.

5.3.2 The ToolbarThe most commonly used commands from the menu are also duplicated on an icon-based toolbar, shown in Figure 5.2. As before, the commands are explained in Section 5.4.

Figure 5.2: The Host Software Toolbar

Execute Board Test

Execute Code

ProgramRead

Save

New

Open

Erase

WriteVerify

Download Routines

Abort (available only during memory operations)

DS39565A-page 32 2001 Microchip Technology Inc.

Page 39: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Using the Host Software

There is a single option on the toolbar that is not duplicated in the command menu:

• The COM port drop-down combo box is used to select the COM port for the host software. Valid options are COM1 through COM6, inclusive.

5.3.3 The Main WindowThe main window displays the actual contents of the selected memory device or HEX file, along with the ASCII representation for each byte. Data is arranged in rows of 16 bytes, representing the least significant HEX digit of the address. Rows are stacked with the bottom of the memory range starting at the top of the screen and moving downward, with the most significant digits of the address displayed at the left.

5.3.4 The Status BarThis area contains explanatory and error messages on any operation in progress. During the execution of memory operations, the left side of the status bar keeps a continuously updated account of the memory address being operated upon.

5.4 The Host Software Commands

5.4.1 Windows CommandsAll available commands in the host software are categorized by their menu association. They can be grouped as File, Operation, or Tools.

File commands operate on existing Intel HEX files; they do not act on the contents of memory devices. Commands available in this submenu are:

Command Shortcut Toolbar Purpose

New <CTRL-N> Yes Empties file buffer and clears main window; prepares software for a new HEX file.

Open <CTRL-O> Yes Load a new HEX file.

Close — No Close the currently displayed HEX file and clear the buffer and main window.

Save <CTRL-S> Yes Save the current buffer contents. If the file is new and unnamed, invokes a dialog box to name the file and specify its location.

Save As <F12> No Saves the current buffer file under a new name. Invokes a dialog box to name the file and specify its location.

Exit — No Closes current file and exits program.

2001 Microchip Technology Inc. DS39565A-page 33

Page 40: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

Operation commands operate on the memory devices themselves. Commands available in this submenu are:

Command Shortcut Toolbar Purpose

Program <CTRL-P> Yes Downloads current buffer contents into the selected device; performs an erase before writing to the device.

Write <CTRL-W> Yes Downloads and writes current buffer contents into the selected device.

Read <CTRL-R> Yes Reads the contents of the selected device into the buffer and displays it.For on-board FLASH, the operation starts at 00h.For on-board SRAM, the operation starts at 020000h.

Erase <CTRL-E> Yes Erases the entire contents of the selected device (excluding the monitor).

Verify <CTRL-V> Yes Compares the current buffer contents with that of the selected device.

Download Memory Routines

<CTRL-M> Yes Downloads current buffer contents into the Boot RAM area of the controller.Note: Only the first 512 bytes of the buffer are downloaded.

Read Memory Routines

— No Reads the contents of the Boot RAM into the buffer and displays it.

SelectPrimaryMemory

— Yes Selects the Primary memory (FLASH) as the target device for subsequent operations.

Select SecondaryMemory

— Yes Selects the Secondary memory (SRAM) as the target device for subsequent operations.

Abort <CTRL-A> Yes Terminates current memory operation.

Note: Interrupting a program or write operation can cause unpredictablememory states, which may result in erratic operation. This mayrequire erasing and reprogramming the device.

DS39565A-page 34 2001 Microchip Technology Inc.

Page 41: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Using the Host Software

The Tool commands are related to general board operations. The two commands in this submenu are:

There is only one option in the Help submenu. This brings up a dialog box displaying the current software revision.

5.4.2 Command Line OptionsThe host software can also be invoked from a DOS command line. The syntax for the command is

MCHPPRGRMR.EXE [/?] [/pCOM<n>] [/b<BAUD>]

where /? displays command-line help

/pCOMn defines the COM port to be used(valid values for n are 1 through 6)

/b<BAUD> defines the baud rate for the selected port (valid values are any of those defined by Windows for serial ports under Device Manager, with a default of 19,200 bps)

Starting the host software this way launches the regular Windows based GUI, as previously described. No other command line options are available with the software.

Command Shortcut Toolbar Purpose

Execute <CTRL-X> Yes Causes the processor to jump to the beginning address of the current device and begin execution of code.Note: To accurately execute a file, write it to the appropriate device, then use this command.

Test Board <CTRL-T> Yes Initiates the host controlled board diagnostic routine.

Note 1: You must be in the proper directory (PICDEM 18R) in order tolaunch the host software from the command line. If you intendto use the command line option frequently, consider adding thedirectory to your current PATH command (Windows 95 and 98),or environment variables (Windows NT and 2000).

2: The default communication rate of 19,200 bps is programmedinto the PICDEM 18R board’s firmware. If you wish to use adifferent communication speed, you will need to modify theon-board firmware, in addition to changing the rate in the hostsoftware.

2001 Microchip Technology Inc. DS39565A-page 35

Page 42: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

5.5 Notes on Using the Host SoftwareThe commands provided in the host software are straightforward, and are generally self-explanatory. Any dialog boxes which appear (such as Open File or Save File) are standard Windows GUI dialogs.

When using the host software, keep the following principles in mind:

1. The host software does not have the facilities to edit HEX files. You willstill need to use an assembler, compiler, or other file editing tool to makechanges to a HEX file on disk. Similarly, a HEX file loaded into a memory device or in the buffer cannotbe modified; the file must be saved to disk, modified by the appropriateeditor, and then reloaded.

2. The Memory Read operation does not automatically check the memorydevice for an upper boundary; it will continue to read past the upperphysical boundary of the device. After the memory read operation hasread the area of memory that you’re interested in, stop the operation byclicking on the Abort icon. At the dialog box that follows, answer "yes" tocontinue (i.e., continue with the command and stop the operation).

3. The Abort command will also halt program, write and erase operations.Keep in mind that stopping one of these operations prematurely mayrequire that the device be reprogrammed. When the Abort command isused for these operations, the dialog box will display a reminder to thiseffect.

DS39565A-page 36 2001 Microchip Technology Inc.

Page 43: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

TM

PICDEM 18R USER’S GUIDE12Chapter 6. Troubleshooting

6.1 HighlightsThis chapter discusses the following:

• Common issues with the PICDEM 18R Board, and how to solve them

• The Diagnostic Tests

6.2 Common Issues1. The Power LED is not lit

Check the PICDEM 18R board for power:

• Verify that the power supply is plugged in, and the wall outlet has power.

• Check that voltage is available (9 VDC) at the barrel plug. If the original power supply is not being used, check for appropriate voltage (9V, AC or DC) and current level (approximately 500 mA) at the barrel plug.

• Check that the regulated voltage (5 VDC) is available at the connectors at the prototype area of the board.

2. The LED bank does not flash after performing a "Return-to-Monitor" Reset (switches S5 and S6)

Verify that you are performing the Return-to-Monitor Reset sequence correctly: after pushing and holding both switches, release S5 (MCLR) first, then S6. Pressing S5 alone will only reset any user loaded programs.

Check that the board is receiving power (Issue 1, above).

Verify that configuration switch 3 is in the OFF position.

Verify that the correct controller is selected with switch 1 (OFF for the PIC18C801, ON for the PIC18C601).

After performing the Return-to-Monitor Reset, try to read the Primary or Secondary (on-board) memories using the host software:

• If the Read is successful (returns HEX values with no error messages), there may be a hardware problem with the LEDs or the LED driver IC.

• If the Read is not successful (no HEX values are returned, error message of no Acknowledge signal from board), the FLASH device may have been cleared or damaged, and the resident monitor may no longer be present. It will be necessary to reprogram the board using the MPLAB ICD 2 or equivalent tool.

2001 Microchip Technology Inc. DS39565A-page 37

Page 44: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

3. The host system can’t communicate with the PICDEM 18R board

Check that the board is receiving power (see Issue 1, above).

Check the serial cable for proper connections to the board and the host computer. Verify that the cable is connected to the correct serial port on the host computer.

Verify that the proper COM port is selected in the host software toolbar. If so, verify that selected COM part is working (use Windows "Device Manager").

If necessary, verify the serial cable by swapping in another cable that is known to be good.

After some operations (such as test), it is necessary to reset the board. Perform a Return-to-Monitor Reset, and attempt to read either Primary or Secondary memory.

If all steps fail, the FLASH device may have been erased, or may be damaged. It will be necessary to reprogram the board using the MPLAB ICD 2 or equivalent tool.

4. The host system communicates with the board, but it cannot beprogrammed

Check for serial communications problems (see Issue 3, above).

Perform a Return-to-Monitor Reset, then try programming again.

Verify that the target memory device is selected. For on-board devices, the appropriate configuration switch must be OFF (switch 3 for FLASH, switch 4 for SRAM). For external devices connected to the memory prototype headers, the configuration switch must be ON (switch 3 for CS1 controlled devices, switch 4 for CS2 controlled devices).

Perform one of the board diagnostic tests to verify that the on-board memory devices are working properly.

6.3 The Diagnostic TestsIf the PICDEM 18R board is receiving power and communicating, but still not working correctly, there may be other hardware issues present. To assist in diagnosing these issues, a board testing routine has been provided in the on-board firmware. Two different tests are available:

• A stand-alone board test for quick verification; and

• A host software managed version

DS39565A-page 38 2001 Microchip Technology Inc.

Page 45: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Troubleshooting

6.3.1 Stand-Alone DiagnosticThis test may be used when the host system is unavailable, or communication with the host cannot be established. It performs the automatic tests that are also run with host managed diagnostic, but uses the LEDs to provide feedback.

To run the test:

1. With the board powered down, set configuration switch 1 to OFF (if usingthe PIC18C801) or ON (for the PIC18C601). Set all other configuration switches to OFF.

2. Apply power to the board.3. Simultaneously press and release all three push button switches

(MCLR, S6 and S7). All eight LEDs will light.4. Press either S6 or S7. This will cause four of the LEDs to blank (D1-D4

for S6, D5-D8 for S7). Press the other switch to blank the other fourLEDs.

5. Turn the potentiometer fully counterclockwise to its stop, then slowly turnit clockwise. The LED bank will begin to count upward in binarysequence (D1, the Least Significant bit) as the potentiometer isadvanced.

6. When the binary count no longer advances, stop turning the potentiometer.The host software will complete the diagnostic test automatically.

7. After 30 to 45 seconds, the system will return the results of the test:

• If the test completed successfully, the LED bank displays a continuous scrolling pattern.

• If a failure is discovered, one or more LEDs will flash rapidly to indicate the failure source as follows:

Blinking LED(s)

Meaning Action

D1 FLASH erase error 1. Review test and repeat, if needed2. Replace FLASH device (U10)

D2 FLASH write error 1. Review test and repeat, if needed2. Replace FLASH device (U10)

D1 and D2 together

SRAM write error 1. Review test and repeat, if needed2. Replace SRAM device (U9)

Note: Disabling the on-board SRAM (setting switch 4 to ON) will show inthe diagnostic test as an SRAM failure. Disabling the on-boardFLASH device will disable the resident monitor and the diagnostictest. If a diagnostic test fails to run, always check the setting ofswitch 3 first. It must be set to OFF.

2001 Microchip Technology Inc. DS39565A-page 39

Page 46: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

6.3.2 Host Managed DiagnosticIn order to use this test, the following conditions are assumed:

1. The host software has been installed and is working properly.2. The board is correctly connected to the host system.3. The on-board monitor firmware is present (i.e. the on-board FLASH

device has not been cleared).

To run the test:

1. With the board powered down, set configuration switch 1 to OFF (if usingthe PIC18C801) or ON (for the PIC18C601). Set all other configuration switches to OFF.

2. Launch the host software.3. Apply power to the board.4. Perform a Return-to-Monitor Reset.5. In the host software, either:

• Select Tools > Test from the toolbar, or

• Click on the "Test Board" icon

All eight LEDs will light.

6. Press S6 or S7. This will cause four of the LEDs to blank (D1-D4 for S6,D5-D8 for S7). Press the other switch to blank the other four LEDs.

7. Turn the potentiometer fully counterclockwise to its stop, then slowly turnit clockwise. The LED bank will begin to count upward in binarysequence (D1, the Least Significant bit) as the potentiometer isadvanced.

8. When the binary count no longer advances, stop turning the potentiometer.The host software will complete the diagnostic test automatically.

9. After 30 to 45 seconds, the system will return the results of the test.

• If the test was successful, all eight LEDs will light, and the message "Complete" will be displayed in the left status bar of the host software window.

• If an error was found, an error code will be returned on the status bar:

Error Code Meaning Action

01 FLASH erase error 1. Review test and repeat, if needed2. Replace FLASH device (U10)

02 FLASH write error 1. Review test and repeat, if needed2. Replace FLASH device (U10)

03 SRAM write error 1. Review test and repeat, if needed2. Replace SRAM device (U9)

DS39565A-page 40 2001 Microchip Technology Inc.

Page 47: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Troubleshooting

If the test will not run at all, verify board-to-computer connections (see Issue 3, above), and that the FLASH device has not been disabled. If the test still does not run, it is likely that the FLASH and monitor firmware have been erased, and will need to be reprogrammed.

Note: Disabling the on-board SRAM (setting switch 4 to ON) will show inthe diagnostic test as an SRAM failure. Disabling the on-boardFLASH device will disable the resident monitor and the diagnostictest. If a diagnostic test fails to run, always check the setting ofswitch 3 first. It must be set to OFF.

2001 Microchip Technology Inc. DS39565A-page 41

Page 48: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

NOTES:

DS39565A-page 42 2001 Microchip Technology Inc.

Page 49: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

TM

PICDEM 18R USER’S GUIDE12Appendix A. PICDEM 18R Board Technical Information

A.1 HighlightsThis chapter will cover the following topics:

• PICDEM 18R Block Diagram

• PICDEM 18R Schematics

• PICDEM 18R Header Pinouts

A.2 Block DiagramFigure A.1: PICDEM 18R Development Board Functional Block Diagram

PIC18C601

OR

PIC18C801

Address Latch

8-bit Bus Switch

CPLD

DIP

Oscillator

RS-232

User Push Buttons

User Potentiometer

LCD Header

Prototype

PROTOTYPE AREA HEADER

MEMORY PROTOTYPE HEADERS

FLASH

64 K x 16

SRAM

128 K x 8

LED Bank

Switches

Memory

AD

DR

ES

S /

DA

TA

/ C

ON

TR

OL

BU

S

Area

Port

I/O P

OR

T B

US

DataAddress

Multiplexed

Control Address / Data

(PIC18C801only (1) )

SRAM

Note 1: De-multiplexed data in 8-bit mode only.

2001 Microchip Technology Inc. DS39565A-page 43

Page 50: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

A.3 PICDEM 18R Board SchematicsNote: Board Schematic file "PICDEM-18R Schematics.pdf" can be found

in the "PICDEM 18R CD" or on the Microchip web site.

Table A.1: Special Signals Used in the PICDEM 18R Schematic

Signal Name Function

AD<15:0> Address/Data bits

A<16:0> De-multiplexed address bits common to both MCUs

A<19:17> Address bits available on PIC18C801 only. These signals are pulled low when PIC18C801 is not present.

DD<7:0> De-multiplexed data bits from PIC18C801

D<15:8> De-multiplexed data bits common to both MCUs

D<7:0> Selection of AD<7:0> or DD<7:0> depending on 8-bit multiplexed or de-multiplexed bus option

D15_A0 D15 for 16-bit mode or BA0 for 8-bit mode

MCU_SEL Digital input to CPLD to select 801 or 601

BW_SEL Digital input to CPLD to select 8-bit or 16-bit

FLASH_DIS Digital input to CPLD to enable/disable on-board FLASH memory

SRAM_DIS Digital input to CPLD to enable/disable on-board SRAM memories

MUX_EN Digital output from CPLD to select 8-bit/16-bit multiplexed bus

DMUX_EN Digital output from CPLD to select 8-bit de-multiplexed bus

CS1_FLASH# On-board FLASH memory chip select signal

CS2_SRAM1# On-board 8-bit SRAM memory chip select signal

CS2_SRAM2# On-board 16-bit SRAM memory chip select signal

CS1_EXT# Chip select for external memory #1 – this is acti-vated when on-board FLASH is disabled

CS2_EXT# Chip select for external memory #2 – this is acti-vated when on-board SRAM is disabled

WR# WR signal generated from WRH# or WRL# depending on current memory interface mode

DO_EN0 Digital output to enable output latch when memory mapped write is performed

IO_CS1# Extra memory mapped I/O chip select signal #1

IO_CS2# Extra memory mapped I/O chip select signal #2

DS39565A-page 44 2001 Microchip Technology Inc.

Page 51: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEM 18R Board Technical Information

A.4 Pinouts for Memory and Prototype HeadersTable A.2: External Memory Headers

Table A.3: LCD Controller Header

Pin JM1 JM2 Pin JM1 JM2

1 D0 +5V 2 D1 GND

3 D2 BA0 4 D3 D15_A0

5 D4 A0 6 D5 A1

7 D6 A2 8 D7 A3

9 AD8 A4 10 AD9 A5

11 AD10 A6 12 AD11 A7

13 AD12 A8 14 AD13 A9

15 AD14 A10 16 AD15 A11

17 CS1_EXT# A12 18 CS2_EXT A13

19 WRH# A14 20 WRL# A15

21 UB# A16 22 LB# A17

23 OE# A18 24 RESET# A19

25 IO_CS2 CSIO# 26 NC ALE

27 +5V RB5 28 GND IO_CS1#

Pin Signal Pin Signal

1 GND 2 +5V

3 VEE 4 RS

5 R/W 6 E

7 NC 8 NC

9 NC 10 NC

11 DB4 12 DB5

13 DB6 14 DB7

2001 Microchip Technology Inc. DS39565A-page 45

Page 52: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

NOTES:

DS39565A-page 46 2001 Microchip Technology Inc.

Page 53: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

TM

PICDEM 18R USER’S GUIDE12Appendix B. PICDEM 18R Software CD

B.1 HighlightsThis chapter summarizes the contents of the PICDEM 18R Software CD-ROM.

B.2 What’s on the CDThe PICDEM 18R CD includes the following Microchip software tools and support documentation. For up-to-date CD contents, refer to the file "readme.txt" at the root level of the CD.

PICDEM 18R Host Setup Software

This contains all of the necessary files to install the PICDEM 18R host software described in Chapter 5. The installation program also automatically creates a folder for the PICDEM 18R demonstration and tutorial software described in Appendix C.

MPLAB® IDE, version 5.40

MPLAB Integrated Development Environment is a complete development environment for the Microchip PICmicro microcontroller families. Designed for use with the Microsoft Windows operating system, MPLAB IDE includes the following tools:

• MPLAB Project Manager

• MPSIM Software Simulator

• MPLAB Editor

• MPASM Universal Macro Assembler for PICmicro microcontrollers

• MPLINK Linker

• MPLIB Librarian

MPLAB IDE also supports multiple source files, various C compilers (including MPLAB C17/C18), third-party tools and precompiled libraries.

MPLAB® ICD 2 Support Files for ROMless Microcontrollers

These files extend the capabilities of the MPLAB In-Circuit Debugger Kit, allowing it to operate with the PICDEM 18R board. By using these files with MPLAB IDE software, the MPLAB ICD 2 module can communicate with the PICDEM 18R board, allowing it to become a target board for the debugger.

Note: The MPLAB ICD 2 module is part of the MPLAB ICD 2 EvaluationKit, which is not included with the PICDEM 18R Demonstration Kit.

2001 Microchip Technology Inc. DS39565A-page 47

Page 54: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

Application Notes for ROMless Microcontrollers

This folder contains the latest information on how to use the external memory interface of ROMless devices in developing applications.

Product Information on the PIC18C601 and PIC18C801 Microcontrollers

This provides the highlights and a technical summary of Microchip’s ROMless devices.

PICDEM 18R User’s Guide

This single file is the electronic version of this Demonstration Kit manual, provided in Adobe® Acrobat® format.

PICDEM 18R Schematic File

This file is the electronic version of board schematics, provided in Adobe Acrobat format.

DS39565A-page 48 2001 Microchip Technology Inc.

Page 55: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

TM

PICDEM 18R USER’S GUIDE12Appendix C. PICDEM 18R Demonstration Software

C.1 HighlightsThis chapter summarizes the demonstration and tutorial code provided with PICDEM 18R Development Kit.

C.2 The TutorialsThe installation of the host software automatically creates a directory named "Tutorials". Each of the programs provided here demonstrate a different programming concept used with the PIC18C601/801 microcontrollers. A list of the demonstrations is provided in Table 6.1.

In addition to the executable HEX files, the source code for all tutorial programs is provided in two formats:

• assembler source files (*.asm)

• C source files (*.c)

These are organized in separate folders within the Tutorials folder.

The files provided are compatible with the latest versions of the Microchip Assembler (MPASM) and the Microchip MPLAB C18 compiler. For the developer’s convenience, the listing, object and error format files, as well as any linker scripts that might be needed, are also provided.

The HEX files for each demonstration are designed to work directly with the PICDEM 18R monitor firmware with no modification. If a tutorial will not be used in conjunction with the monitor firmware, the source and linker files must be appropriately modified and recompiled.

Table 6.1: Tutorial Programs Installed with Host Software

Tutorial Demonstrates

ADC Analog-to-Digital Converter

EEPROM External serial EEPROM

LCD External LCD

MemIO Memory-mapped Writes to LED port

Switch Digital Inputs

USART PIC18C601/801 USART Module

Boot RAM On-chip Boot RAM

CS On-chip Chip Select Signals

Demo A general demonstration using the LEDs and LCD

PLL Software controlled 4X PLL

2001 Microchip Technology Inc. DS39565A-page 49

Page 56: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

NOTES:

DS39565A-page 50 2001 Microchip Technology Inc.

Page 57: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R USER’S GUIDE12

Index

AA/D Module, use with LCD ...................................... 26

CComplex Programmable Logic Device

(CPLD) ......................................................... 9, 21Configuration Registers ................................... 22Chip Select Signals ......................................... 22Programming ................................................... 23VHDL Configuration File .................................. 23

Configuration Registers .......................................... 22Configuration Switches ....................................... 9, 20

BW_SEL .......................................................... 21FLASH_DIS ............................21, 37, 38, 39, 41MCU_SEL ..................................... 21, 22, 39, 40SRAM_DIS ................................... 21, 38, 39, 41

ConnectorsPower .............................................................. 10RJ-11 (six-wire), ICD 2 .............................. 10, 26RS-232 ............................................................ 10

CPLD Programming Connector .............................. 10CS1 Signal ........................................................ 22, 23CS2 Signal ..................................................19, 22, 23Customer Notification Service .................................. 5Customer Support ..................................................... 6

DDiagnostic Tests ..................................................... 38

Error Codes ..................................................... 40Host Managed ................................................. 40Stand-Alone ..................................................... 39

Document Conventions ............................................ 2Document Layout ...................................................... 1Documentation

Numbering Conventions .................................... 3Updates ............................................................. 3

EEEPROM ............................................................ 9, 24External Memory APIs ............................................ 28

Memory Erase ................................................. 29Memory Write .................................................. 28

FFLASH Memory .................................................. 9, 23

HHooking Up the Board ............................................. 14Host Computer Requirements ................................ 13Host Software ......................................................... 11

Command Line Options ................................... 35Commands ...................................................... 33Default Communication Speed ........................ 35Installation ....................................................... 13Main Window ................................................... 33Menu Bar ......................................................... 32Overview .......................................................... 31Status Bar ........................................................ 33Toolbar ............................................................ 32

JJTAG Connector ..................................................... 10

LLCD Display Header .........................................10, 26

Pinout .............................................................. 45LED Bank ............................................................ 9, 26

MMemory

EEPROM ..................................................... 9, 24FLASH ......................................................... 9, 23Primary ................................................19, 21, 34Secondary ...........................................19, 21, 34SRAM ..........................................................9, 24Using External Devices .................................... 24

Memory Daughter Board Headers .......................... 10Pinouts ............................................................. 45

Memory Map (Monitor Mode) .................................. 20Microchip Internet Web Site ...................................... 4Microcontroller Sockets ....................................... 9, 21MPLAB ICD 2

Connector ........................................................ 26Support Files .................................................... 47

MPLAB IDE ............................................................. 47

OOn-Board Monitor Firmware .......................10, 23, 27

Memory APIs .............................................27, 28Overview .......................................................... 27

Oscillator Configurations ..................................... 9, 24Oscillator Module (Socket) .................................. 9, 25

2001 Microchip Technology Inc. DS39565A-page 51

Page 58: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

PICDEMTM 18R User’s Guide

PPICDEM 18R Demonstration Board .......................... 8

Block Diagram ................................................. 43Special Signals in Schematic (Table) .............. 44

PICDEM 18R Demonstration Kit ............................... 7PICDEM 18R Software CD .................................7, 47

Contents .......................................................... 47Potentiometers, User Defined ................................... 9Power Connector .................................................... 10Power LED ........................................................10, 37Primary Memory ......................................... 19, 21, 34Prototype Area ........................................................ 10Prototype Area Header ........................................... 10Push Button

Reset ................................................................. 9User Defined ...................................................... 9

RRecommended Reading ........................................... 3RESET

Return-to-Monitor ................................ 25, 37, 38System Reset ................................................... 25

Resident Monitor. See On-Board Monitor Firmware.RS-232 Port ......................................................10, 26

SSecondary Memory .................................... 19, 21, 34Serial Port ............................................................... 15SRAM ..................................................................9, 24

TTroubleshooting

Communications Issues ................................... 38Diagnostic Error Codes .................................... 40Diagnostic Tests ................................. 38, 39, 40Power LED ....................................................... 37

WWWW Address .......................................................... 4

DS39565A-page 52 2001 Microchip Technology Inc.

Page 59: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

Index

NOTES:

2001 Microchip Technology Inc. DS39565A-page 53

Page 60: PICDEM 18R Demonstration Board User s Guideww1.microchip.com/downloads/en/DeviceDoc/39565a.pdf · 2009-06-14 · PICDEMTM 18R User’s Guide DS39565A-page 2 2001 Microchip Technology

DS39565A-page 54 2001 Microchip Technology Inc.

MAMERICASCorporate Office2355 West Chandler Blvd.Chandler, AZ 85224-6199Tel: 480-792-7200 Fax: 480-792-7277Technical Support: 480-792-7627Web Address: http://www.microchip.comRocky Mountain2355 West Chandler Blvd.Chandler, AZ 85224-6199Tel: 480-792-7966 Fax: 480-792-7456

Atlanta500 Sugar Mill Road, Suite 200BAtlanta, GA 30350Tel: 770-640-0034 Fax: 770-640-0307Austin - Analog13740 North Highway 183Building J, Suite 4Austin, TX 78750Tel: 512-257-3370 Fax: 512-257-8526Boston2 Lan Drive, Suite 120Westford, MA 01886Tel: 978-692-3848 Fax: 978-692-3821Boston - AnalogUnit A-8-1 Millbrook Tarry Condominium97 Lowell RoadConcord, MA 01742Tel: 978-371-6400 Fax: 978-371-0050Chicago333 Pierce Road, Suite 180Itasca, IL 60143Tel: 630-285-0071 Fax: 630-285-0075Dallas4570 Westgrove Drive, Suite 160Addison, TX 75001Tel: 972-818-7423 Fax: 972-818-2924DaytonTwo Prestige Place, Suite 130Miamisburg, OH 45342Tel: 937-291-1654 Fax: 937-291-9175DetroitTri-Atria Office Building 32255 Northwestern Highway, Suite 190Farmington Hills, MI 48334Tel: 248-538-2250 Fax: 248-538-2260Los Angeles18201 Von Karman, Suite 1090Irvine, CA 92612Tel: 949-263-1888 Fax: 949-263-1338New York150 Motor Parkway, Suite 202Hauppauge, NY 11788Tel: 631-273-5305 Fax: 631-273-5335San JoseMicrochip Technology Inc.2107 North First Street, Suite 590San Jose, CA 95131Tel: 408-436-7950 Fax: 408-436-7955Toronto6285 Northam Drive, Suite 108Mississauga, Ontario L4V 1X5, CanadaTel: 905-673-0699 Fax: 905-673-6509

ASIA/PACIFICAustraliaMicrochip Technology Australia Pty LtdSuite 22, 41 Rawson StreetEpping 2121, NSWAustraliaTel: 61-2-9868-6733 Fax: 61-2-9868-6755China - BeijingMicrochip Technology Consulting (Shanghai)Co., Ltd., Beijing Liaison OfficeUnit 915Bei Hai Wan Tai Bldg.No. 6 Chaoyangmen Beidajie Beijing, 100027, No. ChinaTel: 86-10-85282100 Fax: 86-10-85282104China - ChengduMicrochip Technology Consulting (Shanghai)Co., Ltd., Chengdu Liaison OfficeRm. 2401, 24th Floor, Ming Xing Financial TowerNo. 88 TIDU StreetChengdu 610016, ChinaTel: 86-28-6766200 Fax: 86-28-6766599China - FuzhouMicrochip Technology Consulting (Shanghai)Co., Ltd., Fuzhou Liaison OfficeRm. 531, North BuildingFujian Foreign Trade Center Hotel73 Wusi RoadFuzhou 350001, ChinaTel: 86-591-7557563 Fax: 86-591-7557572China - ShanghaiMicrochip Technology Consulting (Shanghai)Co., Ltd.Room 701, Bldg. BFar East International PlazaNo. 317 Xian Xia RoadShanghai, 200051Tel: 86-21-6275-5700 Fax: 86-21-6275-5060China - ShenzhenMicrochip Technology Consulting (Shanghai)Co., Ltd., Shenzhen Liaison OfficeRm. 1315, 13/F, Shenzhen Kerry Centre,Renminnan LuShenzhen 518001, ChinaTel: 86-755-2350361 Fax: 86-755-2366086Hong KongMicrochip Technology Hongkong Ltd.Unit 901-6, Tower 2, Metroplaza223 Hing Fong RoadKwai Fong, N.T., Hong KongTel: 852-2401-1200 Fax: 852-2401-3431IndiaMicrochip Technology Inc.India Liaison OfficeDivyasree Chambers1 Floor, Wing A (A3/A4)No. 11, O’Shaugnessey RoadBangalore, 560 025, IndiaTel: 91-80-2290061 Fax: 91-80-2290062

JapanMicrochip Technology Japan K.K.Benex S-1 6F3-18-20, ShinyokohamaKohoku-Ku, Yokohama-shiKanagawa, 222-0033, JapanTel: 81-45-471- 6166 Fax: 81-45-471-6122KoreaMicrochip Technology Korea168-1, Youngbo Bldg. 3 FloorSamsung-Dong, Kangnam-KuSeoul, Korea 135-882Tel: 82-2-554-7200 Fax: 82-2-558-5934SingaporeMicrochip Technology Singapore Pte Ltd.200 Middle Road#07-02 Prime CentreSingapore, 188980Tel: 65-334-8870 Fax: 65-334-8850TaiwanMicrochip Technology Taiwan11F-3, No. 207Tung Hua North RoadTaipei, 105, TaiwanTel: 886-2-2717-7175 Fax: 886-2-2545-0139

EUROPEDenmarkMicrochip Technology Denmark ApSRegus Business CentreLautrup hoj 1-3Ballerup DK-2750 DenmarkTel: 45 4420 9895 Fax: 45 4420 9910FranceArizona Microchip Technology SARLParc d’Activite du Moulin de Massy43 Rue du Saule TrapuBatiment A - ler Etage91300 Massy, FranceTel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79GermanyArizona Microchip Technology GmbHGustav-Heinemann Ring 125D-81739 Munich, GermanyTel: 49-89-627-144 0 Fax: 49-89-627-144-44Germany - AnalogLochhamer Strasse 13D-82152 Martinsried, GermanyTel: 49-89-895650-0 Fax: 49-89-895650-22ItalyArizona Microchip Technology SRLCentro Direzionale Colleoni Palazzo Taurus 1 V. Le Colleoni 120041 Agrate BrianzaMilan, Italy Tel: 39-039-65791-1 Fax: 39-039-6899883United KingdomArizona Microchip Technology Ltd.505 Eskdale RoadWinnersh TriangleWokingham Berkshire, England RG41 5TUTel: 44 118 921 5869 Fax: 44-118 921-5820

08/01/01

WORLDWIDE SALES AND SERVICE


Recommended