PICDEMTM 4 User’s Guide 2003 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 4 User’s Guide Table of Contents Chapter 1. Introduction 1.1 Welcome ......................................................................................... 1 1.2 PICDEM 4 Demonstration Board .................................................... 2 1.3 Sample Devices .............................................................................. 3 1.4 Sample Programs ........................................................................... 3 1.5 PICDEM 4 User’s Guide .......................
PICDEM 4 User’s Guide Appendix A. Hardware Detail A.1 Processor Sockets ........................................................................11 A.2 LED DISPLAY ...............................................................................11 A.3 Power Supply ................................................................................11 A.4 RS-232 Serial Port ........................................................................11 A.5 Switches ...............................................
PICDEM 4 User’s Guide Chapter 1. Introduction 1.1 WELCOME Thank you for purchasing the PICDEM 4 demonstration board from Microchip Technology Incorporated. The PICDEM 4 demonstrates the capabilities of the 8-, 14-, and 18-pin PIC16XXXX and PIC18XXXX devices. The PICDEM 4 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). Sample programs are provided to demonstrate the unique features of the supported devices.
PICDEM 4 User’s Guide 1.2 PICDEM 4 DEMONSTRATION BOARD The PICDEM 4 demonstration board has the following hardware features: 1. 8-, 14- and 18-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, 100 mA AC/DC wall adapter or 9V battery, or hooks for a +5V, 100 mA regulated DC supply. 3. RS-232 connection and associated hardware for direct connection to RS-232 interface. 4. In-Circuit Debugger (ICD) connector. 5.
Introduction 1.3 SAMPLE DEVICES Two FLASH devices are included. The device types may change, but will generally include PIC16XXXX and PIC18XXXX 18-pin DIP devices. 1.4 SAMPLE PROGRAMS The PICDEM 4 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 4 User’s Guide NOTES: DS51337A-page 4 2003 Microchip Technology Inc.
PICDEM 4 User’s Guide Chapter 2. Getting Started The PICDEM 4 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 4 User’s Guide 2.2 PICDEM 4 USED WITH AN IN-CIRCUIT EMULATOR OR IN-CIRCUIT DEBUGGER To use PICDEM 4 with an In-Circuit Emulator (ICE) or In-Circuit Debugger (ICD), refer to the tool’s user’s 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-1: PICDEM 4 CONNECTED TO MPLAB ICD 2 USING USB Configure the PICDEM 4 for the desired oscillator as described in Table 2-1.
PICDEM 4 User’s Guide Chapter 3. Tutorial The tutorial program is preprogrammed into the sample device (for example, p16PDEM4_Demo.hex for a PIC16XXXX device and p18PDEM4_Demo.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 4 hardware, please refer to Appendix A. 3.
PICDEM 4 User’s Guide FIGURE 3-1: PIC18F TUTORIAL PROGRAM FLOW CHART Power-up "Microchip PICDEM 4" Voltmeter SW1 = Next SW3 = Now SW3 SW1 Real-Time Clock SW1 = Next SW3 = Now Volts = 1.93V SW3 = Exit Test SW3 SW3 SW1 00:00:00 SW1 = Set SW3 = Menu SW1 SW3 00:00:00 SW1 = -> SW3 = ++ SW1 (2x) 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 4 CD-ROM.
PICDEM 4 User’s Guide Appendix A. Hardware Detail The PICDEM 4 hardware is uncomplicated and is intended to illustrate the ease of use of various PICmicro MCUs. The PICDEM 4 features the following hardware elements. Note: 2003 Microchip Technology Inc. Many of the following hardware sections will require specific demo board jumper configurations. If a jumper is not listed in a particular section, then that jumper has no effect on the circuitry within the hardware section you are working.
PICDEM 4 User’s Guide PICDEM 4 DEMONSTRATION BOARD PARTS LAYOUT (SILKSCREEN) J9 J7 J14 J13 J12 J17 J11 J16 J18 J4 J23 J3 J28 J19 J20 J24 J25 J26 J27 J8 J10 J21 J15 J22 FIGURE A-1: DS51337A-page 10 2003 Microchip Technology Inc.
Hardware Detail A.1 PROCESSOR SOCKETS Although three sockets are provided, only one device may be used at a time. • 8- or 14-pin socket (U5) used for 8- or 14-pin devices (8-pin devices are inserted in the upper 8 pins of U5) • 18-pin PIC16 socket (U7) • 18-pin PIC18 socket (U8) A.2 LED DISPLAY Eight red LEDs are connected to PORTA and PORTB of U7 and U8, while five of the eight LEDs are connected to U5. PORTA and PORTB pins are set high to light the LEDs.
PICDEM 4 User’s Guide A.5 SWITCHES Three switches provide the following functions: • S1 - Active low switch connected to RA4 • S2 - MCLR to hard reset the processor • S3 - Active low switch connected to RB0 Switch S2 has a debounce capacitor, whereas S1 and S3 do not, allowing the user to investigate debounce techniques. When pressed, the switches are grounded; when idle, they are pulled high (+5V). A.6 OSCILLATOR OPTIONS • RC oscillator (2 MHz approximately) supplied.
Hardware Detail A.9 SERIAL EEPROM For EEPROM operation, these jumpers must be configured as follows: PIC16 • J8/10 - Upper two pins ON • J21 - OFF (PORTB LEDs) PIC18 • J8/10 - Lower two pins ON • J21 - OFF (PORTB LEDs) For more information on the serial EEPROM, please refer to the most recent version of the Technical Library CD-ROM. A.10 MOTOR There are three headers (J11, J12, and J13) for the motor driver circuit. These will allow for external power and load connections.
PICDEM 4 User’s Guide A.10.1 PICDEM 4 Motor Control Demo The TC4467 devices are a family of four output CMOS buffers/MOSFET drivers. The PICmicro MCU PWM output is connected to these drivers to create a variety of possible driving conditions. The following figures show a few of these possible configurations. The driver can directly drive the small load, or can act as a MOSFET driver for a bigger load request.
Hardware Detail FIGURE A-4: HALF-BRIDGE MODE PWM PA RB3 1Y A 1Y PA RB3 A TC4467 2Y PB RB2 FIGURE A-5: L 2Y PB RB2 PA RB3 A TC4467 A L L = Load A = Amplifier DUAL OUTPUT PWM IN H-BRIDGE CONFIGURATION 1Y TC4467 A A PA RB3 L PB RB2 1Y A A TC4467 L 2Y A A PB RB2 2Y A A L = Load A = Amplifier 2003 Microchip Technology Inc.
PICDEM 4 User’s Guide A.11 LIN The PICDEM 4 is designed with an optional LIN circuit (not populated). This circuit provides the essential circuitry to interface a PICmicro microcontroller to a Local Interconnect Network (LIN). The circuit includes a MCP201 LIN transceiver, reverse voltage protection, and over voltage protection. Jumpers J16, J17, J18, J19, and J20 are provided to set up and connect a PICmicro microcontroller on PICDEM 4 to the LIN bus.
Hardware Detail A.12 SUPERCAPACITOR The 0.33F (C5) Supercapacitor is used to demonstrate the low power capabilities of PICmicro devices. This circuit requires all other peripherals to be disconnected from the circuit. The Supercapacitor code, included on your PICDEM 4 CD, is configured so that the device will remain in SLEEP most of the time, while a 32 kHz watch crystal (Y2) connected to Timer1 keeps the PICmicro MCU running.
PICDEM 4 User’s Guide A.13 REAL-TIME CLOCK This circuit allows the user to configure a PICmicro MCU in either the U7 or U8 socket for timekeeping, using a 32.768 kHz clock crystal connected to Timer1’s T1OSO and T1OSI pins. ICD operation will not be functional when the Real-Time Clock circuit is enabled. For RTC operation, these jumpers must be configured as follows: • J7 - ON • J9 - ON • J21 - OFF A.
Hardware Detail A.15 DEVICE CONFIGURATION OVERVIEW Table A-1 lists the I/O features and port connections for each processor type.
PICDEM 4 User’s Guide A.16 BOARD LAYOUT AND SCHEMATICS The following figures show the parts layout (silkscreen) and schematics for the PICDEM 4 board. PICDEM 4 PARTS LAYOUT J9 J7 J14 J13 J12 J17 J11 J16 J18 J23 J4 J3 J28 J19 J20 J24 J25 J26 J27 J8 J10 J21 J15 J22 FIGURE A-6: DS51337A-page 20 2003 Microchip Technology Inc.
Hardware Detail FIGURE A-7: PICDEM 4 SCHEMATIC SHEET 1 2003 Microchip Technology Inc.
PICDEM 4 User’s Guide FIGURE A-8: Note: PICDEM 4 SCHEMATIC SHEET 2 The Supercapacitor circuit described in this manual is used only to demonstrate the low power capability of the device. The Supercapacitor is used as an example for the low power source. DO NOT use this circuit as a general design practice. DS51337A-page 22 2003 Microchip Technology Inc.
PICDEM 4 User’s Guide Index A O A/D Input ................................................................... 2 Oscillator Options .................................................... 12 Oscillator Selection ................................................... 6 B Board ............................................................ 1, 2, 5, 9 Parts Layout ............................................... 10, 20 Power Supply ............................................... 5, 11 Silkscreen ....................
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 Marketing Support Division Suite 22, 41 Rawson Street Epping 2121, NSW Australia Tel: 61-2-9868-6733 Fax: 61-2-9868-6755 Microchip Technology Japan K.K.