PICDEM™ PIC18 Explorer Demonstration Board User’s Guide 2008-2015 Microchip Technology Inc. DS50001721C Note the following details of the code protection feature on Microchip devices: • Microchip products meet the specification contained in their particular Microchip Data Sheet. • Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. • There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. • Microchip is willing to work with the customer who is concerned about the integrity of their code. • Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.” Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act. Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer’s risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights. Trademarks The Microchip name and logo, the Microchip logo, dsPIC, FlashFlex, flexPWR, JukeBlox, KEELOQ, KEELOQ logo, Kleer, LANCheck, MediaLB, MOST, MOST logo, MPLAB, OptoLyzer, PIC, PICSTART, PIC32 logo, RightTouch, SpyNIC, SST, SST Logo, SuperFlash and UNI/O are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. The Embedded Control Solutions Company and mTouch are registered trademarks of Microchip Technology Incorporated in the U.S.A. Analog-for-the-Digital Age, BodyCom, chipKIT, chipKIT logo, CodeGuard, dsPICDEM, dsPICDEM.net, ECAN, In-Circuit Serial Programming, ICSP, Inter-Chip Connectivity, KleerNet, KleerNet logo, MiWi, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach, Omniscient Code Generation, PICDEM, PICDEM.net, PICkit, PICtail, RightTouch logo, REAL ICE, SQI, Serial Quad I/O, Total Endurance, TSHARC, USBCheck, VariSense, ViewSpan, WiperLock, Wireless DNA, and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries. GestIC is a registered trademark of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries. All other trademarks mentioned herein are property of their respective companies. © 2008-2015, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. ISBN: 978-1-63277-532-0 QUALITY MANAGEMENT SYSTEM CERTIFIED BY DNV == ISO/TS 16949 == DS50001721C-page 2 Microchip received ISO/TS-16949:2009 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California and India. The Company’s quality system processes and procedures are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified. 2008-2015 Microchip Technology Inc. PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD USER’S GUIDE Table of Contents Preface ........................................................................................................................... 5 Chapter 1. Introduction 1.1 Introduction ................................................................................................... 11 1.2 Development Kit Contents ............................................................................ 11 1.3 PICDEM™ PIC18 Explorer Demonstration Board ....................................... 12 1.4 Sample Devices ........................................................................................... 13 1.5 Sample Programs ......................................................................................... 13 Chapter 2. Getting Started 2.1 Board as Stand-Alone Device ...................................................................... 15 2.1.1 Using the Board As Is ................................................................................ 16 2.1.2 Reprogramming the Microcontroller .......................................................... 17 2.2 Board with In-Circuit Debugger .................................................................... 17 2.3 Board with PIM Attached Devices ................................................................ 18 2.3.1 Attaching the PIM ...................................................................................... 19 2.3.2 Varying the Device Voltage (5V/3.3V) ....................................................... 20 2.3.3 Calculating Other VDD Values ................................................................... 21 2.4 Programming the Microcontrollers ............................................................... 22 2.4.1 Programming Requirements ...................................................................... 22 2.4.2 Loading the Program Using MPLAB® IDE ................................................ 23 2.4.2.1 Reprogramming with the Compact Disc Sample Code ............. 23 2.4.3 Loading the Program Using MPLAB® X IDE ............................................. 25 2.4.3.1 Reprogramming with the Compact Disc Sample Code ............. 25 2.4.4 Converting the MPLAB IDE Project to an MPLAB X IDE Project .............. 27 2.4.5 Opening the MPLAB X Project File on MPLAB X IDE ............................... 28 2.4.6 How to Select Device on MPLAB X IDE .................................................... 29 2.4.7 Using the MPLAB Device Driver Switcher ................................................. 29 2.5 Connecting to Host PC for RS-232 Communication .................................... 30 2.5.1 PC Connection Via DB9 Pin ...................................................................... 30 2.5.2 PC Connection Via USB Port .................................................................... 31 Chapter 3. Tutorial Program 3.1 Tutorial Program Operation .......................................................................... 33 3.2 Source Code and Data Sheets ..................................................................... 35 Appendix A. Hardware Details A.1 Hardware Elements ..................................................................................... 37 A.1.1 Processor Sockets .................................................................................... 37 A.1.2 Display ...................................................................................................... 37 A.1.3 Power Supply ............................................................................................ 37 A.1.4 RS-232 Serial Port .................................................................................... 37 A.1.5 Switches .................................................................................................... 38 A.1.6 Oscillator Options ...................................................................................... 38 2008-2015 Microchip Technology Inc. DS50001721C-page 3 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide A.1.7 Analog Input (Potentiometer) .....................................................................38 A.1.8 ICD Connector ...........................................................................................38 A.1.9 PICkit™ 2 Connector .................................................................................38 A.1.10 Temperature Sensor ................................................................................38 A.1.11 Serial EEPROM .......................................................................................38 A.1.12 PICtail™ Daughter Board Connector ......................................................39 A.1.13 LCD .........................................................................................................39 A.1.14 Sample Devices .......................................................................................39 A.2 Board Layout and Schematics ..................................................................... 40 Worldwide Sales and Service .....................................................................................44 DS50001721C-page 4 2008-2015 Microchip Technology Inc. PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD USER’S GUIDE Preface NOTICE TO CUSTOMERS All documentation becomes dated, and this manual is no exception. Microchip tools and documentation are constantly evolving to meet customer needs, so some actual dialogs and/or tool descriptions may differ from those in this document. Please refer to our web site (www.microchip.com) to obtain the latest documentation available. Documents are identified with a “DS” number. This number is located on the bottom of each page, in front of the page number. The numbering convention for the DS number is “DSXXXXXA”, where “XXXXX” is the document number and “A” is the revision level of the document. For the most up-to-date information on development tools, see the MPLAB® IDE online help. Select the Help menu, and then Topics to open a list of available online help files. INTRODUCTION This chapter contains general information that will be useful to know before using the PICDEM™ PIC18 Explorer Demonstration Board. Items discussed in this chapter include: • • • • • • • • Document Layout Conventions Used in This Guide Warranty Registration Recommended Reading The Microchip Web Site Development Systems Product Change Notification Service Customer Support Revision History DOCUMENT LAYOUT This document describes how to use the PICDEM PIC18 Explorer Demonstration Board as a development tool to emulate and debug firmware on a target board. The document is organized as follows: • Chapter 1. “Introduction” – Overview of the development board and kit • Chapter 2. “Getting Started” – Description of the different ways to use the board • Chapter 3. “Tutorial Program” – Explanation of the tutorial preprogrammed on the sample devices • Appendix A. “Hardware Details” – Description of the board’s hardware elements, including layout and schematic drawings 2008-2015 Microchip Technology Inc. DS50001721C-page 5 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide CONVENTIONS USED IN THIS GUIDE This manual uses the following documentation conventions: DOCUMENTATION CONVENTIONS Description Arial font: Italic characters Initial caps Quotes Underlined, italic text with right angle bracket Bold characters N‘Rnnnn Text in angle brackets < > Courier New font: Plain Courier New Represents Examples Referenced books Emphasized text A window A dialog A menu selection A field name in a window or dialog A menu path MPLAB® IDE User’s Guide ...is the only compiler... the Output window the Settings dialog select Enable Programmer “Save project before build” A dialog button A tab A number in verilog format, where N is the total number of digits, R is the radix and n is a digit. A key on the keyboard Click OK Click the Power tab 4‘b0010, 2‘hF1 Italic Courier New Sample source code Filenames File paths Keywords Command-line options Bit values Constants A variable argument Square brackets [ ] Optional arguments Curly brackets and pipe character: { | } Ellipses... Choice of mutually exclusive arguments; an OR selection Replaces repeated text Represents code supplied by user DS50001721C-page 6 File>Save Press <Enter>, <F1> #define START autoexec.bat c:\mcc18\h _asm, _endasm, static -Opa+, -Opa0, 1 0xFF, ‘A’ file.o, where file can be any valid filename mcc18 [options] file [options] errorlevel {0|1} var_name [, var_name...] void main (void) { ... } 2008-2015 Microchip Technology Inc. Preface WARRANTY REGISTRATION Please complete the enclosed Warranty Registration Card and mail it promptly. Sending in the Warranty Registration Card entitles users to receive new product updates. Interim software releases are available at the Microchip web site. RECOMMENDED READING This user’s guide describes how to use the PICDEM PIC18 Explorer Demonstration Board. The following documents are available and recommended as supplemental reference resources. Readme file This file contains brief details regarding the contents of the folders included in the CD-ROM which comes with the PIC18 Explorer development kit. MPLAB® ICD 3 In-Circuit Debugger User’s Guide (DS51766) This document provides all the necessary information on the MPLAB® ICD 3 In-Circuit Debugger’s operation, installation, general setup and tutorial details. The MPLAB ICD 3 is a cost-effective high-speed hardware debugger/programmer developed by Microchip for PIC® microcontrollers and Digital Signal Controllers (DSCs). MPLAB® REAL ICE™ In-Circuit Emulator User’s Guide (DS50002085) This user’s guide describes how to use the MPLAB® REAL ICE In-Circuit Emulator as a development tool to emulate and debug firmware on a target board, as well as how to program devices. It provides details on the emulator’s operation, features, troubleshooting, software and hardware reference and emulator accessories. PICkit™ 2 Programmer/Debugger User’s Guide (DS51553) This user’s guide describes how to use the PICkit™ 2 as a development tool to program and debug firmware on a target board. It covers the features, operation, troubleshooting, using the ICSP™ and other essential information about the PICkit 2 Programmer/Debugger. PICkit™ 3 In-Circuit Debugger/Programmer User’s Guide for MPLAB® X IDE (DS52116) This user’s guide describes the PICkit™ 3 In-Circuit Debugger/Programmer’s operation, usage, troubleshooting methods and hardware specifications. The PICkit 3 can be implemented as a debugger or development programmer for Microchip PIC MCUs and DSCs that are based on In-Circuit Serial Programming™ (ICSP™) and Enhanced ICSP™ 2-wire serial interfaces. 2008-2015 Microchip Technology Inc. DS50001721C-page 7 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide THE MICROCHIP WEB SITE Microchip provides online support via our web site at www.microchip.com. This web site is used as a means to make files and information easily available to customers. Accessible by using your favorite Internet browser, the web site contains the following information: • Product Support – Data sheets and errata, application notes and sample programs, design resources, user’s guides and hardware support documents, latest software releases and archived software • General Technical Support – Frequently Asked Questions (FAQs), technical support requests, online discussion groups, Microchip consultant program member listing • Business of Microchip – Product selector and ordering guides, latest Microchip press releases, listing of seminars and events, listings of Microchip sales offices, distributors and factory representatives DEVELOPMENT SYSTEMS PRODUCT CHANGE NOTIFICATION SERVICE Microchip’s customer notification service helps keep customers current on Microchip products. Subscribers will receive e-mail notification whenever there are changes, updates, revisions or errata related to a specified product family or development tool of interest. To register, access the Microchip web site at www.microchip.com, click on Product Change Notification and follow the registration instructions. The Development Systems product group categories are: • Compilers – The latest information on Microchip C compilers, assemblers, linkers and other language tools. These include the MPLAB® XC Compilers that support all 8-, 16- and 32-bit PIC MCUs and dsPIC® DSCs. • Emulators – The latest information on Microchip in-circuit emulators.This includes the MPLAB® REAL ICE™ In-Circuit Emulator. • In-Circuit Debuggers – The latest information on the Microchip in-circuit debuggers. This includes the MPLAB® ICD 3 In-Circuit Debugger and the PICkit™ 3 In-Circuit Debugger. • MPLAB® X IDE – The latest information on Microchip MPLAB X IDE, the Integrated Development Environment for development systems tools which can be run on Windows®, Mac OS® and LINUX®operating systems. • Programmers – The latest information on Microchip programmers. These include the device (production) programmers MPLAB REAL ICE in-circuit emulator, MPLAB ICD 3 in-circuit debugger, MPLAB PM3 and the development (nonproduction) programmer PICkit 3. DS50001721C-page 8 2008-2015 Microchip Technology Inc. Preface CUSTOMER SUPPORT Users of Microchip products can receive assistance through several channels: • • • • Distributor or Representative Local Sales Office Field Application Engineer (FAE) Technical Support Customers should contact their distributor, representative or field application engineer (FAE) for support. Local sales offices are also available to help customers. A listing of sales offices and locations is included in the back of this document. Technical support is available through the web site at: http://www.microchip.com/support. REVISION HISTORY Revision A (March 2008) Initial release of this document. Revision B (May 2008) Name and title change. Revision C (June 2015) IDE, compiler, programmer, debugger and board tutorial program updates. 2008-2015 Microchip Technology Inc. DS50001721C-page 9 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide NOTES: DS50001721C-page 10 2008-2015 Microchip Technology Inc. PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD USER’S GUIDE Chapter 1. Introduction 1.1 INTRODUCTION The PICDEM™ PIC18 Explorer Demonstration Board is a demonstration board for evaluating Microchip Technology’s PIC18FXXXX and PIC18FXXJXX families of devices. The board can be used as a stand-alone device or with an in-circuit debugger, such as the MPLAB ICD 3, and host PC. Sample programs are provided to demonstrate the unique features of the supported devices. Free software development tools are available for application development and debugging. 1.2 DEVELOPMENT KIT CONTENTS The PICDEM PIC18 Explorer Demonstration Board Kit comes with the following: • PICDEM PIC18 Explorer Demonstration Board (Figure 1-1) • Board-mounted PIC18F8722 and an alternate PIC18F87J11 mounted on a Plug-In Module (PIM) • CD-ROM that contains: - Sample programs, source code and hex files - PICDEM™ PIC18 Explorer Demonstration Board User’s Guide (DS50001721) - Other referenced documents If the kit is missing any of these parts, please contact the nearest Microchip sales office listed in the back of this publication. The MPLAB® Integrated Development Environment (IDE) is a free, integrated software tool set for application development and debugging. Compilers and other board-compatible software and hardware tools can be purchased. To download the MPLAB IDE software and documentation, or get information on the other tools, visit www.microchip.com. 2008-2015 Microchip Technology Inc. DS50001721C-page 11 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide 1.3 PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD The PICDEM PIC18 Explorer Demonstration Board has the following hardware features with each feature’s number corresponding to the number in Figure 1-1 that shows the feature’s location on the board: 1. PIC18F8722 microcontroller – The sample, primary microcontroller mounted on the board. 2. Male header pins for connecting Plug-In Modules (PIMs). A PIM enables an alternate PIC18 device to be connected to the board, as the primary microcontroller. 3. In-Circuit Debugger (ICD) connector. 4. 6-pin, PICkit™ 2 connector. 5. 10 k potentiometer for analog inputs. 6. Push button switch – For external Reset. 7. USB connector – For RS-232 communication. 8. PIC18LF2450 microcontroller – For converting RS-232 communication to USB protocol for attachment of a host PC. 9. 12 MHz crystal – For the PIC18LF2450 microcontroller. 10. RS-232 DB9 socket and associated hardware – For direct connection to an RS-232 interface. 11. Jumper J13 for routing RS-232 communication through either the USB port or the RS-232 socket. 12. Jumper J4 – For selecting between programming the main PIC® device or the PIC18LF2450, used for USB to RS-232 communication. 13. Switch S4 – For designating the main microcontroller as either the board-mounted PIC18F8722 or a PIM-mounted microcontroller. 14. LED – For power-on indication. 15. JP1 – For disconnecting the eight display LEDs. 16. Eight LEDs. 17. 32.768 kHz crystal – For Timer1 clock operation. 18. Two push button switches – For external stimulus. 19. Analog temperature sensor, MPC9701A. 20. 25LC256 SPI EEPROM. 21. JP2 – To enable/disable EEPROM. 22. JP3 – To enable/disable LCD. 23. 10 MHz crystal – For the main microcontroller. 24. PICtail™ daughter board connector socket. 25. SPI I/O expander – For LCD display, MCP23S17. 26. Prototype area – For user hardware. 27. LCD display. 28. J2 three-pin, male header – For selecting between a voltage of 3.3V or 5V. 29. J14 four-pin, male header – For use with a PIM, if required, to connect 3.3V or 5V, VIN and ICE MCLR. DS50001721C-page 12 2008-2015 Microchip Technology Inc. Introduction FIGURE 1-1: PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD 6 5 2 29 1 28 27 26 4 3 7 8 9 10 25 24 11 12 13 14 15 16 17 18 19 20 21 1.4 23 22 SAMPLE DEVICES The PICDEM PIC18 Explorer Demonstration Board comes with two sample devices that alternately can be used as the main microcontroller: • An 80-pin, 5V PIC microcontroller (the PIC18F8722) mounted on the board • A 3.3V PIC18 device (PIC18F87J11) mounted on an 80-pin PIM that connects to the demo board via an 80-pin male 1.5 SAMPLE PROGRAMS The PICDEM PIC18 Explorer Demonstration Board Kit includes a CD-ROM with sample demonstration programs. These programs may be used with the included sample devices and with an in-circuit debugger (ICD). Also provided on the disc is demonstration source code that includes several assembly source code (ASM) files and one hex compiled code file. Demo source codes in C are also available on the Microchip web site. 2008-2015 Microchip Technology Inc. DS50001721C-page 13 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide NOTES: DS50001721C-page 14 2008-2015 Microchip Technology Inc. PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD USER’S GUIDE Chapter 2. Getting Started The PICDEM PIC18 Explorer Demonstration Board may be used in a variety of ways. Table 2-1 lists the three primary configurations and the required equipment and capabilities of each. TABLE 2-1: PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD CONFIGURATIONS Configuration Board Connections Stand-alone board Power supply Board with In-Circuit Debugger/Programmer • Power supply • In-Circuit Debugger (ICD) that also can be used as a programmer • Power supply Board with alternate microcontroller, attached • ICD that can also be used as a through a Plug-In Module programmer (PIM) • PIM with mounted microcontroller † Board Capabilities • • • • Access board’s full functionality Demonstrate sample code Display functionality with LCD or LEDs Connect ICD/programmer for debugging or programming • Connect PICtail™ daughter cards • • • • • Access board’s full functionality Demonstrate sample code Develop and debug code Reprogram microcontrollers Connect PICtail daughter cards • Substitute PIM-mounted device as main microcontroller(†) • Use 3.3V or 5V devices as main microcontroller • Demonstrate sample code • Develop and debug code • Reprogram microcontrollers • Connect PICtail daughter cards PIM enables 80, 64, 44 and 28-pin devices to be used as the main microcontroller. For information on the available PIMs, go to www.microchip.com. This chapter describes: • How to implement each of the uses described in Table 2-1 • How to reprogram the main and RS-232 to USB microcontrollers • How to connect the demonstration board to a host PC for RS-232 communication 2.1 BOARD AS STAND-ALONE DEVICE In using the PICDEM PIC18 Explorer Demonstration Board as a stand-alone device, an implementation can: • Use the board as is, utilizing the firmware loaded on the main, PIC18F8722 microcontroller and RS-232 to USB PIC18LF2450 microcontroller • Reprogram the main, PIC18F8722 microcontroller or the RS-232 to USB, PIC18LF2450 microcontroller and demonstrate user programs 2008-2015 Microchip Technology Inc. DS50001721C-page 15 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide 2.1.1 Using the Board As Is To immediately implement the PICDEM PIC18 Explorer Demonstration Board to demonstrate the PIC18F8722 microcontroller: 1. Designate the mounted, PIC18F8722 device as the board’s main microcontroller by moving switch S4 to PIC MCU, as shown in Figure 2-1. FIGURE 2-1: S4 SWITCH – SETTING FOR DEFAULT MAIN MICROCONTROLLER Switch Location Switch Position PIC® MCU S4 Switch S4 ICE 2. Enable the LEDs by placing a jumper on JP1, as shown in Figure 2-2. FIGURE 2-2: JP1, JP2 AND JP3 JUMPERS JP2 JP3 JP1 3. Enable the EEPROM and the LCD by placing a jumper on JP2 and JP3, as shown in Figure 2-2. 4. Apply power to the board. For information on acceptable power sources, see Appendix A. “Hardware Details”. The device now can be demonstrated using the tutorial program. (See Section 3.1 “Tutorial Program Operation”.) DS50001721C-page 16 2008-2015 Microchip Technology Inc. Getting Started 2.1.2 Reprogramming the Microcontroller Either or both the main PIC18F8722 microcontroller and RS-232-USB, or the PIC18LF2450 microcontroller, can be reprogrammed for running the board as a stand-alone device. To implement this usage: 1. Reprogram either or both devices, as described in Section 2.4 “Programming the Microcontrollers”. 2. Disconnect the programming devices. 3. Follow the procedure given in Section 2.1.1 “Using the Board As Is”. 2.2 BOARD WITH IN-CIRCUIT DEBUGGER The PICDEM PIC18 Explorer Demonstration Board can also be connected to an In-Circuit Debugger (ICD) that is connected to a host PC. This can be done with the board’s main microcontroller configured as either the mounted PIC18F8722 device or an alternate device mounted to a PIM that is plugged into the board. (For information on PIM attached devices, see Section 2.3 “Board with PIM Attached Devices”.) The MPLAB ICD 3 In-Circuit Debugger is an inexpensive ICD that could be used. (For more information, see Section 2.4.1 “Programming Requirements”.) The ICD is connected, as shown in Figure 2-3, to the ICD connector. For operational information, see MPLAB® ICD 3 In-Circuit Debugger User’s Guide (DS51766). The PICDEM PIC18 Explorer Demonstration Board can alternately use the PICkit™ 3 In-Circuit Debugger/Programmer or the MPLAB REAL ICE™ emulator as debugger. FIGURE 2-3: BOARD WITH MPLAB® ICD 3 IN-CIRCUIT DEBUGGER ATTACHED For information on other microcontroller compatible ICD or ICE devices, see the Microchip web site at www.microchip.com. 2008-2015 Microchip Technology Inc. DS50001721C-page 17 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide 2.3 BOARD WITH PIM ATTACHED DEVICES The PICDEM PIC18 Explorer Demonstration Board also can be used to demonstrate other PIC18 devices – having them replace the PIC18F8722 mounted on the board as the board’s main microcontroller. This is done by attaching a Plug-In Module (PIM) that has the other microcontroller mounted to it. The PICDEM PIC18 Explorer Demonstration Board comes with the PIC18F87J11 PIM representing the super set device for the PIC18 J-series of products. FIGURE 2-4: PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD WITH PIM Plug-In Module (PIM) The PIM enables the attachment of 80, 64, 44 or 28-pin devices. Some PIMs also enable the board’s 5V output to be automatically reset to 3.3V. For a list of microcontroller-compatible PIMs go to www.microchip.com. DS50001721C-page 18 2008-2015 Microchip Technology Inc. Getting Started 2.3.1 Attaching the PIM To attach the PIM: 1. Seat the PIM in the 80-pin, elevated, male connectors that encircle the PIC18F8722 (see Figure 2-5). FIGURE 2-5: PIM CONNECTORS AND S4 SWITCH PIM Connectors S4 Switch Alternately, an In-Circuit Emulator (ICE) can be attached to the male connectors. This enables in-circuit emulation and user development and debugging of code. For information on this use, see the Microchip web site (www.microchip.com). 2. To designate the PIM-mounted device as the main microcontroller, set switch S4 (shown in Figure 2-5) to ICE (see Figure 2-6). FIGURE 2-6: S4 SWITCH – SETTING FOR PIM-MOUNTED DEVICES PIC® MCU S4 ICE 3. If you are converting from the board’s default VDD of 5V, see Section 2.3.2 “Varying the Device Voltage (5V/3.3V)”. 2008-2015 Microchip Technology Inc. DS50001721C-page 19 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide 2.3.2 Varying the Device Voltage (5V/3.3V) By default, the PICDEM PIC18 Explorer Demonstration Board’s VDD supply is 5V. The VDD can be varied, for PIM-mounted microcontrollers, from 5 to 3.3V to accommodate devices running at 5 or 3.3V. This VDD is named VAR. The PICDEM PIC18 Explorer Demonstration Board enables the voltage change with PIM connection headers and a variable voltage regulator. PIMs mounted with 3.3V devices implement the voltage change through two resistors with values that produce the desired voltage (see Section 2.3.3 “Calculating Other VDD Values”.) The voltage varying hardware includes: • An adjustable voltage regulator, the LM317 – Located on the board, left of the PIM connectors and marked as U2 (recognizable by the TO-220 package commonly used for transistors) • Header J2 – Located above the PIM connectors • Resistors R25 and R26 – Located below jumper J13 • Resistors R101 and R102 – Located on the PIM board In setting the board’s voltage: • For the default, 5V voltage – - For board-mounted PIC18F8722 device: • Board resistor R25 = 1 k • Board resistor R26 = 330 - For a PIM-mounted, 5V microcontroller: • Board resistors R25 and R26 – Same values of 1 k and 330, respectively • PIM-mounted resistors R101 and R102 – Unpopulated • For 3.3V VDD (achieved only with a PIM with a mounted 3.3V device, such as the PIC18F87J11) – - Header J2 goes into the PIM board where resistors R101 and R102 are inserted in parallel to the board resistors R25 and R26 - PIM board resistor R101 can be unpopulated - PIM board resistor R102 can be 1.18 k Note: DS50001721C-page 20 For precise adjustment of VDD, 1% resistors are recommended. 2008-2015 Microchip Technology Inc. Getting Started 2.3.3 Calculating Other VDD Values Other VDD values can be produced by the LM317 adjustable voltage regulator by populating the PIM board’s R101 and R102 with different value resistors. A brief overview follows, on how to calculate alternate values for these resistors. For detailed information, see the LM317 data sheet. EQUATION 2-1: REGULATOR VOLTAGE OUTPUT R2 V OUT = V REF 1 + ------- + I ADJ R2 R1 IADJ is minimized by the LM317, so it can be assumed to be zero, or very small. VREF is the reference voltage developed by the LM317 between the output and adjustment terminal and equals 1.25V. That produces the equations shown in Equation 2-2. EQUATION 2-2: CALCULATING OUTPUT VOLTAGE R2 V OUT = 1.25V 1 + ------- R1 R25 R102 R2 = R25 R102 = --------------------------------- R25 + R102 R26 R101 R1 = R26 R101 = --------------------------------- R26 + R101 As stated previously, R25 = 1 k, and R26 = 330. Without R102 and R101 being inserted in parallel on the PIM board, VOUT =1.25V(1+ 1 k/330) = 5.04V. To calculate a desired VOUT: 1. Solve for R2, given R1 = R26 = 330. 2. Now knowing R2 and R25, solve for R102. 3. Determine the nearest available resistor value for R102 and recalculate the resulting VDD to make sure it does not exceed the maximum VDD for the part you will be using. Table 2-2 shows the R101 and R102 resistor values to use for different VDD values. The table assumes that the PICDEM PIC18 Explorer Demonstration Board’s R25 and R26 resistors are left at their default values of 1K and 330, respectively. CALCULATING R101, R102 VALUES FOR VDD OUTPUTS(†) TABLE 2-2: † VDD R101 Value R102 Value 5V Open Open 3.6V Open 1.62 k 3.3V Open 1.18 k 3.0V Open 866 R This table assumes that the PICDEM PIC18 Explorer Demonstration Board’s R25 and R26 resistors are left at their default values of 1 k and 330, respectively. 2008-2015 Microchip Technology Inc. DS50001721C-page 21 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide 2.4 PROGRAMMING THE MICROCONTROLLERS Either or both the main microcontroller (PIC18F8722) and the RS-232 to USB, or the PIC18LF2450 microcontroller, can be reprogrammed. The main microcontroller that is reprogrammed can either be the board-mounted PIC18F8722 device or an alternate main microcontroller, mounted on a PIM attached to the board. This section discusses: • Programming Requirements • Loading the Program Using MPLAB® IDE • Loading the Program Using MPLAB X® IDE 2.4.1 Programming Requirements To reprogram a sample device, the following is required: • Program source code – Sample code is preloaded on the device, but user source code can be substituted. If this is done, the sample program can be restored using the file on the board kit’s CD-ROM or by downloading the project files available at the Microchip web site. • An assembler or compiler – Source code must be assembled or compiled into a hex file before it can be programmed into the device. • A programmer – Once the code is in the hex file format, this device programs the microcontroller’s Flash memory. If the code protection bit(s) have not been programmed, the on-chip program memory can be read out for verification purposes. In meeting these requirements, the following items are to be taken into consideration: • Code development and debugging – The free MPLAB X IDE and MPLAB IDE software development tools include a debugger and several other software tools as well as a unified graphical user interface for working with other Microchip and third-party software and hardware tools. • Assembler – The free MPLAB IDE tool includes the MPASM™ assembler. • Compiler – Microchip’s MPLAB® XC8 Compiler and the MPLAB® C18 Compiler are fully integrated for the MPLAB IDE environment. • Programmer – Microchip’s MPLAB® In-Circuit Debugger (ICD) 3, PICkit 3 In-Circuit Debugger/Programmer, or MPLAB REAL ICE In-Circuit Emulator can be used to program the device and all are fully integrated for the MPLAB IDE environment. The free MPLAB IDE tool set and its documentation can be downloaded at www.microchip.com. For a list of the other mentioned devices’ documentation, see “Recommended Reading. Other assemblers/compilers can be used. For a list of tools compatible with PIC microcontrollers, see the Microchip web site (www.microchip.com). DS50001721C-page 22 2008-2015 Microchip Technology Inc. Getting Started Loading the Program Using MPLAB® IDE 2.4.2 This section describes how to program the PICDEM PIC18 Explorer Demonstration Board using the MPLAB® Integrated Development Environment (IDE) and the sample hex code on the compact disc in the PICDEM PIC18 Explorer Demonstration Board’s Kit. 2.4.2.1 REPROGRAMMING WITH THE COMPACT DISC SAMPLE CODE To program the PIC18F8722: 1. Launch the MPLAB IDE application and select Configure>Select Device>18F8722. 2. To start the programmer, select Programmer>Select Programmer> ICD2. 3. To open the hex code file, select File>Import>Open and select CD/Hex/18F8722/Demo8722.hex. 4. Connect the J4 jumper to Main (main controller), as shown in Figure 2-7. FIGURE 2-7: J4 JUMPER AND ‘MAIN’ SETTING Jumper Location Jumper Setting J4 Jumper USB J4 Main 5. Move the S4 switch to PIC MCU, as described in Section 2.1.1 “Using the Board As Is”. To program the PIC18F87J11 on the PIM: 1. Attach the PIM to the demonstration board. 2. Move the S4 switch to ICE. Note: Steps 1 and 2 are described in Section 2.3.1 “Attaching the PIM”. 3. Launch the MPLAB IDE application and select Configure>Select Device>18F87J11. 4. To start the programmer, select Programmer>Select Programmer>ICD2. 5. To open the hex code file, select File>Import>Open and select CD/Hex/18F87J11/Demo87J11.hex. 6. Connect the J4 jumper to Main (main controller), as shown in Figure 2-7. 2008-2015 Microchip Technology Inc. DS50001721C-page 23 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide To program the PIC18LF2450 for RS-232 UART communication: 1. Launch the MPLAB IDE application and select Configure>Select Device>18F2450. 2. To start the programmer, select Programmer>Select Programmer>ICD2. 3. To open the hex code file, select File>Import>Open and select CD/Hex/RS232_USB_18F2450/Demo2450.hex. 4. Connect the J4 jumper to USB, as shown in Figure 2-8. FIGURE 2-8: J4 JUMPER AND ‘USB’ SETTING Jumper Location Jumper Setting J4 Jumper USB J4 Main DS50001721C-page 24 2008-2015 Microchip Technology Inc. Getting Started 2.4.3 Loading the Program Using MPLAB® X IDE This section describes how to program the PICDEM PIC18 Explorer Demonstration Board using the MPLAB® X Integrated Development Environment (IDE) and the sample hex code on the compact disc in the PICDEM PIC18 Explorer Demonstration Board’s Kit. 2.4.3.1 Note: REPROGRAMMING WITH THE COMPACT DISC SAMPLE CODE The MPLAB® X IDE will generate a Prebuilt Project file folder. Since the CD drive does not have enough free space, the hex files should be copied to another drive location (i.e., C: drive). Once the hex files are already transferred to another location, the following steps can now be executed. To program PIC18F8722: 1. Launch the MPLAB X IDE application and select File>Import>Hex/ELF… (Prebuilt) File and a pop-up window will appear as shown in Figure 2-9. FIGURE 2-9: CREATING A PRE-BUILT PROJECT ON MPLAB® X 2. Browse the Demo8722.hex file on the C: drive. Select “Advanced 8-bit MCUs (PIC18)” under the Family menu. Select “PIC18F8722” as the Device. Under the Hardware Tool, select the programmer to be used. For this example, the MPLAB ICD 3 is used to program the device. 3. Click Next>. Select “Set as main project”. 4. Click Finish. The Prebuilt Project file is now created. 5. Connect the J4 jumper to Main (main controller), as shown in Figure 2-7. 6. Move the S4 switch to PIC MCU, as described in Section 2.1.1 “Using the Board As Is”. 7. Click the Make and Program Device icon ( ). 2008-2015 Microchip Technology Inc. DS50001721C-page 25 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide To program PIC18F87J11 on the PIM: 1. Attach the PIM to the demonstration board. 2. Move the S4 switch to ICE. Note: Steps 1 and 2 are described in Section 2.3.1 “Attaching the PIM”. 3. Launch the MPLAB X IDE application and select File>Import>Hex/ELF… (Prebuilt) File and a pop-up window will appear. 4. Browse the Demo87J11.hex file on the C: drive. Select “Advanced 8-bit MCUs (PIC18)” under the Family menu. Select “PIC18F87J11” as the Device. Under the Hardware Tool, select the programmer to be used. 5. Click Next>. Select “Set as main project”. 6. Click Finish. The Prebuilt Project file is now created. 7. Connect the J4 jumper to Main (main controller), as shown in Figure 2-7. 8. Click the Make and Program Device icon. To program the PIC18LF2450 for RS-232 UART communication: 1. Launch the MPLAB X IDE application and select File>Import>Hex/ELF… (Prebuilt) File and a pop-up window will appear. 2. Browse the Demo2450.hex file on the C: drive. Select “Advanced 8-bit MCUs (PIC18)” under the Family menu. Select PIC18LF2450 as the Device. Under the Hardware Tool, select the programmer to be used. 3. Click Next>. Select “Set as main project”. 4. Click Finish. The Prebuilt Project file is now created. 5. Connect the J4 jumper to USB, as shown in Figure 2-8. 6. Click the Make and Program Device icon. DS50001721C-page 26 2008-2015 Microchip Technology Inc. Getting Started 2.4.4 Converting the MPLAB IDE Project to an MPLAB X IDE Project This section describes how to convert the HPC.mcp MPLAB 8 project to an HPC.X MPLAB X project. The HPC.mcp project file is included on the compact disc in the PICDEM PIC18 Explorer Demonstration Board’s Kit. Make sure that the C18 compiler is also installed. Note: The MPLAB® X IDE will generate an HPC.X project file folder. Since the CD drive does not have enough free space, the SourceCode folder should be copied to another drive location (i.e., C: drive). Once the folder is transferred to another location, the steps listed below can be executed. 1. Launch the MPLAB X IDE application and select File > Import > MPLAB IDE v8 Project. A pop-up window will appear. Browse for the HPC.mcp file on the C: drive. Click Next>. 2. Select “Advanced 8-bit MCUs (PIC18)” under Family. Select “PIC18F8722” under the Device menu. 3. Select the programmer to be used under Hardware Tools. Click Next>. 4. Select C18 under Compiler Toolchain. Click Next>. 5. Select “Set as main project”. Click Next>, then Finish. An HPC.X project file is now created. Note: Before loading the program, make sure that the J4 jumper and S4 switch are on their proper positions (see Figure 2-7 and Figure 2-1). 6. To load the program to the PIC18F8722 device, simply click the Make and Program Device icon. For PIM attached devices, see Section 2.4.6 “How to Select Device on MPLAB X IDE”. 2008-2015 Microchip Technology Inc. DS50001721C-page 27 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide 2.4.5 Opening the MPLAB X Project File on MPLAB X IDE This section describes how to open the PIC18_Explorer_Demo.X MPLAB X project on MPLAB X IDE. The PIC18_Explorer_Demo.X project file can be found on the Microchip web site. Make sure that the MPLAB XC8 Compiler is also installed. Download the PIC18_Explorer_Demo.X project file from the Microchip web site. Save the project anywhere in the C: drive. 1. Launch the MPLAB X IDE application and select File>Open Project> PIC18_Explorer_Demo.X>Open Project. The project file will appear on the Projects area. 2. Right click the PIC18_Explorer_Demo project>Set as main project. 3. Right click the PIC18_Explorer_Demo project >Properties. A pop-up window will appear as shown in Figure 2-10. FIGURE 2-10: CONFIGURING PROJECT PROPERTIES ON MPLAB® X 4. Select “PIC18F8722” under the Device menu. Select the programmer to be used under the Hardware Tools area. Select XC8 under the Compiler Toolchain. Click Apply, then OK. 5. Make sure to connect the J4 jumper to Main, as shown in Figure 2-7, and the S4 switch is set for default main microcontroller, as shown in Figure 2-1. 6. To load the program to the PIC18F8722 device, click the Make and Program Device icon. For PIM attached devices, see Section 2.4.6 “How to Select Device on MPLAB X IDE”. DS50001721C-page 28 2008-2015 Microchip Technology Inc. Getting Started 2.4.6 How to Select Device on MPLAB X IDE Both Section 2.4.4 and Section 2.4.5 used the board attached PIC18F8722 as the main PIC device. However, if a PIM-mounted microcontroller attached to the board is to be used, the project properties should be modified. The HPC.X project and the PIC18F87J11 are used in the following example. Note: The MPLAB® X project is assumed to be already present on the Projects area. If not, see Section 2.4.4 “Converting the MPLAB IDE Project to an MPLAB X IDE Project” or Section 2.4.5 “Opening the MPLAB X Project File on MPLAB X IDE”. 1. Attach the PIM to the demonstration board. 2. Move the S4 switch to ICE. Note: 3. 4. 5. 6. Steps 1 and 2 are described in Section 2.3.1 “Attaching the PIM”. Right click the HPC project>Set as main project. Right click the HPC project >Properties. Select “PIC18F87J11” under the Device menu. Click Apply, then OK. The device is now changed from PIC18F8722 to PIC18F87J11. 2.4.7 Using the MPLAB Device Driver Switcher The user might encounter problems on driver incompatibility if both the MPLAB® IDE 8 and MPLAB X IDE are installed on the same Windows®-based system, especially when both programs are used simultaneously. The MPLAB device driver switcher enables different USB drivers for communication with Microchip tools to be used when both MPLAB versions are running. USB drivers should be switched when moving from one MPLAB version to another. After installing MPLAB X IDE, the switcher utility can typically be found on the desktop or in the Start menu under Programs>Microchip>MPLAB X IDE>MPLAB Driver Switcher. Figure 2-11 shows a sample driver selection in which the Real ICE is setup for MPLAB 8 and ICD 3 is setup for MPLAB X. No Change means that there is no change on the driver currently being used. FIGURE 2-11: 2008-2015 Microchip Technology Inc. MPLAB® DEVICE DRIVER SWITCHER WINDOW DS50001721C-page 29 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide 2.5 CONNECTING TO HOST PC FOR RS-232 COMMUNICATION As shown in Figure 2-12, there are two ways to connect a PC to the PICDEM PIC18 Explorer Demonstration Board. • Via the USB Port • Via the DB9 Pin (RS-232 Port) FIGURE 2-12: BOARD TO PC CONNECTION Board Host PC USB PIC18LF2450 Microcontroller Tx Rx X1 Tx J13 Main PIC® MCU Rx UART Transceiver X2 Tx DB9 Rx 2.5.1 PC Connection Via DB9 Pin To connect the PICDEM PIC18 Explorer Demonstration Board to a host PC via the 9-pin DB9 connector, set jumper J13, as shown in the first illustration in Figure 2-13. This routes the main microcontroller’s communications through a transceiver. FIGURE 2-13: JUMPER J13 – SETTINGS FOR RS-232 OR USB Connecting to USB Port DS50001721C-page 30 J13 J13 Connecting to 9-Pin RS-232 Port 2008-2015 Microchip Technology Inc. Getting Started 2.5.2 PC Connection Via USB Port If the board PC communication is via the USB port, the data will be routed through the PIC18LF2450 mounted on the board, to convert the RS-232 communication to the USB protocol. To connect the PICDEM PIC18 Explorer Demonstration Board to a host PC via the USB port: 1. Set jumper J13, as shown in the second illustration in Figure 2-13. 2. Install the required file on the host PC. (See the following procedure.) If the USB port is used, an *.inf file must be installed on the host PC. To do this: 1. Create a folder named, HPCINF, anywhere on the host PC’s hard drive. 2. Using the development kit’s CD, copy the file, mchpcdc.inf, into that folder. 3. Connect the board to the PC and power up the board. The pop-up window, shown in Figure 2-14, appears. Note: This procedure displays the dialog boxes that appear for the Windows® XP operating system. In newer Windows® operating systems, the device driver software is automatically installed once the powered-up board is connected to the PC. FIGURE 2-14: INSTALLING USB *.inf FILE ON PC – SCREEN 1 4. Select the Install from a list or specific location option and click Next. The screen shown in Figure 2-15 appears. 2008-2015 Microchip Technology Inc. DS50001721C-page 31 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide FIGURE 2-15: INSTALLING USB *.inf FILE ON PC – SCREEN 2 5. Select the check box, Include this location in the search, enter the name of the path (created in step 1) in the text box below and click Next. The screen shown in Figure 2-16 appears. FIGURE 2-16: INSTALLING USB *.inf FILE ON PC – SCREEN 4 6. Press Finish. The RS-232 to USB functionality is ready to be used. DS50001721C-page 32 2008-2015 Microchip Technology Inc. PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD USER’S GUIDE Chapter 3. Tutorial Program The tutorial program is preprogrammed into the PIC18F8722 on the PICDEM PIC18 Explorer Demonstration Board. This tutorial program is available both in Assembly and in C. The Assembly code, which is on the PICDEM PIC18 Explorer Demonstration Board kit’s CD ROM, can be run using the MPLAB IDE or the MPLAB X IDE (see Section 2.4.4 “Converting the MPLAB IDE Project to an MPLAB X IDE Project”). On the other hand, the C code can be run on the MPLAB X IDE. Both demo codes are available on the Microchip web site. For detailed information on the PICDEM PIC18 Explorer Demonstration Board hardware, see Appendix A. “Hardware Details”. 3.1 TUTORIAL PROGRAM OPERATION The tutorial program consists of three components that appear sequentially on the board’s LCD. A flowchart, showing the button navigation through the entire program, is given in Figure 3-2. When the board boots up, the device name appears on the LCD and the program proceeds to the first component. To select menu options, use the RB0 and RA5 buttons on the bottom of the board (see Figure 3-1). FIGURE 3-1: RB0 AND RA5 BUTTONS RB0 Button RA5 Button 1. Voltmeter This mode uses the Analog-to-Digital Converter (A/D) module to measure the voltage of the R3 potentiometer and display a value between 0.00V and 5.00V on the LCD. (In the case of 3.3V devices, the displayed value will be 0.00V to 3.3V.) The voltage reading is updated continually until the mode is exited by pressing RB0. 2008-2015 Microchip Technology Inc. DS50001721C-page 33 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide 2. Temperature This mode uses an MCP9701A thermal sensor to measure ambient temperature in Celsius and displays it on the LCD. The program also stores the current temperature, when exited, by writing to a defined address on the external, on-board EEPROM. Communication between the microcontroller and sensor is done by the A/D module. To exit this mode, press RB0. 3. Clock Once this mode is entered from the main menu, a Real-Time Clock (RTC) will start counting from 00:00:00. The Timer1 module uses a 32 kHz clock crystal to establish the clock. The program also sends the time data to the RS-232 serial port using the Universal Asynchronous Receiver Transmitter (UART) on the microcontroller. This enables the host PC to display the LCD’s data using the Hyper Terminal application on the PC. Note: For information on connecting the board’s RS-232 serial port to the PC, see Section 2.5 “Connecting to Host PC for RS-232 Communication”. If using the Hyper Terminal application, use the settings given in Table 3-1. TABLE 3-1: HYPER TERMINAL SETTINGS Field Bits per second Data bits Parity Stop bits Flow control Setting 9600 8 None 1 None To set the clock time: 1. 2. 3. 4. 5. 6. Enter the clock-setting program by pressing RB0. The clock begins running. To set the hours value, press RA5. Increment the hours to the desired value by pressing RB0. To set the minutes value, press RA5. Increment the minutes to the desired value by pressing RB0. To start the clock with the set time, press RA5. The LCD returns to an active clock display. 7. To return to the main menu, press RB0. DS50001721C-page 34 2008-2015 Microchip Technology Inc. Tutorial Program FIGURE 3-2: TUTORIAL PROGRAM FLOWCHART Power-up PICDEM™ PIC18 Explorer Voltmeter RA5 = Next RB0 = Now Volt = n.nnV RB0 = Exit Temperature RA5 = Next RB0 = Now Temperature - 022°C RB0 = Exit Clock RA5 = Next RB0 = Now 00.00.02 RA5 = Set, RB0 = Menu 00.00.03 RA5 = ->, RB0 = ++ 3.2 SOURCE CODE AND DATA SHEETS The PICDEM PIC18 Explorer Demonstration Board Kit’s CD-ROM contains the assembled tutorial program (the hex files) as well as the source code used to create those hex files. The CD has device-specific directories for each set of source code and hex files. This program can be run both on MPLAB IDE (see Section 2.4.2 “Loading the Program Using MPLAB® IDE”) and MPLAB X IDE (see Section 2.4.3 “Loading the Program Using MPLAB® X IDE”). The tutorial program for MPLAB X IDE is available on the Microchip web site. The source codes in C and hex files are contained in one .X project file. This program utilizes the MPLAB® Code Configurator plugin to generate initialization codes for the various peripherals used in the sample applications. For information on reprogramming the device with new or modified code, see Section 2.1 “Board as Stand-Alone Device”. 2008-2015 Microchip Technology Inc. DS50001721C-page 35 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide NOTES: DS50001721C-page 36 2008-2015 Microchip Technology Inc. PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD USER’S GUIDE Appendix A. Hardware Details A.1 HARDWARE ELEMENTS A.1.1 Processor Sockets The PICDEM PIC18 Explorer Demonstration Board can be populated with 64 and 80-pin devices. Using a Plug-In Module (PIM), the board also can support 28, 44, 64 and 80-pin devices. For a list of available PIMs, go to the Microchip web site at www.microchip.com. A.1.2 Display Eight LEDs are connected to PORTD of the PICDEM PIC18 Explorer Demonstration Board. The PORTD pins are set high to light the LEDs. These LEDs may be disconnected by removing jumper JP1. One LED (D9) lights to indicate when the board has power. A.1.3 Power Supply The PIC18 Explorer Board does not come with a power supply. It can be powered, via J1, with an unregulated DC supply of 9V to 15V. The preferred supply is 9V. For default functionality, a power supply with a current capability of 250 mA is sufficient. Since the board can serve as a modular development platform connecting to multiple expansion boards, voltage regulators (Q1 and Q2) are used. Their maximum current capability is 800 mA. This current capacity may require a power supply of up to 1.6A. Because the regulators do not have heat sinks, long-term operation at such loads is not recommended. When the board is powered, LED D9 is on, indicating the presence of V_VAR. If an external supply is needed, Microchip’s 9V, 750 mA power supply (part number AC162039) can be used. Note: A.1.4 Do not attempt to power the PICDEM PIC18 Explorer Demonstration Board using the MPLAB ICD 3 module. That module is not designed to be a USB bus power source. RS-232 Serial Port An RS-232, level-shifting integrated circuit has been provided with all the necessary hardware to support the connection of an RS-232 host through the DB9 connector. The port can be connected to a PC using a straight-through cable. The PIC18 receive and transmit pins are tied to the receive and transmit lines of the MAX3232 transceiver through jumper J13. That jumper can direct where the receive and transmit pins of the PIC18 are connected, either to: • The PIC18LF2450 which does the RS-232 to USB communication • The MAX3232 transceiver Note: For details on this connection, see Section 2.5 “Connecting to Host PC for RS-232 Communication”. 2008-2015 Microchip Technology Inc. DS50001721C-page 37 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide A.1.5 Switches The following switches are available: • • • • S1 – Active-low switch connected to RB0 S2 – Active-low switch connected to RA5 S3 – MCLR to hard reset the processor S4 – MCLR select switch If the on board, PIC18F8722 microcontroller is being used, set this to PIC MCU. If an alternate, PIM-mounted microcontroller is being used, set this to ICE. A.1.6 Oscillator Options The main oscillator uses a 10 MHz crystal (Y1) which serves as the controller’s primary oscillator. A second circuit, using a 32.768 kHz (watch type) crystal (Y2), functions as the Timer1 oscillator, the source for the Real-Time Clock/Calendar (RTCC) and secondary oscillator. The PIC18LF2450, the heart of the RS-232 to USB conversion, is independently clocked with its own 12 MHz crystal (Y3). A.1.7 Analog Input (Potentiometer) A 10 k potentiometer is connected through a series resistor to AN0. To provide an analog input to one of the controller’s Analog-to-Digital (A/D) channels, the potentiometer can be adjusted from VDD to GND. A.1.8 ICD Connector Microchip’s low-cost, In-Circuit Debugger, MPLAB ICD 3, can be connected to the modular connector (J10). The ICD connector utilizes RB6 and RB7 for in-circuit debugging. The MPLAB ICD 2 or the MPLAB REAL ICE can also be connected to this interface. Note: A.1.9 For details, see Section 2.4.1 “Programming Requirements”. PICkit™ 2 Connector Microchip’s low-cost programmer, PICkit 2, can be connected to the 6-pin interface provided by J12. A PICkit 3 In-Circuit Debugger/Programmer can also be connected to this interface. Note: A.1.10 For details, see Section 2.4.1 “Programming Requirements”. Temperature Sensor The analog thermal sensor, MCP9701A (U1), is used for monitoring temperature. The device is connected to the Analog-to-Digital Converter (A/D) module through RA1. A.1.11 Serial EEPROM A 25LC256, 256 Kbit (32K x 8) serial EEPROM (U9) is included for nonvolatile storage of firmware. The EEPROM also can demonstrate the operation of the Serial Peripheral Interface (SPI) bus. The EEPROM is enabled or disabled from the SPI bus by jumper JP2. DS50001721C-page 38 2008-2015 Microchip Technology Inc. Hardware Details A.1.12 PICtail™ Daughter Board Connector The PICtail™ interface enables the PICDEM PIC18 Explorer Demonstration Board to be connected directly to available PICtail daughter board cards. This provides a one-to-one connection between the microcontrollers and the cards through SPI/I2C™ interfaces. A.1.13 LCD An LCD display with two lines, 16 characters each, is connected to the SPI I/O expander, MCP23S17. The two control lines and eight data lines are connected to the I/O expander. The I/O expander has an SPI interface that connects it to the microcontroller.The I/O expander is disabled or enabled from the SPI by jumper JP3. A.1.14 Sample Devices A sample part programmed with a simple program is included in the PICDEM PIC18 Explorer Demonstration Board Kit. The devices’ I/O features and port connections are listed in Table A-1. TABLE A-1: Device SAMPLE DEVICE I/O FEATURES AND CONNECTIONS LEDs RS-232/ USB S1 S2 S3 LCD Pot R3 EEPROM Temp Sensor ICD/ PICkit™ Y1, Y2 PIC18F8722 RD7:RD0 RC6/RC7 RB0 RA5 MCLR RC3:RC5 RA0 RC3:RC5 RA1 RB6/RB7 Yes PIC18F87J11 RD7:RD0 RC6/RC7 RB0 RA5 MCLR RC3:RC5 RA0 RC3:RC5 RA1 RB6/RB7 Yes 2008-2015 Microchip Technology Inc. DS50001721C-page 39 PICDEM™ PIC18 Explorer Demonstration Board User’s Guide A.2 BOARD LAYOUT AND SCHEMATICS FIGURE A-1: PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD LAYOUT PICDEM™ PIC18 EXPLORER DS50001721C-page 40 2008-2015 Microchip Technology Inc. 2008-2015 Microchip Technology Inc. 2 3 1 R4 POT TBD C24 220uF ECE-V1EA221UP S1GB13 3 2 V_VAR 4 S1 1 15K R14 V_VAR VIN C3 1K R15 3 Power 1K IN LM317 3 3 R9 R10 R11 R12 D5 D6 D7 D8 2 1 GND LM1117 1 GND 330_1% 1K_1% 3 4 2 .1uF C30 C4 .1uF .1uF C29 +3.3V +5V 1k R13 D9 V_VAR 1K V_VAR OUT OUT 2 15K R27 R28 R8 D4 LM1117 S2 R26 OUT IN IN 2 1 R25 ADJ 1 ADJUST .1uF C28 RA0 RB0 Switch R7 D3 V_VAR R6 D2 RA5 JP1 TP2 100uf ECE-V1AA101WR C27 TP1 C45 47uF TP4 C49 47uF TP5 Power Indicator 1k 1k 1k 1k 1k 1k 1k 1k RA2 V_VAR 15K .1uF C34 RB1 RXD .1uF R35 R36 C36 U6 E RS V_VAR V_VAR DB6 DB4 DB2 DB0 RS E E DB7 DB5 DB3 DB1 +5V VO DB7 DB5 DB3 DB1 +5V VO Vss Vdd Vo RS R/W E D0 D1 D2 D3 D4 D5 D6 D7 RF1 DB7 .1uF C35 RC5 RC3 .1uF V_VAR 470 470 RB2 C37 .1uF TXD MAX3232 11 10 DIN1 DOUT1 DIN2 DOUT2 12 9 ROUT1 RIN1 ROUT2 RIN2 1 3 C1+ VCC 4 C1GND 5 C2+ 2 C26 V+ V- 16 15 13 8 14 7 RF6 15K .1uF C38 10 R32 8 7 9 RH7 J14 2 6 5 12 RF6 RH6 RH4 RH2 RH0 RJ6 RJ4 RJ2 RJ0 RE6 RE4 VIN ICEMCLR +3.3V +5V +3.3V ICEMCLR +3.3V +5V RH6 RH4 RH2 RH0 RJ6 RJ4 RJ2 RJ0 V_VAR RE6 RE4 RF6 RF4 RF2 RF0 RG4 RG2 RG0 RE0 RD6 RD4 RD2 RD0 RC2 RC1 RC0 RA2 RA1 RA0 RC3 RC4 RC5 RA3 RA4 RA5 +5V 4 2 16 14 12 10 8 6 4 2 20 18 16 RF4 RF2 RF0 RG4 RG2 RG0 V_VAR RE0 RD6 RD4 RD2 RD0 V_VAR RC2 RC1 RC0 RA2 RA1 RA0 RC3 RC4 RC5 RA3 RA4 RA5 VIN J9 3 J6 1 15 13 11 9 7 5 3 J7 1 19 17 15 14 10 9 13 8 7 6 4 2 12 10 8 6 4 11 5 3 J5 1 11 9 7 5 3 J111 28 26 25 27 24 22 20 18 23 21 19 17 16 14 15 12 13 10 11 9 8 4 3 7 2 J3 1 ADJ VIN RH5 RH7 RH3 RH1 RJ7 RJ5 RJ3 RJ1 RH5 RH3 RH1 RJ7 RJ5 RJ3 RJ1 RE7 RE7 RF7 DB6 RF7 RF5 RF3 RF1 RE5 R16 RG3 RG1 RE1 RD7 RD5 RD3 RD1 PICMCLR RG5 RG3 RG1 RE1 RD7 RD5 RD3 RD1 RB0 RB1 RB0 RB2 RB1 RB3 RB4 RB5 RB6 RB7 RC6 RC7 RB2 RB3 RB4 RB5 RB6 RB7 RC6 RC7 RA6 OSC2 RE5 6 RE3 RE3 RA7 OSC1 RE2 RE2 DB5 DB4 PIN1 1 PIN6 PIN2 2 PIN7 PIN3 3 PIN8 PIN4 4 PIN9 PIN5 5 MDLS-16264 SS-DIF 15 16 LED_+ LED_- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 LCM-SO1602 DTR/M 80 - 84 pins RF5 .1uF C42 DB6 DB4 DB2 DB0 RS 64 - 68 pins DB3 MCP23S17 MCP9701A V_VAR 1K R38 10K R39 40 - 44 pins RF3 1K Temperature Sensor 25LC256 RC5 RC3 V_VAR +5V 8 - 14 - 18 - 20 - 28 pins DB2 DB1 DB0 V_VAR R29 V_VAR RC4 V_VAR RA1 JP2 R20 C39 JP3 .1uF C1 V_VAR RA3 15K R40 V_VAR FIGURE A-2: RD7 RD6 RD5 RD4 RD3 RD2 RD1 R5 D1 TM PIC tail RD0 Hardware Details PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD SCHEMATIC – 1 OF 2 DS50001721C-page 41 RC7 RC4 RB2 C2 RC6 RC3 RB1 22pf C15 OSC1 22pf Y3 RC2 RC0 RB6 RB4 RB0 RA4 RA2 RA0 R21 12Mhz R34 C33 1M 22pf RC5 RC1 RB7 RB5 RB3 RA5 RA3 RA1 10Mhz Y1 1M 36 35 43 44 45 46 37 38 58 57 56 55 54 53 52 47 30 29 28 27 34 33 VSS VSS 22pf RC0/T1OSO/T13CKI RC1/T1OSI/CCP2 RC2/ECCP1 RC3/SCK1/SCL1 RC4/SDI1/SDA1 RC5/SDO1 RC6/TX1/CK1 RC7/RX1/DT1 RB0/INT0 RB1/INT1 RB2/INT2 RB3/INT3/ECCP2 RB4/KBI0 RB5/KBI1/PGM RB6/KBI2PGC RB7/KBI3/PGD C25 RC1 RC0 RB7 RB6 RB5 RB4 RB3 RB2 RB1 15 14 13 12 11 10 9 8 25 24 23 22 21 20 19 22pf +3.3V V_VAR .47uF C40 RB7 RB6 RC1 C26 U4 PIC18F8722 PIC18F8627 PIC18F8622 PIC18F8527 32Khz Y2 RC7/RX RC6/TX RC5/D+/VP RC4/D-/VM Vusb RC2/CCP1 PIC18LF2450 RC0 OSC2 OSC1 RA5/AN4 RA4/RCV RA0/AN0 RA1/AN1 RA2/AN2/VREFRA3/AN3/VREF+ RA4/T0CKI RA5/AN4/HLVDIN 22pf C16 OSC2 16 5 7 6 4 RA3/VREF+ RD0 47K 3 2 RA2/VREF- RA1/AN1 RD2 R19 1 OSC1 28 RD1 33K PICMCLR R37 OSC2 VBUS RD3 .1uF RA0/AN0 MCLR/RE3 RE0 27 RE2 MCLR/VPP 9 18 RE4 USB_MCLR RE1 10K RE3 OSC1/CLKI/RA7 49 OSC2/CLKO/RA6 50 RD4 RB0 RE6 C31 RD6 AVSS 26 AVDD 25 RE0/RD/AD8 RE1/WR/AD9 RE2/CS/AD10 RE3/AD11 RE4/AD12 RE5/AD13 RE6/AD14 RE7/CCP2/AD15 RE5 4 3 78 77 76 75 74 73 RE7 26 RF1 R33 RF3 U5 RF0 RD0/PSP0/AD0 RD1/PSP1/AD1 RD2/PSP2/AD2 RD3/PSP3/AD3 RD4/PSP4/AD4 RD5/PSP5/AD5 RD6/PSP6/AD6 RD7/PSP7/AD7 RD5 71 48 32 12 VDD VDD VDD VDD RF2 VDD VBUS USB_D- RH7/AN15 RH6/AN14 RH5/AN13 RH4/AN12 RH3/A19 RH2/A18 RH1/A17 RH0/A16 RJ7/UB RJ6/LB RJ5/CE RJ4/BA0 RJ3/WRH RJ2/WRL RJ1/OE RJ0/ALE .1uF C32 USB_D+ 19 20 21 22 2 1 80 79 42 41 40 39 59 60 61 62 RG4/CCP5 10 RG3/CCP4 8 RG2/RX2/DT2 7 RG1/TX2/CK2 6 RG0/CCP3 5 RF5 17 RF7 72 69 68 67 66 65 64 63 RD7 70 51 31 11 VSS VSS VSS VSS RF0/AN5 RF1/AN6/C2OUT RF2/AN7/C1OUT RF3/AN8 RF4/AN9 RF5/AN10/CVREF RF6/AN11 RF7/SS1 RF4 RC6 TXD RXD RC7 RG1 RG3 RH1 RH3 RH5 RH7 RJ1 RJ3 RJ5 RJ7 4 3 2 1 5 6 J8 RG0 RG2 RG4 RH0 RH2 RH4 RH6 RJ0 RJ2 RJ4 RJ6 RE0 RG3 RG2 RG1 RG0 RF2 RF3 RF4 RF5 RF6 RF7 V_VAR RG4 9 8 7 6 5 4 3 2 1 16 15 14 13 12 11 10 RH6 RH7 RF2 RF3 RF4 RF5 RF6 RF7 VDD VSS NC RG4 RG5/MCLR RG3 RG2 RG1 RG0 RE0 RE1 RH3 RH2 RE1 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 PICMCLR RH6 RH7 RF2 RF3 RF4 RF5 RF6 RF7 V_VAR RG4 ICEMCLR RG3 RG2 RG1 RG0 RE0 RE1 RH3 RH2 11 33 RE2 RF2/AN7 RF3/AN8 RF4/AN9 RF5/AN10/CVREF RF6/AN11 RF7/ SS VDD VSS RG4/P1D RG5/MCLR/VPP RG3/P3D RG2 RG1 RG0/ECCP3/P3A RE0/RD/P2D RE1/WR/P2C RF1/AN6 17 RF1 18 24 23 18 17 16 15 14 13 RF6 RH1 RH1 10 34 RH5 RH5 RH0 RH0 9 RE2 RF1 35 RF1 RH4 RH4 RE3 36 63 RE2 64 RE2/CS/P2B 8 RE3 RE4 7 37 RF0 RF0 RE3 RE3/P3C 62 19 RF0/AN5 RF0 RE4 RE5 6 RE5 AVSS 38 RE5 AVDD V_VAR RE4 RE4/P3B 61 RE5/P1C AVSS 20 RE6 39 60 21 AVDD V_VAR 5 RE6 RA3 RA3 RE7 4 40 59 RE6 RE6/P1B RE7 RA2 RA2 V_VAR RD0 U1A ICE MODULE PIC18F6522 PIC18F6627 PIC18F6622 PIC18F6527 U7 RA0/AN0 RE7 RE7/ECCP2/P2A 22 RA3/AN3/VREF+ RA3 VSS 25 RA1/AN1 23 RA1 24 RA0 RA2/AN2/VREFRA2 1 NC 2 VDD 3 RD0 RA1 41 RA1 RA0 42 RA0 V_VAR NC 43 56 VSS 57 VDD RD0 RD0/PSP0 58 84 VSS RD2 82 RD2 RD1 83 45 VSS 44 RD1 55 RD1/PSP1 54 27 VDD 26 V_VAR RD1 VDD V_VAR RA5 46 RA5 RD3 53 RD3/PSP3 RA4/T0CKI RD2 RD2/PSP2 RA5/AN4/LVDIN RA5 28 RA4 RD3 81 RD3 RD4 80 48 RA4 47 RA4 RD4 52 RD4/PSP4 51 30 RC1/T1OSI/ECCP2/P2A 29 RC1 RD4 RD5 79 RD5 RC0/T1OSO 49 RC0 RD6 RC1/T1OSI RC1 RD5 RD5/PSP5 50 RJ1 RJ0 RD7 RD6 RB4/KBI0 RB3/INT3 RB2/INT2 RB1/INT1 RB0/INT0 RC2/ECCP1/P1A RC3/SCK1/SCL1 RC4/SDI1/SDA1 RC5/SDO1 RB7/KBI3/PGD VDD RA7/OSC1/CLKI RA6/OSC2/CLKO VSS RB6/KBI2/PGC RB5/KBI1/PGM RD6/PSP6 RC6/TX/CK1 31 RC6 RC7/RX/DT1 32 RC7 RC0/T1OSO/T13CKI RC0 78 RD6 76 RJ0 77 51 RC6 50 RC6 RD7 49 RD7/PSP7 RD7 RC7 75 NC VSS RB6 RB5 RB4 RB3 RB2 RB1 RB0 RJ3 RJ2 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 74 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 RC2 RC3 RC4 RC5 RB7 V_VAR OSC1 OSC2 RB6 RB5 RB4 RB3 RB2 RB1 RB0 RJ6 RJ7 RC2 RC3 RC4 RC5 RB7 VDD OSC1 OSC2/RA6 RJ1 RJ5 53 RJ4 52 RJ4 DS50001721C-page 42 RJ5 RJ6 RJ7 RC2 RC3 RC4 RC5 RB7 V_VAR OSC1 OSC2 RB6 RB5 RB4 RB3 RB2 RB1 RB0 RJ3 RJ2 2 1 S3 V_VAR V_VAR .1uF C18 3 4 4.7K R18 R23 V_VAR MAIN_MCLR C17 1k 3 2 1 MAIN_MCLR RB6 RB7 MCLR C19 .1uF C22 .1uF C11 .1uF C10 USB_MCLR MCLR MAIN_MCLR 47K R17 V_VAR .1uF V_VAR .1uF VIN ADJ C13 .1uF C20 .1uF C14 6 5 4 3 2 1 6 5 4 3 2 J12 J10 PICkit™ 2 Programmer RB6 RB7 V_VAR MCLR 100 1 .1uF C21 .1uF ICD Connector R24 .1uF C23 .1uF C12 3 2 1 47K J4 PICMCLR ICEMCLR R22 J2 FIGURE A-3: RC7 V_VAR PICDEM™ PIC18 Explorer Demonstration Board User’s Guide PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD SCHEMATIC – 2 OF 2 2008-2015 Microchip Technology Inc. Hardware Details NOTES: 2008-2015 Microchip Technology Inc. DS50001721C-page 43 Worldwide Sales and Service AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: http://www.microchip.com/ support Web Address: www.microchip.com Asia Pacific Office Suites 3707-14, 37th Floor Tower 6, The Gateway Harbour City, Kowloon China - Xiamen Tel: 86-592-2388138 Fax: 86-592-2388130 Austria - Wels Tel: 43-7242-2244-39 Fax: 43-7242-2244-393 China - Zhuhai Tel: 86-756-3210040 Fax: 86-756-3210049 Denmark - Copenhagen Tel: 45-4450-2828 Fax: 45-4485-2829 India - Bangalore Tel: 91-80-3090-4444 Fax: 91-80-3090-4123 France - Paris Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79 India - New Delhi Tel: 91-11-4160-8631 Fax: 91-11-4160-8632 Germany - Dusseldorf Tel: 49-2129-3766400 Atlanta Duluth, GA Tel: 678-957-9614 Fax: 678-957-1455 Hong Kong Tel: 852-2943-5100 Fax: 852-2401-3431 Australia - Sydney Tel: 61-2-9868-6733 Fax: 61-2-9868-6755 China - Beijing Tel: 86-10-8569-7000 Fax: 86-10-8528-2104 Austin, TX Tel: 512-257-3370 China - Chengdu Tel: 86-28-8665-5511 Fax: 86-28-8665-7889 Boston Westborough, MA Tel: 774-760-0087 Fax: 774-760-0088 China - Chongqing Tel: 86-23-8980-9588 Fax: 86-23-8980-9500 Chicago Itasca, IL Tel: 630-285-0071 Fax: 630-285-0075 Cleveland Independence, OH Tel: 216-447-0464 Fax: 216-447-0643 Dallas Addison, TX Tel: 972-818-7423 Fax: 972-818-2924 Detroit Novi, MI Tel: 248-848-4000 Houston, TX Tel: 281-894-5983 Indianapolis Noblesville, IN Tel: 317-773-8323 Fax: 317-773-5453 Los Angeles Mission Viejo, CA Tel: 949-462-9523 Fax: 949-462-9608 New York, NY Tel: 631-435-6000 San Jose, CA Tel: 408-735-9110 Canada - Toronto Tel: 905-673-0699 Fax: 905-673-6509 China - Dongguan Tel: 86-769-8702-9880 China - Hangzhou Tel: 86-571-8792-8115 Fax: 86-571-8792-8116 Germany - Munich Tel: 49-89-627-144-0 Fax: 49-89-627-144-44 India - Pune Tel: 91-20-3019-1500 Japan - Osaka Tel: 81-6-6152-7160 Fax: 81-6-6152-9310 Germany - Pforzheim Tel: 49-7231-424750 Italy - Milan Tel: 39-0331-742611 Fax: 39-0331-466781 Japan - Tokyo Tel: 81-3-6880- 3770 Fax: 81-3-6880-3771 Italy - Venice Tel: 39-049-7625286 Korea - Daegu Tel: 82-53-744-4301 Fax: 82-53-744-4302 Netherlands - Drunen Tel: 31-416-690399 Fax: 31-416-690340 China - Hong Kong SAR Tel: 852-2943-5100 Fax: 852-2401-3431 Korea - Seoul Tel: 82-2-554-7200 Fax: 82-2-558-5932 or 82-2-558-5934 China - Nanjing Tel: 86-25-8473-2460 Fax: 86-25-8473-2470 Malaysia - Kuala Lumpur Tel: 60-3-6201-9857 Fax: 60-3-6201-9859 China - Qingdao Tel: 86-532-8502-7355 Fax: 86-532-8502-7205 Malaysia - Penang Tel: 60-4-227-8870 Fax: 60-4-227-4068 China - Shanghai Tel: 86-21-5407-5533 Fax: 86-21-5407-5066 Philippines - Manila Tel: 63-2-634-9065 Fax: 63-2-634-9069 China - Shenyang Tel: 86-24-2334-2829 Fax: 86-24-2334-2393 Singapore Tel: 65-6334-8870 Fax: 65-6334-8850 China - Shenzhen Tel: 86-755-8864-2200 Fax: 86-755-8203-1760 Taiwan - Hsin Chu Tel: 886-3-5778-366 Fax: 886-3-5770-955 China - Wuhan Tel: 86-27-5980-5300 Fax: 86-27-5980-5118 Taiwan - Kaohsiung Tel: 886-7-213-7828 China - Xian Tel: 86-29-8833-7252 Fax: 86-29-8833-7256 Poland - Warsaw Tel: 48-22-3325737 Spain - Madrid Tel: 34-91-708-08-90 Fax: 34-91-708-08-91 Sweden - Stockholm Tel: 46-8-5090-4654 UK - Wokingham Tel: 44-118-921-5800 Fax: 44-118-921-5820 Taiwan - Taipei Tel: 886-2-2508-8600 Fax: 886-2-2508-0102 Thailand - Bangkok Tel: 66-2-694-1351 Fax: 66-2-694-1350 01/27/15 DS50001721C-page 44 2008-2015 Microchip Technology Inc.