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 t he lik e is provided only for your convenience
and may be su perseded by upda t es . It is y our 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 supp ort and/or safety ap plications is entir ely at
the buyer’s risk, and the buyer agrees to defend, indemnify and
hold harmless M icrochip from any and all dama ges, claims,
suits, or expenses re sulting from such use. No licens es are
conveyed, implicitly or otherwise, under any Microchip
intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron,
dsPIC, K
EELOQ, KEELOQ logo, MPLAB, PIC, PICmicro,
PICSTART, PRO MA TE, rfPIC and SmartShunt are registered
trademarks of Microchip Technology Incorporated in the
U.S.A. and other countries.
FilterLab, Linear Active Thermistor, MXDEV, MXLAB,
SEEVAL, SmartSensor and The Embedded Control Solutions
Company are registered trademarks of Microchip Technology
Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard,
dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN,
ECONOMONITOR, FanSense, In-Circuit Serial
Programmin g , IC SP, ICEPIC, Mindi, MiW i , MPASM, MPLAB
Certified logo, MPLIB, MPLINK, mTouch, PICkit, PICDEM,
PICDEM.net, PICtail, PIC
32
logo, PowerCal, PowerInfo,
PowerMate, PowerT ool, REAL ICE, rfLAB, Select Mode, Total
Endurance, UNI/O, WiperLock 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.
All other trademarks mentioned herein are property of their
respective companies.
Microchip received ISO/TS-16949:2002 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
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.
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 p age 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
Select the Help menu, and then Topics to open a list of available on-line help files.
®
IDE on-line help.
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 Customer Change Notification Service
• Customer Support
• Document 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
manual layout is 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. “PICDEM™ PIC18 Explorer Demonstration Board Tutorial Program”
– Explanation of t he tu to ri al prep r ogra mme d o n the sa mpl e d evice s
• Appendix A. “Hardware Details” – Description of the board’s hardware
elements, including layout and schematic drawings
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.
• On the board kit’s CD-ROM:
- Readme file
- Other reference documents
• Other documents, available at http://microchip.com
- “Microchip Development Systems Ordering Guide” (DS 30 177 )
®
ICD 2 In-Circuit Debugger User’s Guide” (DS51331)
THE MICROCHIP WEB SITE
Microchip provides online support via our web site at http://microchip.com. This web
site is used as a means to make files and information easily available to customers.
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
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.com
Change Notification and follow the registration instructions.
The Development Systems product group categories are:
• Compilers – The latest information on Microchip C compilers and other language
tools. These include the MPLAB C18 and MPLAB C30 C compilers; MPASM™
and MPLAB ASM30 assemblers; MPLINK™ and MPLAB LINK30 object linkers;
and MPLIB™ and MPLAB LIB30 object librarians.
• Emulators – The latest information on Microchip in-circuit emulators.This
includes the MPLAB ICE 2000 and MPLAB ICE 4000.
• In-Circuit Debuggers – The latest information on the Microchip in-circuit
debugger, MPLAB ICD 2.
• MPLAB
Integrated Development Environment for development systems tools. This list is
focused on the MPLAB IDE, MPLAB SIM simulator, MPLAB IDE project manager
and general editing and debugging features.
• Programmers – The latest information on Microchip programmers. These include
the MPLAB PM3 and PRO MATE
Plus and PICkit™ 1 development programmers.
®
IDE – The latest information on Microchip MPLAB IDE, the Windows®
®
II device programmers and the PICSTART®
, click on Custome r
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://support.microchip.com
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
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.2DEVELOPMENT KI T CON TEN TS
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”
- Other referenced documents
If you are missing any part of the kit, contact your nearest Microchip sales office listed
in the back of this publication.
The MPLAB
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 http://microchip.com
®
ICD 2, and host PC.
®
Integrated Development Environment (IDE) is a free, integrated
PICDEM™ PIC18 Explorer Demonstration Board User’s Guide
1.3PICDEM™ 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. Six-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 int erface.
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
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, V
FIGURE 1-1:PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD
29
1
2
3
4
5
6
7
8
9
10
11
12
13
14 15
16
17
18
19
20
21
22
23
24
25
26
27
28
Introduction
1.4SAMPLE 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.5SAMPLE 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.
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.
T ABLE 2-1:PICDEM™ PIC18 EXPLORER DEMONSTRATION BOARD CONFIGURATIONS
ConfigurationBoard ConnectionsBoard Capabilities
• Access board’s full functionality
• Demonstrate sample code
Stand-alone boardPower supply
• Power supply
Board with in-circuit
debugger/programmer
Board with alternate
microcontroller, attached
through a Plug-In Module
(PIM)
† PIM enables 80, 64, 44 and 28-pin devices to be used as the main microcontroller. For information on the
available PIMs, go to
• In-Circuit Debugger (ICD) that
also can be used as a
programmer
• Power supply
• ICD that also can be used as a
programmer
• PIM with mounted microcontroller
http://microchip.com.
• 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
• Repr ogram micr ocontrollers
• 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
• Repr ogram micr ocontrollers
• Connect PICtail daughter cards
†
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.1BOARD 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
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.2BOARD 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
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
The PICDEM™ PIC18 Explorer Demonstration Board can alternately use the MPLAB
REAL ICE™ Emulator as a debugger. For more information, see the “Microchip Development Systems Ordering Guide” (DS30177).
®
ICD 2 In-Circuit Debugger is an inexpensive ICD that could be used. (For
For information on other microcontroller compatible ICD or ICE devices, see the
“Microchip Development Systems Ordering Guide” or the Microchip web site at
http://microchip.com
PICDEM™ PIC18 Explorer Demonstration Board User’s Guide
Plug-In
Module
(PIM)
2.3BOARD 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
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, see the “Microchip Development Systems Ordering Guide” (DS30177) or go to http://microchip.com
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
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. To designate the PIM-m ounted de vice as th e main mi crocontro ller , set Switch S4
(shown in Figure 2-5) to ICE (see Figure 2-6).
FIGURE 2-6:S4 SWITCH – SETTING FOR PIM-MOUNTED DEVICES
3. If you are converting from the board’s default V
PICDEM™ PIC18 Explorer Demonstration Board User’s Guide
2.3.2Varying the Device Voltage (5V/3.3V)
By default, the PICDEM PIC18 Explorer Demonstration Board’s VDD supply is 5V. The
V
DD can be varied, for PIM-mounted microcontrollers, from 5 to 3.3V to accommodate
devices running at 5 or 3.3V. This V
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 “Calculating Other V
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
DD is named VAR.
DD Values” on page 15.)
• For 3.3V V
DD (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
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
I
ADJ 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 V OLTAGE
As stated previously, R25 = 1 kΩ, and R26 = 330Ω. Without R102 and R101 being
inserted in parallel on the PIM board, V
To calculate a desired V
OUT:
OUT =1.25V(1+ 1 kΩ/330Ω) = 5.04V.
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 V
DD to make sure it does not exceed the maximum VDD for the part you
will be using.
T able 2-2 shows the R101 and R102 resistor values to use for different V
DD 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.
TABLE 2-2:CALCULATING R101, R102 VALUES FOR V
VDDR101 ValueR102 Value
5VOpenOpen
3.6VOpen1.62 kΩ
3.3VOpen 1.18 kΩ
3.0VOpen866 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.
PICDEM™ PIC18 Explorer Demonstration Board User’s Guide
2.4PROGRAMMING 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.1Programming 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.
• 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:
• Code development and debugging –
The free MPLAB
eral 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
integrated for the MPLAB IDE environment.
• Programmer –
Microchip’s MPLAB
used to program the device and both are fully integrated for the MPLAB IDE
environment.
The free MPLAB IDE tool set and its documentation can be downloaded at
http://microchip.com
For a list of the other mentioned devices’ docu mentation, see “Reco mmended Reading” on page 3.
Other assemblers/compilers can be used. For a list of tools compatible with PIC
microcontrollers, see the Microchip web site (http://microchip.com
®
IDE software development tool includes a debugger and sev-
®
C18 is a C compiler for PIC18 microcontrollers and is fully
®
In-Circuit Debugger (ICD) 2 or PICkit™ Starter Kit can be
This section describes how to program the PICDEM PIC18 Explorer Demonstration
Board using th e MP LA B
Hex code on the compact disc in the PICDEM PIC18 Explorer Demonstration Board’s Kit.
2.4.2.1REPROGRAMMING 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>OpenCD/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
®
Integrated Development Environment (IDE) and the sample
.
and select
5. Move the S4 switch to PIC MCU, as described in “Using the Board As Is” on page 10.
To program the PIC18F87J11 on the PIM:
1. Attach the PIM to the demonstration board.
2. Move the S4 switch to ICE.
Note:Both steps 1 and 2 are described in “Attaching the PIM” on p age 13 .
3. Launch the MPLAB IDE application and select Configure>Select
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
2.5.1PC Connection Via DB9 Pin
To connect the PICDEM PIC18 Explorer Demonstration Board to a host PC via the
nine-pin DB9 connector, set jumper J13, as shown in the first illustration in Figure 2-10.
This routes the main microcontroller’s communications through a transceiver.
FIGURE 2-10:JUMPER J13 – SETTINGS FOR RS-232 OR USB
PICDEM™ PIC18 Explorer Demonstration Board User’s Guide
2.5.2PC 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.)
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-11, appears.
Note:This procedure displays the dialog boxes that appear for the Windows
operating system.
FIGURE 2-11:INSTALLING USB *.inf FILE ON PC – SCREEN 1
®
XP
4. Select the Install from a list or specific location option and click Next. The
screen shown in Figure 2-12 appears.
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. “Hardware Details”.
3.1T UTORIAL 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
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.
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 micr ocontr ol ler and sens or is done by the A/D mod ule .
To exit this mode, press RB0.
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.
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 TE RMINAL SETTINGS
FieldSetting
Bits per second
Data bits8
ParityNone
Stop bits1
Flow controlNone
9600
To set the clock time:
1. Enter the clock-setting program by pressing RB0. The clock begins running.
2. To set the hours value, press RA5.
3. Increment the hours to the desired value by pressing RB0.
4. To set the minutes value, press RA5.
5. Increment the minutes to the desired value by pressing RB0.
6. T o start the clock with the set time, press RA5. The LCD returns to an active clock
display.
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 file s. The CD has de vice-specif ic director ies for each set o f source code and
Hex files.
For information on reprogramming the device with new or modified code, see
Section 2.1 “Board as Stand-Alone Device”.
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.2Display
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.
PICDEM™ PIC18 EXPLORER
DEMONSTRATION BOARD
USER’S GUIDE
.
A.1.3Power 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:Do not attempt to power the PICDEM PIC18 Explorer Demonstration Board
using the MPLAB ICD 2 module. That module is not designed to be a USB
bus power source.
A.1.4RS-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
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
• S4 – MCLR
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.6Oscillator 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.7Analog 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 V
to hard reset the processor
select switch.
DD to GND.
A.1.8ICD Connector
Microchip’s low-cost, in-circuit debugger, MPLAB ICD 2, can be connected to the
modular connector (J10). The ICD connector utilizes RB6 and RB7 for in-circuit
debugging.
Note:For details, see Section 2.4.1 “Programming Requirements”.
A.1.9PICkit™ 2 Connector
Microchip’s low-cost programmer, PICkit 2, can be connected to the 6-pin interface
provided by J12.
Note:For details, see Section 2.4.1 “Programming Requirements”.
A.1.10Temperature 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.11Serial 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.
A.1.12PICtail™ 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/I
interfaces.
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.14Sample 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:SAMPLE DEVICE I/O FEATURES AND CONNECTIONS