PICDEM™ PIC18 Explorer Demonstration Board User’s Guide © 2008 Microchip Technology Inc.
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.
PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD USER’S GUIDE Table of Contents Preface ........................................................................................................................... 1 Chapter 1. Introduction 1.1 Introduction ..................................................................................................... 5 1.2 Development Kit Contents .............................................................................. 5 1.3 PICDEM™ PIC18 Explorer Demonstration Board ..
PICDEM™ PIC18 Explorer Demonstration Board User’s Guide NOTES: DS51721B-page iv © 2008 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.
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 Referenced books Emphasized text A window A dialog A menu selection A field name in a window or dialog A menu path MPLAB® IDE U
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. Other useful documents are listed below.
PICDEM™ PIC18 Explorer Demonstration Board User’s Guide DEVELOPMENT SYSTEMS CUSTOMER 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 http://microchip.
PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD USER’S GUIDE Chapter 1. Introduction 1.1 INTRODUCTION The PICDEM™ PIC18 Explorer Demonstration Board is the latest 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 2, and host PC. Sample programs are provided to demonstrate the unique features of the supported devices.
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).
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 18-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.
PICDEM™ PIC18 Explorer Demonstration Board User’s Guide NOTES: DS51721B-page 8 © 2008 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.
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.
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.
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.
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 (http://microchip.com). 2.
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.
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.
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 2.4.
Getting Started 2.4.2 Loading the Program 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.
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.
Getting Started 2.5 CONNECTING TO HOST PC FOR RS-232 COMMUNICATION As shown in Figure 2-9, 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-9: BOARD TO PC CONNECTION Board Host USB PC PIC18LF2450 Microcontroller Tx Rx X1 Tx J13 Main PIC® MCU Rx UART Transceiver X2 Tx DB9 Rx 2.5.
PICDEM™ PIC18 Explorer Demonstration Board User’s Guide 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-10. 2. Install the required file on the host PC. (See the following procedure.
Getting Started FIGURE 2-12: 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-13 appears. FIGURE 2-13: INSTALLING USB *.inf FILE ON PC – SCREEN 4 6. Press Finish. The RS-232 to USB functionality is ready to be used. © 2008 Microchip Technology Inc.
PICDEM™ PIC18 Explorer Demonstration Board User’s Guide NOTES: DS51721B-page 22 © 2008 Microchip Technology Inc.
PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD USER’S GUIDE Chapter 3. PICDEM™ PIC18 Explorer Demonstration Board Tutorial Program The tutorial program is preprogrammed into the PIC18F8722 on the PICDEM PIC18 Explorer Demonstration Board. This program is also on the PICDEM PIC18 Explorer Demonstration Board kit’s CD-ROM so that it can be reprogrammed on the sample device if it the device had been preprogrammed. For detailed information on the PICDEM PIC18 Explorer Demonstration Board hardware, see Appendix A.
PICDEM™ PIC18 Explorer Demonstration Board User’s Guide 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.
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.
PICDEM™ PIC18 Explorer Demonstration Board User’s Guide NOTES: DS51721B-page 26 © 2008 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 http://microchip.com. A.1.2 Display Eight LEDs are connected to PORTD of the PICDEM PIC18 Explorer Demonstration Board.
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.
Hardware Details 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.
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 DS51721B-page 30 © 2008 Microchip Technology Inc.
© 2008 Microchip Technology Inc. 2 3 1 C24 R4 POT TBD 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 .
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
Hardware Details NOTES: © 2008 Microchip Technology Inc.
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://support.microchip.com Web Address: www.microchip.