M PICDEM™ 2 PLUS USER’S GUIDE 2002 Microchip Technology Inc.
Note the following details of the code protection feature on PICmicro® MCUs. • • • • • • The PICmicro family meets the specifications contained in the Microchip Data Sheet. Microchip believes that its family of PICmicro microcontrollers is one of the most secure products of its kind on the market today, when used in the intended manner and under normal conditions. There are dishonest and possibly illegal methods used to breach the code protection feature.
12 PICDEM™ 2 PLUS USER’S GUIDE Table of Contents Chapter 1. Introduction 1.1 Welcome ......................................................................................... 1 1.2 PICDEM 2 Plus Demonstration Board ............................................ 2 1.3 Sample Devices .............................................................................. 3 1.4 Sample Programs ........................................................................... 3 1.5 PICDEM 2 Plus User’s Guide ..........
PICDEM™ 2 Plus User’s Guide Index ......................................................................................................... 19 Worldwide Sales and Service ................................................................. 20 DS51275A-page iv 2002 Microchip Technology Inc.
12 PICDEM™ 2 PLUS USER’S GUIDE Chapter 1. Introduction 1.1 Welcome Thank you for purchasing the PICDEM 2 Plus demonstration board from Microchip Technology Incorporated. The PICDEM 2 Plus is a simple board which demonstrates the capabilities of the 18-, 28- and 40-pin PIC16XXXX and PIC18XXXX devices. The PICDEM 2 Plus can be used stand-alone with a programmed part, with an in-circuit emulator (e.g., MPLAB® ICE) or with an in-circuit debugger (e.g., MPLAB ICD 2).
PICDEM™ 2 Plus User’s Guide 1.2 PICDEM 2 Plus Demonstration Board The PICDEM 2 Plus demonstration board has the following hardware features: 1. 18-, 28- and 40-pin DIP sockets. (Although 3 sockets are provided, only one device may be used at a time.) 2. On-board +5V regulator for direct input from 9V, 100mA AC/DC wall adapter or 9V battery, or hooks for a +5V, 100mA regulated DC supply. 3. RS-232 socket and associated hardware for direct connection to RS-232 interface. 4.
Introduction 7 2 9 8 15 13 11 10 3 5 14 12 4 17 18 1 16 2 6 Figure 1.1: PICDEM 2 Plus Hardware 1.3 Sample Devices Two FLASH devices are included. The device types may change, but will generally include PIC16XXXX and PIC18XXXX 40-pin DIP devices. 1.4 Sample Programs The PICDEM 2 Plus Kit includes a CD-ROM with sample demonstration programs. These programs may be used with the included sample devices, with an in-circuit emulator (ICE) or with an in-circuit debugger (ICD).
PICDEM™ 2 Plus User’s Guide 1.5 PICDEM 2 Plus User’s Guide This document describes the PICDEM 2 Plus demonstration board, tutorial and demonstration software. Detailed information on individual microcontrollers may be found in the device’s respective data sheet. Detailed information on in-circuit emulator (ICE) or in-circuit debugger (ICD) systems may be found in the respective tool’s user’s guide.
12 PICDEM™ 2 PLUS USER’S GUIDE Chapter 2. Getting Started The PICDEM 2 Plus may be used as a stand-alone board with a preprogrammed device, with an in-circuit emulator (ICE) or with an in-circuit debugger (ICD). For a list of PICmicro microcontroller-compatible ICEs or ICDs, please refer to the Development Systems Ordering Guide or the Microchip Third Party Guide. 2.
PICDEM™ 2 Plus User’s Guide If the code protection bit(s) have not been programmed, the on-chip program memory can be read out for verification purposes. 2.2 PICDEM 2 Plus Used with an In-Circuit Emulator or In-Circuit Debugger To use PICDEM 2 Plus with an in-circuit emulator (ICE) or in-circuit debugger (ICD), refer to the tool’s user guide for instructions on how to power up and configure the ICE/ICD, as well as how to connect to target boards (e.g., Figure 2.1). Figure 2.
Getting Started Configure the PICDEM 2 Plus for the desired oscillator as described in Table 2.1. Refer to the ICE/ICD user’s guide for any oscillator configuration requirements. Table: 2.1 OSCILLATOR SELECTION Oscillator Selection on PICDEM 2 Plus 2002 Microchip Technology Inc.
PICDEM™ 2 Plus User’s Guide NOTES: DS51275A-page 8 2002 Microchip Technology Inc.
12 PICDEM™ 2 PLUS USER’S GUIDE Chapter 3. Tutorials The tutorial program is preprogrammed into the sample device, (i.e., p16demo.hex for a PIC16XXXX device and p18demo.hex for a PIC18XXXX device). Also, this program is on the included CD-ROM program disk for user reference, (i.e., if the sample device has been reprogrammed with another program, the tutorial may be reprogrammed into the device). For detailed information on the PICDEM 2 Plus hardware, please refer to Appendix A. 3.
PICDEM™ 2 Plus User’s Guide 4. Clock Once this mode is entered from the main menu, a real time clock will start counting from 00:00:00. The Timer1 module and a 32KHz clock crystal is used to establish a real time clock. By pressing RA4, the clock time can be set to the user’s preference. When RA4 is pressed to set the time, the cursor will flash over the hours ten digit. Press RA4 again and the cursor will now flash over the minutes ten digit.
Tutorials . Power-up PICDEM™ 2 Plus Voltmeter RA4=Next RB0=Now Volts=0.33V RB0=Exit Buzzer RA4=Next RB0=Now Prd=128 DC=128 RA4=-> RB0=++ Temperature RA4=Next RB0=Now RA4 = 3 presses Temp=022C RB0=Exit Clock RA4=Next RB0=Now 00.00.02 RA4=Set RB0=Menu 00.00.03 RA4=-> RB0=++ RA4 = 3 presses Figure 3.1: Tutorial Program Flow Chart 2002 Microchip Technology Inc.
PICDEM™ 2 Plus User’s Guide 3.2 Source Code and Application Notes In addition to the assembled tutorial programs (HEX files), source code used to create these HEX files is included on the PICDEM 2 Plus CD-ROM. Both source code and related HEX file are found in device-specific directories. Application Notes are also included on the CD-ROM for additional examples of use. For information on how to reprogram the device with new or modified code, or how to restore the tutorial program, please see Section 2.1.
12 PICDEM™ 2 PLUS USER’S GUIDE Appendix A. Hardware Detail The PICDEM 2 Plus hardware is extremely simple and is intended to illustrate the ease of use of various PICmicro MCUs. The PICDEM 2 Plus features the following hardware elements: A.1 Processor Sockets Although three sockets are provided, only one device may be used at a time. • 18-pin socket • 28-pin socket • 40-pin socket A.2 Display Four red LEDs are connected to PORTB of each processor type. The PORTB pins are set high to light the LEDs.
PICDEM™ 2 Plus User’s Guide A.4 RS-232 Serial Port An RS-232 level shifting IC has been provided with all necessary hardware to support connection of an RS-232 host through the DB9 connector. The port is configured as DCE, and can be connected to a PC using a straight through cable. The PIC16/PIC18 RX and TX pins are tied to the RX and TX lines of the MAX232A. A.
Hardware Detail A.9 Temperature Sensor This is a serial digital thermal sensor (TC74) connected to the 28- and 40- pin microcontrollers via RC3 and RC4. Communication is accomplished with the TC74 via its 2-wire I2C™ compatible serial port. This device has an address of 1001101b. A.10 Serial EEPROM A 24L256 256K (256Kx8) serial EEPROM is included on the board to illustrate I2C bus concepts. For more information on the serial EEPROM, please refer to the most recent version of the Technical Library CD-ROM.
PICDEM™ 2 Plus User’s Guide A.13 Board Layout and Schematics The following figures show the parts layout (silkscreen) and schematics for the PICDEM 2 Plus board.
Hardware Detail +5V +5V R1 10K R7 47K 1 2 R19 470 +5V S1 S3 1 2 4 3 4 3 C2 0.1uF C1 C9 U1 0.1uF 0.1uF 11 VDD 12 VDD +5V R17 RB0 R2 R16 5K NMCLR 1 R18 470 R3 4.
PICDEM™ 2 Plus User’s Guide +5V R20 10K R5 R6 10K 300 LCD1 3 2 1 14 13 12 15 RA1 RA2 RA3 +5V 4 5 6 7 8 9 10 11 DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 E R/W RS VEE VCC GND GND1 RO0 RO1 RO2 RO3 02 R21 470 03 R22 470 04 R23 470 05 R24 470 RB0 RB1 RB2 RB3 J6 +5V +5V C11 C12 0.1 11 T1IN 10 T2IN T2OUT 3 C1+ C2+ C1- C2- 6 V- 1 2 3 4 5 14 7 13 A1IN 8 A2IN 12 A1OUT 9 A2OUT 1 15 C13 0.1 T1OUT J1 6 7 8 9 DE9S-FRS 4 R14 10.0 5 C15 GND RX V+ VDC 2 TX 16 0.1uF U3 0.
12 PICDEM 2 PLUS USER’S GUIDE Index A A/D Input .................................................... 2, 14 B Board .................................................. 1, 2, 5, 13 Parts Layout ............................................. 16 Power Supply ....................................... 5, 13 Silkscreen ................................................ 16 Buzzer .............................................................. 9 Buzzer, Piezo ...................................................
M WORLDWIDE SALES AND SERVICE AMERICAS ASIA/PACIFIC Japan Corporate Office Australia 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: 480-792-7627 Web Address: http://www.microchip.com Microchip Technology Australia Pty Ltd Suite 22, 41 Rawson Street Epping 2121, NSW Australia Tel: 61-2-9868-6733 Fax: 61-2-9868-6755 Microchip Technology Japan K.K.