Explorer 16 Development Board User Guide
Explorer 16 Development Board User Guide
Explorer 16 Development Board User Guide
User’s Guide
• 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.
Table of Contents
Preface ........................................................................................................................... 1
Chapter 1. Introducing the Explorer 16 Development Board
1.1 Introduction ..................................................................................................... 7
1.2 Highlights ........................................................................................................ 7
1.3 What’s in the Kit ............................................................................................. 7
1.4 Explorer 16 Development Board Functionality and Features ......................... 8
1.5 Using the Explorer 16 Out of the Box ............................................................. 9
1.6 Explorer 16 Development Board Demonstration Programs ......................... 10
1.7 Reference Documents .................................................................................. 10
Chapter 2. Explorer 16 Programming Tutorial
2.1 Introduction ................................................................................................... 11
2.2 Highlights ...................................................................................................... 11
2.3 Tutorial Overview ......................................................................................... 11
2.4 Creating the Project ...................................................................................... 12
2.5 Building The Code ........................................................................................ 16
2.6 Programming the Device .............................................................................. 19
Chapter 3. Explorer 16 Tutorial Programs
3.1 Introduction ................................................................................................... 23
3.2 PIC24 Tutorial Program Operation ............................................................... 23
3.3 dsPIC33F Tutorial Program Operation ......................................................... 25
Chapter 4. Explorer 16 Development Hardware
4.1 Introduction .................................................................................................. 27
4.2 Hardware Features ....................................................................................... 27
Appendix A. Explorer 16 Development Board Schematics
A.1 Introduction .................................................................................................. 33
A.2 Development Board Block Diagram ............................................................. 33
A.3 Development Board Schematics .................................................................. 34
Appendix B. Updating the USB Connectivity Firmware
B.1 Introduction .................................................................................................. 43
B.2 Updating the PICkit 2 Microcontroller Programmer ..................................... 43
B.3 Other USB Firmware Updates ..................................................................... 44
Index ............................................................................................................................. 45
Worldwide Sales and Service .................................................................................... 46
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 on-line help.
Select the Help menu, and then Topics to open a list of available on-line help files.
INTRODUCTION
This chapter contains general information that will be useful to know before using the
Explorer 16 Development 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 Explorer 16 Development Board as a
development tool to emulate and debug firmware on a target board. The manual layout
is as follows:
• Chapter 1. “Introducing the Explorer 16 Development Board” provides a brief
overview of the Explorer 16 Development Board, its features and its uses.
• Chapter 2. “Explorer 16 Programming Tutorial” provides step-by-step instructions
for using MBLAB® IDE to create a project and program the Explorer 16 board.
• Chapter 3. “Explorer 16 Tutorial Programs” describes the demonstration
program created in Chapter 2. “Explorer 16 Programming Tutorial”.
• Chapter 4. “Explorer 16 Development Hardware” provides a more detailed
description of the Explorer 16 board’s hardware features.
• Appendix A. “Explorer 16 Development Board Schematics” provides a block
diagram and detailed schematics of the Explorer 16 board.
• Appendix B. “Updating the USB Connectivity Firmware” describes how to
upgrade the Explorer 16 board’s USB connectivity subsystem.
DOCUMENTATION CONVENTIONS
Description Represents Examples
Arial font:
Italic characters Referenced books MPLAB® IDE User’s Guide
Emphasized text ...is the only compiler...
Initial caps A window the Output window
A dialog the Settings dialog
A menu selection select Enable Programmer
Quotes A field name in a window or “Save project before build”
dialog
Underlined, italic text with A menu path File>Save
right angle bracket
Bold characters A dialog button Click OK
A tab Click the Power tab
Text in angle brackets < > A key on the keyboard Press <Enter>, <F1>
Courier New font:
Plain Courier New Sample source code #define START
Filenames autoexec.bat
File paths c:\mcc18\h
Keywords _asm, _endasm, static
Command-line options -Opa+, -Opa-
Bit values 0, 1
Constants (in source code) 0xFF, ‘A’
Italic Courier New A variable argument file.o, where file can be
any valid filename
Square brackets [ ] Optional arguments mcc18 [options] file
[options]
Curly brackets and pipe Choice of mutually exclusive errorlevel {0|1}
character: { | } arguments; an OR selection
Ellipses... Replaces repeated text var_name [,
var_name...]
Represents code supplied by void main (void)
user { ...
}
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 Explorer 16 Development Board. Other
useful documents are listed below. The following Microchip documents are available
and recommended as supplemental reference resources.
Readme for the Explorer 16 Development Board
For the latest information on using the Explorer 16 Development Board, read the
Readme for Explorer 16 Development Board.txt file (an ASCII text file) at
the root level of the Explorer 16 CD-ROM. The Readme file contains update information
and known issues that may not be included in this user’s guide.
Readme Files
For the latest information on using other tools, read the tool-specific Readme files in
the Readmes subdirectory of the MPLAB IDE installation directory. The Readme files
contain update information and known issues that may not be included in this user’s
guide.
PIC24FJ128GA010 PS Data Sheet (DS39756) and PIC24FJ128GA Family
Data Sheet (DS39747)
Consult this document for detailed information on the PIC24F general purpose, 16-bit
devices. Reference information found in this data sheet includes:
• Device memory map
• Device pinout and packaging details
• Device electrical specifications
• List of peripherals included on the device
Note that document, DS39756, is for use only with the initial prototype samples of the
PIC24F family. These devices are all marked with a “PS” suffix at the end of the device
number. For all other PIC24FJ128GA family devices, including those with an “ES”
suffix, use DS39747.
dsPIC33F Family Data Sheet (DS70165)
Consult this document for detailed information on the dsPIC33F Digital Signal
Controllers. Reference information found in this data sheet includes:
• Device memory map
• Device pinout and packaging details
• Device electrical specifications
• List of peripherals included on the device
dsPIC30F Programmer’s Reference Manual (DS70030)
This manual is a software developer’s reference for all of Microchip’s 16-bit digital
signal controllers. It describes the instruction set in detail and also provides general
information to assist in developing software for PIC24 MCUs, dsPIC30F and dsPIC33F
DSCs.
PIC24H Family Overview (DS70166)
This document provides an overview of the functionality of the new PIC24H product
family. It helps determine how the PIC24H high-performance, 16-bit microcontrollers fit
a specific product application.
CUSTOMER SUPPORT
Users of Microchip products can receive assistance through several channels:
• Distributor or Representative
• Local Sales Office
• Field Application Engineer (FAE)
• Technical Support
• Development Systems Information Line
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
1.2 HIGHLIGHTS
This chapter covers the following topics:
• What’s in the Kit
• Explorer 16 Development Board Functionality and Features
• Using the Explorer 16 Out of the Box
• Explorer 16 Development Board Demonstration Programs
• Reference Documents
Note: The Explorer 16 Development Board has been designed to function prima-
rily from a permanently mounted PIC24FJ128GA010 device at position U1.
Initial units will be shipped with U1 unpopulated and a PIC24FJ PIM of
equal functionality mounted on the U1A headers instead. When using the
PIC24FJ PIM or any other PIM, it is critical to verify that switch S2 always
remains in the “PIM” position. See Section 4.2.1 “Processor Support” for
more information.
10 11 12 13 14 15 16
9
17
8
7
18
6
3 19
2 1 20
PIC24FJ128GA010
2.2 HIGHLIGHTS
Items discussed in this chapter include:
• Tutorial Overview
• Creating the Project
• Building the Code
• Programming the Device
Note: These instructions presume the use of MPLAB IDE 7.22 or newer.
A project contains the files needed to build an application (source code, linker script
files, etc.) along with their associations to various build tools and build options.
A workspace contains one or more projects and information on the selected device,
debug tool and/or programmer, open windows and their location and other MPLAB IDE
configuration settings.
MPLAB IDE contains a Project Wizard to help create new projects. Before starting,
create a folder named Tutorial for the project files for this tutorial (C:\Tutorial is
assumed in the instructions that follow). From the Example Code\Tutorial Code
directory on the Explorer 16 Development Kit Software CD-ROM, copy all of the source
files into this folder.
Note: The screen shots in the following sections show the PIC24 tutorial. Except for
displayed file names, the screens for the dsPIC33F tutorial will be identical.
A project and workspace has now been created in MPLAB IDE. MyProject.mcw is
the workspace file and MyProject.mcp is the project file. Double-click the
PIC24ExplDemo.c file (for PIC24) or main_rtc.c file (for dsPIC33F) in the Project
window to open the file. MPLAB IDE should now look similar to Figure 2-6.
Project
Window Source
Code
Window
Output
Window
Note: Before proceeding, make sure that the USB driver for the MPLAB ICD 2 has
been installed on the PC (see the MPLAB® ICD 2 In-Circuit Debugger
User’s Guide (DS51331) for more details regarding the installation of the
MPLAB ICD 2).
Note: Do not use the Configuration Bits window to set device configuration if
configuration macros are already used in the source code. In cases where
both methods are used, configuration macros may override settings from
the Configuration Bits window. Refer to the MPLAB IDE Simulator, Editor
User’s Guide (DS51025) for additional information.
Note: MPLAB IDE may need to download new firmware if this is the first time the
MPLAB ICD 2 is being used with a PIC24FJ device. Allow it to do so. If any
errors are shown, double-click the error message to get more information.
Status indicates
device is found
3.2.2 Voltmeter/Temperature
Voltmeter/Temperature mode uses the code modules, vbanner.c and ADC.c, and
the A/D module to measure analog signals from the board and convert them for display
on the LCD. The voltage is taken from the potentiometer (R6) and displays a voltage
between 0.00V and 3.29V on line 1 of the LCD. Temperature is from a TC1074A analog
thermal sensor (U5). The temperature is displayed on line 2 of the LCD and auto-
matically alternates between Celsius and Fahrenheit values. The voltage and
temperature are updated continuously.
This mode also lets users store the current temperature in the on-board serial
EEPROM by pressing S5. Pressing S6 switches the display between current and
stored temperature values. An ‘M’ on the right side of the LCD indicates that a stored
temperature value is being displayed.
To exit and continue to the next mode, press S4.
3.2.3 Clock/Calendar
Clock/Calendar mode uses code in the modules, rtcc.c and tbanner.c. Once this
mode is entered from the main menu, a Real-Time Clock will start counting from
10:00:00, and display the date and day for Oct. 10, 2005. The new RTCC module and
a 32 kHz clock crystal are used to provide the Real-Time Clock with day/date calendar.
In Clock/Calendar mode, the user-defined push buttons do the following:
• S3 toggles the Clock Set mode, which allows the user to set the date and time.
Setup mode starts with the tens digit of the hour in the time display.
• S4 accepts the value of the current item and moves cursor to the next item.
• S5 decrements the currently selected item.
• S6 increments the currently selected item.
Pressing S3 once superimposes a flashing cursor over the tens digit of the hour in the
time display. Each press of S4 moves the cursor sequentially through the digits of the
time display, then the month, day and year. Pressing S3 at any time in the process
returns to the regular clock/calendar display.
Power-up
Display
“Explorer 16
Development Board”
Display
PIC24 Features
Scrolling Banner
No Is S4
pressed?
Yes
Display Voltage
and Temperature
Is S4 No Is S5 No Is S6 No
pressed? pressed? pressed?
Yes Yes
Yes
Toggle Displayed
Store Temperature Temperature between
in EEROM Current and Stored
Yes
Is S4 No Display
pressed? “Mon 10:00:00”
“Oct 10, 2005”
Is S3 No
pressed?
Yes
Clock Setup mode:
S3 – Exit Setup mode
S4 – Accept Selection, Adjust Next Value
S5 – Decrement Selection
S6 – Increment Selection
3.3.1 Voltmeter
The simple tutorial program initializes the A/D module for 12-bit mode with
auto-sampling and conversion of the potentiometer connected to pin AN5 and initial-
izes the respective interrupt. The A/D module continually samples and converts the
potentiometer signal (0 to 3.3 VDC) on analog channel, AN5. When a conversion is
complete, an interrupt is generated and the result in the ADCBUF0 register is copied
into a temporary variable, temp1. The adc_lcd_update flag is then asserted and the
A/D Interrupt Flag, AD1IF (IFS0<13>), is cleared.
The program exits the Interrupt Service Routine and re-enters the main program loop.
The variable, adc_lcd_update, is evaluated in the main loop to determine if there is
a new A/D conversion value which can be converted and displayed on the LCD.
The primary code modules associated with the operation of the ADC module and
display are:
• init_ADC.c
• isr_ADC.c
• advolts.c
• hexdec.c
Power-up
Display
“dsPIC33 Demo”
“Press S3 to cont”
Is S3 No
pressed?
Yes
Initialize Timer1
Display
“Time 00:00:00”
“R6 = 0.00 VDC”
No Update
time?
Yes
Update No
volts?
Yes
Note: The Explorer 16 kit does not include a power supply. If an external supply
is needed, use Microchip part number AC162039.
• An external, regulated DC power supply that provides both +5V and +3.3V can be
connected to the terminals provided (at the bottom left side of the board, near S3).
Note: Do not attempt to power the Explorer 16 board using the MPLAB ICD 2
module. It is not designed to be a USB bus power source.
One green LED (D1) is provided to show when the Explorer 16 board is powered up.
The power-on LED indicates the presence of +3.3V.
4.2.7 LCD
The Explorer 16 board includes an alphanumeric LCD display with two lines of 16 char-
acters each. The display is driven with three control lines (RD4, RD5 and RD15) and
eight data lines (RE7:RE0). On PIC24 devices, the LCD is driven by the PMP module,
not the I/O port.
The Explorer 16 board has multiple LCD footprints and support options, although only
one footprint is ever populated at one time. The Lumex LCM-SO1062 (populated at
LCD4) is a 5V LCD with TTL input, and is used in the initial version of the Explorer 16
board. The Tianma TM162JCAWG1 (populated at LCD1) is a 3V LCD; it is anticipated
to be used in future versions of the board.
An alternate configuration option allows the use of RD3:RD0 as four of the data lines,
instead of RE7:RE4. To do this, the user must cut the trace jumpers at R60/62/64/66
and create solder bridges from the pads for R61/63/65/67 (see Figure 4-1).
R67
R63
R62
R66
Add
Cut Traces Solder
Here Bridges
R61
R60
R65
R64
Here
4.2.9 Switches
Five push button switches provide the following functions:
• S1: Active-low MCLR switch to hard reset the processor
• S3: Active-low switch connected to RD6 (user-defined)
• S4: Active-low switch connected to RD13 (user-defined)
• S5: Active-low switch connected to RA7 (user-defined)
• S6: Active-low switch connected to RD7 (user-defined)
Switch S1 has a debounce capacitor, whereas S3 through S6 do not; this allows the
user to investigate debounce techniques. When Idle, the switches are pulled high
(+3.3V). When pressed, they are grounded.
4.2.11 LEDs
Eight red LEDs (D2 through D9) are connected to PORTA of the PIM socket. The
PORTA pins are set high to light the LEDs. These LEDs may be disabled by removing
jumper JP2.
Note: When connecting SPI and UART peripherals on two Explorer 16 boards,
use crossover connection on only one of the boards.
SPI*
ICSP*
USB JTAG*
PIC18LF4550
PIC24FJ128GA010
PICtail™ Plus
PICtail™ Plus
dsPIC33FJ256GP710
ICD/ICSP POT
JTAG
LEDs
Switches
* Hardware support only; firmware support for SPI™, JTAG and ICSP™ via USB are not available at this time.
VDDCORE
VCAP/VDDCORE
VSS
VDD
VSS
VDD
VSS 100-Pin PIM
VDD
CVREF/AN10/RB10
AVDD
AVSS
VSS
VDD
VDD
VSS
10 μF .1 μF
VCAP/VDDCORE
VSS
VDD
VSS
PIC24FJ128GA010
VDD
VSS
VDD
CVREF/AN10/RB10
AVDD
AVSS
VSS
VDD
VDD
VSS
.1 μF
PICkit™ 2 Programmer
VCC
.1 μF
.1 μF
VEE
VCC
.1 μF
VEE
VCC
VSS .1 μF
25LC256
TC1047A
VDD VOUT
VSS
.1 μF
8 MHz
32 kHz
22 pF 22 pF 22 pF 22 pF
.1 μF 47 μF
.1 μF
.1 μF 47 μF 47 μF
.1 μF .1 μF .1 μF .1 μF .1 μF .1 μF
VBUS
VUSB
VSS
VSS
VDD
VSS PIC18F4550_QFN44 VDD
VDD
VDD
.1 μF .1 μF
20 MHz
.1 μF .1 μF
22 pF 22 pF
.1 μF
VCC
.1 μF .1 μF
.1 μF
.1 μF
.1 μF
VEE VO
VCC
VEE VEE
4.7 μF VCC
4.7 μF
4.7 μF
4.7 μF
1 μF .1 μF
1 μF
1 μF
1 μF
1 μF
VSS
VDD
VEE VO
Index
B Processor Support ........................................ 8, 27
Build Options............................................................ 16 Prototype Area .................................................... 8
RS-232 Serial Port ........................................ 8, 28
C Serial EEPROM ............................................ 8, 29
Configuration Bits..................................................... 19 Switches........................................................ 8, 29
Crossover Connections Temperature Sensor ..................................... 8, 28
(Serial Communications) ...................................8, 30 USB Connectivity .......................................... 8, 28
Customer Change Notification Service ...................... 5
I
Customer Support ...................................................... 5
Internet Address......................................................... 4
D
L
Documentation
Conventions ........................................................ 2 Language Toolsuite.................................................. 13
Layout ................................................................. 1 M
dsPIC33 Tutorial Program........................................ 25
Microchip Internet Web Site ....................................... 4
dsPIC33F Tutorial Program
MPLAB ICD 2........................................................... 10
Flowchart .......................................................... 26
MPLAB IDE Simulator, Editor User’s Guide............... 4
E P
Explorer 16 Development Board
PIC24 Tutorial Program ........................................... 23
Block Diagram .................................................. 33
Flowchart .......................................................... 24
Layout ................................................................. 9
PICtail Plus Edge Connectors
Schematics ..................................................34–41
Use with Crossover Serial
Explorer 16 Programming Tutorial ........................... 11
Connections........................................ 30
Building the Code ............................................. 16
Project ...................................................................... 12
Creating the Project .......................................... 12
Project Wizard.......................................................... 12
Programming the Device .................................. 19
R
F
Reading, Recommended ........................................... 3
Free Software Foundation ......................................... 4
Readme...................................................................... 3
G Reference Documents ............................................. 10
GNU Language Tools ................................................ 4 S
H Schematics......................................................... 34–41
Hardware Features U
Analog Potentiometer ....................................8, 29
USB
ICD Connector ...............................................8, 28
Connectivity ...................................................... 28
JTAG Connector ............................................8, 30
Updating the USB Connectivity
LCD, Alphanumeric........................................8, 28
Firmware............................................. 43
LCD, Graphic .................................................8, 29
LEDs ..............................................................8, 29 W
Multiplexers....................................................8, 30 Warranty Registration ................................................ 2
Oscillator Options ..........................................8, 29 Workspace ............................................................... 12
PICkit 2 Connector.........................................8, 30 WWW Address ........................................................... 4
PICtail Plus Card Edge Connectors...............8, 30
Power Indicator LED ........................................... 8
Power Supply.................................................8, 27
10/31/05