NEW DATABASE - 350 MILLION DATASHEETS FROM 8500 MANUFACTURERS
RS-232 PIC16C71 PIC16C84 PIC17C42 DS33015B PIC16CXX PIC16/17 PIC16C5X - Datasheet Archive
Table of Contents Preface. . 1 Welcome
PICDEM-1 USER'S GUIDE Table of Contents Preface. . 1 Welcome . 1 Documentation Layout . 1 Chapter 1. Introduction . Introduction . Hardware . Hardware . Display . Power Supply . RS-232 RS-232 Serial Port . Key Inputs . Oscillator Options . Analog Inputs . Prototype Area . 3 3 3 3 3 3 4 5 5 5 5 Chapter 2. Getting Started Using the PICMASTER Emulator . 7 Introduction . 7 Highlights . 7 Chapter 3. Running the Tutorial . Introduction . Highlights . Running the Tutorial . 15 15 15 15 Chapter 4. Using Trace Functions . 23 Highlights . 23 Using Trace Functions . 23 Chapter 5. Demonstration Program for the PIC16C71 PIC16C71 . 29 Introduction . 29 PIC16C71 PIC16C71 Demonstration Program . 29 Chapter 6. Demonstration Program for the PIC16C84 PIC16C84 . 35 Introduction . 35 Chapter 7. Demonstration Program for the PIC17C42 PIC17C42 . 43 Introduction . 43 PIC17C42 PIC17C42 Demonstration Program . 43 Chapter A. Hardware Description . 51 © 1994 Microchip Technology Inc. DS33015B DS33015B - page i Information contained in this publication regarding device applications and the like is intended by way of suggestion only. No representation or warranty is given and no liability is assumed by Microchip Technology Incorporated with respect to the accuracy or use of such information. Use of Microchip's products as critical components in life support systems is not authorized except with express written approval by Microchip. The Microchip logo and name are trademarks of Microchip Technology Incorporated. PIC is a registered trademark of Microchip in the U.S.A. PICMASTER, PRO MATE and PICSTART are trademarks of Microchip Technology Inc. All rights reserved. © 1994 Microchip Technology Inc. IBM and PC/AT are registered trademarks of International Business Machines Corporation. MS-DOS and MS Windows are trademarks of Microsoft Corporation. All other trademarks mentioned herein are the property of their respective companies. © 1994 Microchip Technology Inc. DS33015B DS33015B - page ii PICDEM-1 USER'S GUIDE Preface Welcome Thank you for purchasing the PICDEM-1 product demonstration board for the PIC16CXX PIC16CXX and PIC17C42 PIC17C42 microcontrollers from Microchip Technology Incorporated. The PICDEM-1 allows you to quickly and easily become familiar with both the PIC16CXX PIC16CXX and PIC17C42 PIC17C42 products and the PICMASTERTM Universal InCircuit Emulator. Documentation Layout This document describes the PICDEM-1 demonstration board and provides a tutorial for its use with the PICMASTER universal in-circuit emulator. A detailed description of the tutorial and demonstration software is provided to give the user a brief overview of the PIC16/17 PIC16/17 series of Microchip microcontrollers, as well as the PICMASTER. Detailed usage of the microcontrollers and the PICMASTER are deferred to the individual product data sheets and User's Manual, respectively. Chapter 1: Introduction - This chapter introduces the PICDEM-1 and provides a description of the hardware. Chapter 2: Getting Started Using the PICMASTER Emulator - This chapter goes through a basic step-by-step process for getting your PICDEM-1 up and running on the PICMASTER emulator system. Chapter 3: Running the Tutorial This chapter discusses how to run the PIC16/17 PIC16/17 tutorial, STEPping the program, and setting BREAKpoints. In addition, a detailed description of the tutorial program is provided with a lineby-line breakdown and analysis. Chapter 4: Using the Trace Function This chapter describes the use of the Trace functions and the Break on Counter settings. Chapter 5: Demonstration Program for the PIC16C71 PIC16C71 This chapter provides a detailed description of the demonstration program for the PIC16C71 PIC16C71, demo71.asm is discussed. This program demonstrates the A/D functions of the PIC16C71 PIC16C71. Chapter 6: Demonstration Program for the PIC16C84 PIC16C84 This chapter provides a detailed description of the demonstration program for the PIC16C84 PIC16C84, demo84.asm is discussed. This program highlights the EEPROM usage in the PIC16C84 PIC16C84. © 1994 Microchip Technology Inc. DS33015B DS33015B - page 1 Preface Chapter 7: Demonstration Program for the PIC17C42 PIC17C42 This chapter provides a detailed description of the demonstration program for the PIC17C42 PIC17C42, demo42.asm. The program demonstrates the USART peripheral of the PIC17C42 PIC17C42. Chapter 8: Hardware Description This chapter provides a detailed hardware description of the PICDEM-1, as well as a detailed description of the port connections for each microcontroller type used with the board. © 1994 Microchip Technology Inc. DS33015B DS33015B - page 2 PICDEM-1 USER'S GUIDE Chapter 1. Introduction Introduction The PICDEM-1 is a simple demonstration board that supports the PIC16C5X PIC16C5X family of microcontrollers, the PIC16C71 PIC16C71, the PIC16C84 PIC16C84 and the PIC17C42 PIC17C42. The board can be used stand-alone with a pre-programmed part, or with the PICMASTER or other emulator system. Sample programs are provided to demonstrate the unique features of the devices. Although multiple processor sockets are provided to accommodate the different packages available, only one processor may be run at a time. Hardware The PICDEM-1 features the following elements: Hardware: Processor sockets: · One 40-pin socket provides support for a PIC17C42 PIC17C42 processor · One 28-pin socket provides support for PIC16C55/57 PIC16C55/57 processors · One 18-pin socket provides support for PIC16C54/56/58/71/84 PIC16C54/56/58/71/84 microprocessors Display: Eight red LEDs are connected to PORTB of each processor type. The LEDs will be lit when the PORTB pins are set high. Power Supply: Two power supplies (9V, 100mA unregulated AC/DC or 5V 100mA regulated DC) can power up the PICDEM-1, though not at the same time. The PICDEM-1 has an on-board rectifier, filter and regulator which inputs a 9V unregulated supply and outputs a 5V DC regulated voltage for all the logic circuits. Hooks are also provided for users to tie in a regulated 5V DC supply directly to the circuit. In either case, an external power supply must be provided by the user. PICMASTER users should note that two of the logic probe outputs (RED and BLACK probe tips) provide +5V DC regulated. These probes can be easily connected to the hooks to power the PICDEM-1 (Red probe to +5V and Black probe to GND). Note that the exact power up sequence in the Getting Started section of this guide must be followed. © 1994 Microchip Technology Inc. DS33015B DS33015B - page 3 PICDEM-1 USER'S GUIDE RS-232 RS-232 Serial Port: The RS-232 RS-232 port may be connected to a terminal using a straight through cable. A MAX232A MAX232A IC has been provided with all the necessary hardware to drive a RS-232C RS-232C signal through a 9 pin D-type female socket. Communication occurs directly through the RX and TX lines. In case of the PIC17C42 PIC17C42 the RX and TX lines of the processor are connected to the RX and TX lines of the MAX232A MAX232A. Please check the Schematics for details. The rest of the processors do not have a hardware implemented serial port, so the RX and TX line are connected to specific I/O ports. These port pins may be driven by software. TABLE 1.1 - DB9 TO DB9 CONNECTION Signal Name PC Pin (DB25) PICDEM-1 Pin (DB9) Received Data 2 2 Transmitted Data 3 3 Data Terminal Read 3 4 Signal Ground 5 5 Data Set Ready 6 6 Request to Send 7 7 Clear to Send 8 8 TABLE 1.2 - DB25 TO DB9 CONNECTION Signal Name PC Pin (DB25) PICDEM-1 Pin (DB9) Received Data 2 Transmitted Data 2 3 Data Terminal Ready 20 4 Signal Ground 7 5 Data Set Ready 6 6 Request to Send 4 7 Clear to Send DS33015B DS33015B - page 4 3 5 8 © 1994 Microchip Technology Inc. Chapter 1. Introduction Key Inputs: Three keys are provided which have the following functions: · MCLR or Reset switch which hard resets the processor · RTCC switch which drives the RTCC input when pressed · Active low switch connected to RA1 input Oscillator Options: · On-board oscillator is an RC running at approximately 2 MHz. A jumper connection (J3) disconnects the RC oscillator · Socket provided for a "canned" crystal Oscillator · Footprints and holes provided to connect a crystal with 2 caps Analog Inputs: A 5K potentiometer is connected through a series 470 ohm resistor to Channel 0 of the PIC16C71 PIC16C71 (18-pin) socket. This pot can be adjusted from VDD to GND to simulate an analog input to the PIC16C71 PIC16C71. Prototype Area: A generous 2.3" X 0.8" area with more than 200 plated holes is provided for prototyping additional circuits on the board. © 1994 Microchip Technology Inc. DS33015B DS33015B - page 5 PICDEM-1 USER'S GUIDE DS33015B DS33015B - page 6 © 1994 Microchip Technology Inc. PICDEM-1 USER'S GUIDE Chapter 2. Getting Started Using the PICMASTER Emulator Introduction This chapter goes through a basic step-by-step process for getting your PICDEM-1 up and running on the PICMASTER emulator system. Highlights · Connecting the PICMASTER emulator · Correct power-up sequencing · Installing the demo software · Loading a Setup file · Running a program · Halting a program TABLE 2.1 - HEADER SELECTION Processor Tutorial Program Demo Program Probe Header Hardware PIC16C54 PIC16C54 tut54.hex N/A Emulator Header, PIC16C5X PIC16C5X 18 lead Header Interface PIC16C55 PIC16C55 tut55.hex N/A Emulator Header, PIC16C5X PIC16C5X 28 lead Header Interface PIC16C56 PIC16C56 tut56.hex N/A Emulator Header, PIC16C5X PIC16C5X 18 lead Header Interface PIC16C57 PIC16C57 tut57.hex N/A Emulator Header, PIC16C5X PIC16C5X 28 lead Header Interface PIC16C58 PIC16C58 tut58.hex N/A Emulator Header, PIC16C5X PIC16C5X 18 lead Header Interface PIC16C71 PIC16C71 tut71.hex demo71.hex PIC16C71 PIC16C71 Emulator Header PIC16C84 PIC16C84 tut84.hex demo84.hex PIC16C84 PIC16C84 Emulator Header PIC17C42 PIC17C42 N/A demo42.hex PIC17C42 PIC17C42 Emulator Header © 1994 Microchip Technology Inc. DS33015B DS33015B - page 7 PICDEM-1 USER'S GUIDE Step 1: Follow the instructions in your PICMASTER emulator package and connect the emulator to an IBM® compatible PC running MS WindowsTM. At no time should power be applied to either the PC or the emulator until all connections have been made. Connect the appropriate probe header to the emulator POD. Table 2-1 shows the appropriate header for the various microcontrollers. Connect the Logic Probes to the emulator. Step 2: Remove the PICDEM-1 from its package and visually inspect that no physical damage has occurred to any of the components on the board, and that jumper J3 is installed. If any component is damaged, please contact your local distributor for further assistance. Step 3: Select the oscillator option to be used. Table 2.2 lists the modifications necessary for each option. Note that not all probe headers have an OSC selection DIP switch. Example: PICMASTER's oscillator is to be used to run the PICDEM-1: On PICDEM-1 remove jumper J3, make sure sockets Y2 and Y1 are not populated. On the PICMASTER probe, set clock selection jumper to INT. This is the recommended configuration for running the Tutorials. TABLE 2.2 - OSCILLATOR SELECTION Oscillator Selection Modification on PICDEM-1 Modification on PICMASTER RC J3 installed, Y2 empty, Y1 empty CLK jumper select EXT; OSC DIP switch set to RC Crystal J3 removed, Y2 empty, crystal in Y1, caps C2 and C3 installed CLK jumper select EXT; OSC DIP switch set to XT or LF (depending on crystal type) Canned Crystal Oscillator J3 removed, Oscillator in U2. Y1, C2 and C3 empty CLK jumper select EXT; OSC DIP switch set to EC or XT PICMASTER's Oscillator J3 removed, Y2 and Y1 empty CLK jumper select INT; OSC DIP switch set to XT DS33015B DS33015B - page 8 © 1994 Microchip Technology Inc. Chapter 2. Getting Started Using the PICMASTER Step 4: Remove all pre-programmed microcontrollers installed in the PICDEM-1. Connect the PICMASTER header probe to the appropriate socket on the PICDEM-1. Example: If you are emulating the PIC16C54 PIC16C54, connect the 18 pin header on the probe card to the 18 pin socket on PICDEM-1. © 1994 Microchip Technology Inc. DS33015B DS33015B - page 9 PICDEM-1 USER'S GUIDE Step 5: If the PICMASTER power probes are to be used to power the PICDEM-1, connect the Red probe clip to the hook marked +5V on PICDEM-1, and the Black probe clip to the hook marked GND on PICDEM-1. Note: If an external wall mount power supply is being used, do not connect it to the PICDEM-1 at this time. Step 6: All connections should be made at this point. The following power up sequence must be followed exactly. · Power up the PC · Start MS Windows · Power up the PICMASTER If an external wall mount power supply is being used, connect it now and turn on the power. Note: This can be done from DOS by changing to the directory you want the files in and typing: A:PICDEM1-d Step 7: The PICDEM-1 package includes a 3.5" disk which contains sample programs for all the processor types supported. The zipped files can be unzipped into appropriate subdirectories by doing the following: · Open a DOS window · Insert the PICDEM-1 diskette, and change to the drive that the diskette is in. If the diskette is in drive A:, for example, type: C:\> a: Note that the install program must be run from the directory in which it resides! · Run the Install program: A:\>install · The install program will ask on which drive you want to install the files. Simply type the drive letter of the hard drive on which you wish the files to be installed; the program will do the rest. · The install program creates a directory on the selected drive called "picdem1" with four sub-directories named demo42, demo5X, demo71, and demo84. These sub-directories contain all the files necessary to run the demo for the appropriated family members. · Close the DOS window. Note: The above step can also be executed in DOS if desired. DS33015B DS33015B - page 10 © 1994 Microchip Technology Inc. Chapter 2. Getting Started Using the PICMASTER Step 8: Start the PICMASTER software by double clicking on the PICMASTER icon. If a problem occurs during PICMASTER start up, refer to the PICMASTER manual for troubleshooting procedures. If the software starts up correctly, check that the proper processor is being emulated by looking at the Hardware menu under the Configure menu. If the proper processor is not being emulated, refer to the PICMASTER manual for troubleshooting procedures before proceeding. · · © 1994 Microchip Technology Inc. Under the Configure menu, select Load Setup, the window shown below will appear: If the drive in which the PICDEM-1 programs were saved is other than C:, use the Drives Menu to change to the correct drive. Use the Directories Menu to open the files in the PICDEM1 subdirectory (by double clicking on picdem1). The window will now look like: DS33015B DS33015B - page 11 PICDEM-1 USER'S GUIDE · · The tut5x.cfg files are the configuration files for the PIC16C5x devices. Select the tutxx.cfg file appropriate to your processor type and click the OK button. A popup window will appear asking if you want to clear the current configuration: · DS33015B DS33015B - page 12 In this menu double clicking on the demo5x item will select the *.cfg files in the demo5x directory (if you are emulating a different processor, change to that directory): Click on the Yes button and the screen will be reconfigured. © 1994 Microchip Technology Inc. Chapter 2. Getting Started Using the PICMASTER · The screen will look different if video resolution is other than VGA (640 x 480): Step 9: Execute the program. In the Execute Box, click on Run and the tutxx program will execute. While the program is executing, the program memory screen is cleared. · The tutxx program increments a file register when S3 on the PICDEM-1 board is pressed and displays the value in binary on the LEDs connected to Port B. To stop the emulation, click on the Halt button in the Execute Box. To step through each instruction in the program, first halt and then click on the Step button. For more details on the operation of the PICMASTER, consult the PICMASTER Manual or go to the next chapter(s). © 1994 Microchip Technology Inc. DS33015B DS33015B - page 13 PICDEM-1 USER'S GUIDE DS33015B DS33015B - page 14 © 1994 Microchip Technology Inc. PICDEM-1 USER'S GUIDE Chapter 3. Running the Tutorial Introduction This chapter gives a detailed explanation of the functionality and operation of the PIC16/17 PIC16/17 microcontrollers with the PICDEM-1 card. Highlights · Running the Tutorial · STEPping the program · Setting BREAKpoints Running the Tutorial The tutorial programs for all of the processor types use the same core code, but may have different starting addresses and setup routines due to hardware differences among the processors. The tutorial for PIC16C54 PIC16C54 will be used for this narrative, but the instructions will work for all of the tutorial programs. RA1 (bit 1 of Port A, configured for this tutorial as an input) is connected to switch S3. The program increments a file register (COUNT) every time S3 is pressed. The value of COUNT is displayed on the LEDs connected to Port B. Step 1: Refer to "Getting Started" in Chapter 2 for step-by-step instructions in setting up the PICDEM-1 with the PICMASTER. Step 2: Ensure that the correct processor type is selected under the Configure/Hardware PICMASTER menu. If the proper processor is not selected, refer to the PICMASTER documentation for correction procedures. Step 3: Under the Configure menu select Load Setup and retrieve the correct tutxx.cfg file. · Note: The included file "PICDEM1-equ" contains equate instructions that define the register locations. See Step 8 of Chapter 2, "Getting Started". Step 4: Refer to the program listing, next page. The program begins by defining a variable COUNT at RAM location 10h. The 4 instructions after Start set Port B as an output and the variable COUNT is cleared. On start-up the program is halted at the reset vector (01FFh for the PIC16C54 PIC16C54). This is line 35 in the program listing and will cause the program to jump to Start. · © 1994 Microchip Technology Inc. · Click the mouse on the Step button located in the Execute box. DS33015B DS33015B - page 15 Chapter 3. Running the Tutorial The Step function executes a single instruction and displays the result. ;This program runs on the PICDEM-1 demo board. ;In the Demo board, PORTB is connected to 8 LEDs. ;RA1 is connected to a switch (S3). This program increments ;the file register count each time S3 is pressed. ;The value of count is displayed on the LEDs connected ;to PORTB. ;Net result is that LEDs should increment in a binary ;manner every time S3 is pressed. list p=16c54,f=inhx8m ; include "\picdem1\picdem1.equ" COUNT equ 0x10 ; org Start movlw movwf tris clrf Loop btfss goto Endloop goto IncCount incf movf movwf Debounce btfss goto Enddebounce goto ; ; org goto end 00h 0 PORT_B PORT_B COUNT ;config port b as output ;clr count PORT_A,1 IncCount ;see if RA1 pressed ;yes then inc count Loop ;else check again COUNT COUNT,w PORT_B ;inc count ; ;display on port b PORT_A,1 Debounce ;wait for key release ;not release then wait Loop ;else check key press again PIC54 PIC54 Start ;reset vector. tut54.asm Program Listing © 1994 Microchip Technology Inc. DS33015B DS33015B - page 16 Chapter 3. Running the Tutorial · · Click the mouse on the Step button located in the Execute window. · The W register in the Special Function Register (SFR) box will now be set to 0 (when a change occurs in any register, the SFR box highlights the changed bit(s). · Click the mouse on Step again. · © 1994 Microchip Technology Inc. The program line labeled Start will be highlighted in the Program Memory Dump (PMD) box. Note that the line highlighted in the PMD is the next instruction to be executed (i.e. it has not yet been executed): Port B was not already 0s it will be changed and the bits that switched will be highlighted in the SFR window: DS33015B DS33015B - page 17 Chapter 3. Running the Tutorial © 1994 Microchip Technology Inc. DS33015B DS33015B - page 18 Chapter 3. Running the Tutorial · Click the mouse on Step again. · The bits in the TRISB register in the SFR box that changed will be highlighted. · Click the mouse on Step again. · The variable count (location 10h in the Register Hex Dump box) is set to 0: Step 5: The routine now enters a loop. In this loop the program checks to see if S3 is pressed. If it is, the program goes to IncCount, if not it remains in the loop. The loop works as follows: Loop btfss PORT_A,1 goto IncCount Endloop goto Loop IncCount incf COUNT movf COUNT,w movwf PORT_B Debounce btfss PORT_A,1 goto Debounce Enddebounce goto Loop © 1994 Microchip Technology Inc. ;see if RA1 pressed ;yes then inc count ;else check again ;inc count ; ;display on port b ;wait for key release ;not release then wait ;else check key press again DS33015B DS33015B - page 19 Chapter 3. Running the Tutorial · · If porta is 0, the program jumps to the subroutine IncCount. Here count is immediately incremented, the contents moved to the W register, and the W register is moved to Port B and displayed on the LEDs. · BREAKPOINTs can be set at specific locations to halt the program after the instructions at those locations have been executed. · Move mouse cursor to the line IncCount in the PMD box and click the right mouse button. · © 1994 Microchip Technology Inc. If porta is set, S3 has not been pressed. If S3 has not been pressed, the program will skip the next instruction and continue in the loop. The left column will show "B . . .," this confirms that a BREAKPOINT is set at this point in the program: DS33015B DS33015B - page 20 Chapter 3. Running the Tutorial · · If it doesn't, click on the box, and one will appear. If this box is not X'ed, all breakpoints are disabled · Click the mouse on Run in the Execute box. · Press S3 on the demo board. · The program executes all instructions up to and including the one where the BREAKPOINT was set: · It then halts at the very next instruction after the BREAKPOINT, and the line is highlighted in the PMD. · © 1994 Microchip Technology Inc. Make sure that the box to the left of Break Enable in the Execute window has an `X' in it: Move the mouse cursor to IncCount and click the right mouse button to remove the BREAKPOINT. The "B." placed there earlier will disappear, indicating that no BREAKPOINT is set at that location. DS33015B DS33015B - page 21 Chapter 3. Running the Tutorial Step 6: The program now moves into the routine Debounce. This routine will wait for the switch to be released: Debounce btfss goto Enddebounce goto · PORT_A,1 Debounce ;wait for key release ;not release then wait Loop ;else check key press again RA1 is held down the program will wait until it is released before returning to the loop section of the code. Step 7: If the program is run with no Breakpoints set, it will allow you to increment, in a binary manner, the LEDs connected to Port B by repeatedly pressing switch S3. © 1994 Microchip Technology Inc. DS33015B DS33015B - page 22 PICDEM-1 USER'S GUIDE Chapter 4. Using Trace Functions Highlights · Using the Trace functions · Breaking on Counter settings Using Trace Functions PICMASTER contains many powerful and useful trace functions. Usage of these functions will be covered in this chapter. Step 1: Load the tutorial.cfg file appropriate to the processor being emulated (see Chapter 2, "Getting Started"). Note: If you are continuing from the last chapter, click on Reset in the Execute window and click on Step once. © 1994 Microchip Technology Inc. Step 2: Click on the Setup selection on the toolbar, and then select Trace Settings. This will produce a popup window for Hardware Trace Qualifiers. Enter "all" in the title box, "Start" (note that all labels are case sensitive) in the start box, and "Enddebounce" in the end box. Click on the Add button to add the address range to the list, "all" will be listed in the box on the left. Select "all" from the list and click on Enable Selected Item, an "X" will appear in the box to the right indicating that tracing will occur on these addresses: DS33015B DS33015B - page 23 PICDEM-1 USER'S GUIDE Click on the OK button to close the window. Notice that ".T." is now displayed next to each address in the PMD window indicating that these addresses will be traced: Note that either line labels or actual addresses can be used. Address values which start with a letter must be preceded by a "0" (i.e., "D9" would be entered as "0D9"). DS33015B DS33015B - page 24 Step 3: It would not be very useful to trace while in the loops waiting for the key press and release, so we will exclude these ranges from being traced. Enter two more trace ranges. Call the first range "loop" with a starting location of "Loop" and an ending location of "Endloop", and call the second range "debounce" with a starting location of "Debounce" and an ending location of "Enddebounce". Do not enable these ranges, and click on OK to close the window. By not enabling a defined range, those addresses in that range are excluded from the trace. Notice that the trace notation is removed from those ranges: © 1994 Microchip Technology Inc. Chapter 4. Using Trace Functions Step 4: Click on Run in the Execute window, press S3 twice, and then click on Halt in the Execute window. The trace is displayed in the Trace Memory Dump (TMD) window: The last line displayed in the TMD window is the last line executed before the Halt, so your trace may not look exactly the same as the one shown above. © 1994 Microchip Technology Inc. DS33015B DS33015B - page 25 PICDEM-1 USER'S GUIDE Step 5: Next we will demonstrate breaking using the Arm Counter. Open the Arm Counter Qualifiers window by clicking on Setup and then on Arm Counter Settings. Enter an Arm Counter Address Range with the title of "loop", with a range of "Loop" to "Loop" and click on Add. The address range just entered, "loop," will appear in the box on the lower left, click on it to select it, and click on Enable Selected Item to enable it. Make sure that in the Assign Arm Bit box, "To Break Logic" is selected: · Click on OK to close the window. Note that an ".A." has been placed to the left of the line labeled "loop" to indicate that the counter is armed). Step 6: Once again open the Setup/Trace Settings. Select "loop" in the box in the lower left of the window and click on Enable Selected Item to enable tracing of its range. DS33015B DS33015B - page 26 © 1994 Microchip Technology Inc. Chapter 4. Using Trace Functions © 1994 Microchip Technology Inc. DS33015B DS33015B - page 27 PICDEM-1 USER'S GUIDE DS33015B DS33015B - page 28 © 1994 Microchip Technology Inc. PICDEM-1 USER'S GUIDE Chapter 5. Demonstration Program for the PIC16C71 PIC16C71 Introduction This chapter provides a detailed description of the demonstration program for the PIC16C71 PIC16C71, demo71.asm. The program is a simple implementation of the PIC16C71 PIC16C71's analog-to-digital converter. The program reads A/D channel 0 and displays the results on the LEDs connected to Port B. If the potentiometer is turned all the way clockwise, all the LEDs are off, and if the potentiometer is turned all the way counterclockwise, all the LEDs are turned on. PIC16C71 PIC16C71 Demonstration Program © 1994 Microchip Technology Inc. DS33015B DS33015B - page 29 PICDEM-1 USER'S GUIDE The program starts out by defining three constants: TEMP, a general purpose file register; ADIF, the bit location (1) of the A/D interrupt flag in ADCON0; and ADGO, the A/D GO/DONE bit in ADCON0. The next sections of code define the reset and interrupt vectors: TEMP ADIF ADGO ; equ equ equ org goto 10h 1 2 ;A/D interrupt flag ;A/D enable bit 0x00 Start ;reset vector ; org 0x04 goto Service_int ;interrupt vector ;TITLE "Single channel A/D (SAD)" ;This program is a simple implementation of the PIC16C71 PIC16C71's ;A/D. One channel is used (CH0). ;The A/D is configured as follows: ; Vref = +5V internal. ; A/D Osc. = internal RC ; A/D Channel = CH0 ;Hardware for this program is the PICDEMO board. The program ;converts the potentiometer value on CH0 and displays it as ;a 8 bit binary value on PORTB. ; ; LIST P=16C71 16C71, F=INHX8M ; include "\picdem1\picdem1.equ" ; TEMP equ 10h ADIF equ 1 ;A/D interrupt flag ADGO equ 2 ;A/D enable bit ; org 0x00 goto Start ;reset vector ; org 0x04 goto Service_int ;interrupt vector ; ; org 0x10 Start movlw B'00000000' ;set port b as movwf PORT_B ;all outputs tris PORT_B ; / ; call InitializeAD Update movf ADRES,W ;get a/d value movwf PORT_B ;output to port b call SetupDelay ;setup time >= 10uS. bcf ADCON0,ADIF ;clear int flag DS33015B DS33015B - page 30 © 1994 Microchip Technology Inc. Chapter 5. Demonstration Program for the PIC16C71 PIC16C71 bsf ADCON0,ADGO ;start new conversion btfsc goto goto ADCON0,ADIF Update Loop ;a/d done? ;yes then update new value. ;no then keep checking Loop ; ;No interrupts are enabled, so if the program ever reaches here, ;it will be returned with the global interrupts disabled. Service_int return ;do not enable global. ; ; ; ;Initializes and sets up the A/D hardware. ;Select ch0 to ch3 as analog inputs, fosc/2 and read ch0. ; InitializeAD bsf STATUS,5 ;select pg1 movlw B'00000000' ;select ch0-ch3. movwf ADCON1 ;as analog inputs bcf STATUS,5 ;select pg0 movlw B'11000001' ;select:RC,ch0. movwf ADCON0 ;turn on A/D. clrf ADRES ;clr result reg. return ; ;This routine is a software delay of 10uS for the a/d setup. ;At 4Mhz clock, the loop takes 2uS, so initialize TEMP with ;a value of 9 to give 18uS, plus the move etc should result ;in a total time of > 20uS. SetupDelay movlw movwf SD decfsz goto return .9 TEMP TEMP SD END demo71.asm © 1994 Microchip Technology Inc. DS33015B DS33015B - page 31 PICDEM-1 USER'S GUIDE The actual program begins at Start, where Port B is defined as all outputs by writing 0's to the Port B tristate register TRISB. Note that 0's were written to the Port B register prior to setting the port to outputs so that the Port would initialize with all outputs in the low state: Start movlw movwf tris B'00000000' PORT_B PORT_B ;set port b as ;all outputs ; / ; call InitializeAD After initializing Port B, InitializeAD is called. The page register is set for page 1, RA0 through RA3 are selected to be analog inputs, and Vref is selected to be VDD (if all four pins are selected to be analog inputs, Vref is set to VDD by default) by writing to ADCON1. The page register is then reset for page 0, the internal RC oscillator is selected for the conversion clock, and ADON, the A/D on/off bit is set so that the A/D converter module is operating. The last action this routine takes before returning is to clear the A/D result register: InitializeAD bsf movlw movwf bcf movlw movwf clrf return STATUS,5 B'00000000' ADCON1 STATUS,5 B'11000001' ADCON0 ADRES ;select pg1 ;select ch0-ch3. ;as analog inputs ;select pg0 ;select:RC,ch0. ;turn on A/D. ;clr result reg. The Update routine reads the A/D result register, writes the value it got to the LEDs connected to PORTB, calls SetupDelay, clears the interrupt flag and enables the next conversion. Update movf movwf call bcf bsf DS33015B DS33015B - page 32 ADRES,W PORT_B SetupDelay ADCON0,ADIF ADCON0,ADGO ;get a/d value ;output to port b ;setup time >= 20uS. ;clear int flag ;start new conversion © 1994 Microchip Technology Inc. Chapter 5. Demonstration Program for the PIC16C71 PIC16C71 The SetupDelay routine provides a software delay so that the sample and hold circuit has enough time to settle before the A/D conversion is started. The SD loop takes 2uS when TEMP is not equal to zero, so a value of nine loaded into TEMP would provide a delay of 18uS. With the 2uS execution time of the two moves before the SD loop and the call and return execution times, a delay of greater than 20uS is provided for settling: SetupDelay movlw movwf SD decfsz goto return 9 TEMP TEMP SD The Loop routine tests the A/D interrupt flag, and loops until it indicates that the conversion has finished (ADIF = 0). When the conversion has finished, it jumps back to Loop so that the A/D value can be read and output to the LEDs: Loop btfsc goto goto © 1994 Microchip Technology Inc. ADCON0,ADIF Update Loop ;a/d done? ;yes then update new value. ;no then keep checking DS33015B DS33015B - page 33 PICDEM-1 USER'S GUIDE DS33015B DS33015B - page 34 © 1994 Microchip Technology Inc. PICDEM-1 USER'S GUIDE Chapter 6. Demonstration Program for the PIC16C84 PIC16C84 Introduction This chapter provides a detailed description of demonstration program for the PIC16C84 PIC16C84, demo84.asm. The program writes to each location in the data EEPROM, verifies each location and increments the binary value displayed on PORTB. If any location is not verified, all of the LEDs are continuously flashed at a 1Hz rate. PIC16C84 PIC16C84 Demonstration Program © 1994 Microchip Technology Inc. DS33015B DS33015B - page 35 PICDEM-1 USER'S GUIDE The program starts out by defining three constants; TIME, a counter used in the flashing of the LEDs, GPFLAG, a general purpose flag register, and EEPERROR, a bit used to pass the error status of the EEPROM check. The next sections of code define the reset and interrupt vectors: TIME GPFLAG EEPERROR ; equ equ equ 0x10 0x20 0 org goto 0 Start org goto 4 ServiceRtcc ;Define flag register ;GPFLAG,0 ; ;This program demonstrates the PIC16C84 PIC16C84. DS33015B DS33015B - page 36 © 1994 Microchip Technology Inc. Chapter 6. Demonstration Program for the PIC16C84 PIC16C84 ;To demo the EEPROM capability of the PIC16C84 PIC16C84, then ;a value is incrementally written and verified in all ;64 locations of the EEPROM. If an error occurs at any location, ;then all LEDs on portb will blink at a 1 sec rate. list p=16c84,f=inhx8m ; include "\PICDEM\picdem1.equ ; TIME equ 0x10 GPFLAG equ 0x20 ;Define flag register EEPERROR equ 0 ;GPFLAG,0 ; org 0 goto Start ; org 4 goto ServiceRtcc ; org 10 Start clrf GPFLAG ;clr all flags movlw B'00000000' ;make port b outputs movwf PORT_B tris PORT_B ; Next call WriteAll ;write to all locations call CheckAll ;verify all locations btfsc GPFLAG,EEPERROR ;no error then skip goto BlinkLeds ;else blink leds. incf PORT_B ;inc value in port b goto Next ; WriteAll clrf EEADR ;start at addr = 0 incf PORT_B,W ;read current value+1 movwf EEDATA ;ld. data reg. bsf STATUS,RP0 ;select pg 1 bsf EECON1,WREN ;enable write operation bcf STATUS,RP0 ;select pg 0 WA1 call WriteOne ;write to a location incf EEADR ;inc address btfss EEADR,6 ;all 64 done? goto WA1 ;no then do next bsf STATUS,RP0 ;pg 1 bcf EECON1,WREN ;disable write bcf STATUS,RP0 ;pg 0 return ; © 1994 Microchip Technology Inc. DS33015B DS33015B - page 37 PICDEM-1 USER'S GUIDE WriteOne bsf movlw movwf movlw movwf bsf STATUS,RP0 0x55 EECON2 0xaa EECON2 EECON1,WR ;page 1 ;do write seq. ; ; ; ;initiate write btfsc goto bcf return EECON1,WR WO1 STATUS,RP0 ;write complete? ;no then keep checking ;pg 0 clrf incf EEADR PORT_B,W ;start at addr = 0 ;ld. data to inspect call btfsc return incf btfss goto return CheckOne ;check location GPFLAG,EEPERROR ;any error? ;yes then quit EEADR ;inc address EEADR,6 ;all 64 checked? CA1 ;no then do next bsf bsf STATUS,RP0 EECON1,RD ;pg 1 ;do a read btfsc goto bcf xorwf btfss bsf return EECON1,RD CO1 STATUS,RP0 EEDATA STATUS,Z GPFLAG,EEPERROR ;rd done? ;no then loop ;pg 0 ;compare? ;same then skip ;set error flag call clrf InitRtcc PORT_B ;turn off leds call comf goto SecondOver PORT_B BL1 ;wait for 1/2 second ;toggle leds movlw option clrf movlw movwf movlw movwf return B'10000111' ;rtcc inc = tcylc/256 ; ;start time ;enable interrupts ; ;initialize time WO1 ; CheckAll CA1 ; CheckOne CO1 ; BlinkLeds BL1 ; InitRtcc DS33015B DS33015B - page 38 RTCC B'10100000' INTCON .8 TIME © 1994 Microchip Technology Inc. Chapter 6. Demonstration Program for the PIC16C84 PIC16C84 ; ServiceRtcc btfsc decf clrf bsf retfie INTCON,RTIF TIME INTCON INTCON,RTIE ;rtcc interrupt? ;yes then dec time ;clr all interrupts ;enable RTIE ;not zero then return movf btfss goto movlw movwf return TIME,W STATUS,Z SecondOver .8 TIME ;check if time = 0 ; / ;no then loop ;load for 1/2 second ; SecondOver end demo84.asm The next section of code performs the initialization of GPFLAG and PORTB: Start clrf movlw movwf tris GPFLAG B'00000000' PORT_B PORT_B ;clr all flags ;make port b outputs ; / After the initialization is completed the program goes into a loop where all locations of the data EEPROM are written to and then read from for verification. If all locations verify correctly, the value displayed on the LEDs is incremented, if a mismatch between what was written and what is read is found, the LEDs are blinked at a one Hertz rate. Next call call btfsc goto incf goto © 1994 Microchip Technology Inc. WriteAll CheckAll GPFLAG,EEPERROR BlinkLeds PORT_B Next ;write to all locations ;verify all locations ;no error then skip ;else blink leds. ;inc value in port b DS33015B DS33015B - page 39 PICDEM-1 USER'S GUIDE WriteAll writes the value of what is displayed on the LEDs plus one to each location of the EEPROM. Notice that the write enable bit, WREN, in the EEPROM control register, EECON1 is set for the entire duration and does not have to be re-enabled for each byte. WriteAll clrf incf movwf bsf bsf bcf EEADR PORT_B,W EEDATA STATUS,RP0 EECON1,WREN STATUS,RP0 ;start at addr = 0 ;read current value+1 ;ld. data reg. ;select pg 1 ;enable write operation ;select pg 0 call incf btfss goto bsf bcf bcf return WriteOne EEADR EEADR,6 WA1 STATUS,RP0 EECON1,WREN STATUS,RP0 ;write to a location ;inc address ;all 64 done? ;no then do next ;pg 1 ;disable write ;pg 0 WA1 ; Note: The timing in Write One is critical. Do not single step or do a software trace through this routine. WriteOne is where the actual writing of the EEPROM takes place. EEPROM writes will not initiate if the proper sequence (write 55h to EECON2, write AAh to EECON2, then set the WR bit) is not followed with exact timing. In order to ensure this, interrupts have not been enabled. After the writing of the data, and initiating the write sequence, the loop, W01, waits for the WR bit to go low indicating that the write has completed. WriteOne bsf movlw movwf movlw movwf bsf STATUS,RP0 0x55 EECON2 0xaa EECON2 EECON1,WR ;page 1 ;do write seq. ; / ; / ; / ;initiate write btfsc goto bcf return EECON1,WR WO1 STATUS,RP0 ;write complete? ;no then keep checking ;pg 0 WO1 Refer to PIC16C84 PIC16C84 Data Sheet for EEPROM programming requirements. DS33015B DS33015B - page 40 © 1994 Microchip Technology Inc. Chapter 6. Demonstration Program for the PIC16C84 PIC16C84 CheckAll reads each location of the EEPROM and verifies that it matches the value displayed on the LEDs plus one. If the value does not match, bit EEPERROR of file register GPFLAG will be set and the routine will return without verifying the other locations. CheckAll clrf incf EEADR PORT_B,W ;start at addr = 0 ;ld. data to inspect call btfsc return incf btfss goto return CheckOne ;check location GPFLAG,EEPERROR ;any error? ;yes then quit EEADR ;inc address EEADR,6 ;all 64 checked? CA1 ;no then do next CA1 CheckOne does the actual reading of the EEPROM byte and verifying that it is correct. Although it is not necessary to check any flag bits during EEPROM reads, they can be done immediately after setting the address in EEADR and setting the read control bit (RD EECON1), the RD bit will be cleared by the hardware when the data has been placed in the EEDATA register. If there is a verification error, the EEPERROR bit is set in the GPFLAG register. CheckOne bsf bsf STATUS,RP0 EECON1,RD ;pg 1 ;do a read btfsc goto bcf xorwf btfss bsf return EECON1,RD CO1 STATUS,RP0 EEDATA STATUS,Z GPFLAG,EEPERROR ;rd done? ;no then loop ;pg 0 ;compare? ;same then skip ;set error flag CO1 BlinkLeds sets up the RTCC to interrupt upon time-out, turns off the LEDs, and when one second has expired, toggles the LEDs. BlinkLeds call clrf BL1 call comf goto © 1994 Microchip Technology Inc. InitRtcc PORT_B SecondOver PORT_B BL1 ;turn off leds ;wait for 1/2 second ;toggle leds DS33015B DS33015B - page 41 PICDEM-1 USER'S GUIDE InitRtcc assigns the prescaler to the RTCC and sets it for divide by 256. It then enables interrupts and initializes the TIME register to eight. InitRtcc movlw B'10000111' option clrf RTCC movlw B'10100000' movwf INTCON movlw .8 movwf TIME return ;rtcc inc = tcylc/256 ; / ;start time ;enable interrupts ; / ;initialize time ServiceRtcc is the interrupt service routine and will be called each time the RTCC times out. It first verifies that the interrupt was caused by the RTCC and if it was it decrements TIME. Whether it was an RTCC interrupt or not, all interrupts are cleared and the RTCC interrupt is enabled before returning. ServiceRtcc btfsc decf clrf bsf retfie INTCON,RTIF TIME INTCON INTCON,RTIE ;rtcc interrupt? ;yes then dec time ;clr all interrupts ;enable RTIE ;not zero then return SecondOver waits for the TIME register to reach zero, restores a count of eight in it, and returns. SecondOver movf btfss goto movlw movwf return DS33015B DS33015B - page 42 TIME,W STATUS,Z SecondOver .8 TIME ;check if time = 0 ; / ;no then loop ;load for 1/2 second © 1994 Microchip Technology Inc. PICDEM-1 USER'S GUIDE Chapter 7. Demonstration Program for the PIC17C42 PIC17C42 Introduction This chapter provides a detailed description of demonstration program for the PIC17C42 PIC17C42, demo42.asm. PIC17C42 PIC17C42 Demonstration Program The program waits for S1 to be pressed, increments a counter, and transmits it through the serial port. The RX and TX lines of the serial port must be shorted at the DB9 connector (pins 2 and 3). The value received from the serial port is displayed on the LEDs. The program begins by defining the reset, RTCC interrupt, and peripheral interrupt vectors. Note that if for some reason the RTCC interrupt got enabled and the program reached Rtcc_int, the program would return with the interrupts enabled. The main program routine clears RAM from 20h to 0FFh, calls routines to initialize the ports and the Serial I/O, and loops while waiting for a keypress. When a keypress is detected, the main program calls the Xmit routine: org goto 0 Start org 0x0010 ; ;vector for rtcc interrupt Rtcc_int retfie ;return with ints enabled ; org 0x0020 ;vector for peripheral interrupt goto Service_perf ;service the interrupts org 0x0030 movlw movfp 0x20 wreg,fsr0 ;start main program ;clear ram space ;use indirect addressing clrf incfsz goto call call indf0 fsr0 Start1 Init_ports Init_serial ;clear ram ;from 0x20 to 0xff ; / ;initialize all ports ;initialize serial port movpf btfss call goto porta,TEMP TEMP,1 Xmit Loop ;get porta ;check for key press ;send next value ;check again Perf_int ; ; Start Start1 Loop © 1994 Microchip Technology Inc. DS33015B DS33015B - page 43 PICDEM-1 USER'S GUIDE DS33015B DS33015B - page 44 © 1994 Microchip Technology Inc. Chapter 7. Demonstration Program for the PIC17C42 PIC17C42 ; TITLE Demo board software. ;PORTB of the PIC17C42 PIC17C42 is connected to the 8 leds and ;a switch (S1) is connected to the RTCC input. The software waits for ;S1 to be pressed at which point a counter is incremented ;an its value is transmitted through the serial port. The RX ;and TX lines (pins 2 and 3) must be shorted at the DB9 Connector so that ;the transmitted value is sent right back to the receive buffer. ;The receive interrupt is generated and the value in the ;receive buffer is displayed as a 8 bit value on port B. ;The net result is that every time S1 is pressed the LEDs will ;increment in a binary count. list p=17c42,f=inhx8m ; COUNT TEMP ; ; equ equ 0x20 0x19 NOLIST #include "\picdem\picdem1.equ LIST ; ; org 0 goto Start ; org 0x0010 Rtcc_int retfie ; org 0x0020 interrupt Perf_int goto Service_perf ; org 0x0030 ; Start movlw 0x20 movfp wreg,fsr0 Start1 clrf indf0 incfsz fsr0 goto Start1 call Init_ports call Init_serial Loop movpf porta,TEMP btfss TEMP,1 call Xmit goto Loop ; © 1994 Microchip Technology Inc. ;Temporary storage location ;vector for rtcc interrupt ;return with ints enabled ;vector for peripheral ;service the interrupts ;start main program ;clear ram space ;use indirect addressing ;clear ram ;from 0x20 to 0xff ; / ;initialize all ports ;initialize serial port ;get porta ;check for key press ;send next value ;check again DS33015B DS33015B - page 45 PICDEM-1 USER'S GUIDE ; Init_ports movlb clrf clrf return 0 ddrb portb ;select bank 0 ;port b all optics ;and all low. ; ;This routine initializes the serial port. Baud rate, receive ;interrupt software flags are initialized. ; Init_serial movlb 0 ;select bank 0 movlw 25 ;select 9600 baud movfp wreg,spbrg ; / movlw 0x90 ;set up serial pins movfp wreg,rcsta ; / clrf txsta ;setup transmit status movlb 1 ;select bank 1 clrf pir ;clear all interrupts clrf pie ;clear all enables bsf _rcie ;enable receive interrupt movlb 0 ;select bank 0 bsf _txen ;enable transmit bsf _peie ;enable peripheral ints retfie ; ;This routine handles all the peripheral interrupts. In this ;example only the receive interrupt is handled. ; Service_perf ;check for receive interrupts only bcf _peie ;disable perf int movlb 1 ;bank 1 btfsc _rbfl ;RX buffer full? call Service_recv ;yes then service Exit_perf bsf _peie ;enable peripheral int retfie ; ;This routine services the serially received info. Service_recv movlb movfp movwf 0 rcreg,wreg portb ;load received value clrf bsf return intsta _rcie ;clear all int ;enable receive incf movlb movfp COUNT 0 COUNT,txreg End_recv ; ; Xmit DS33015B DS33015B - page 46 © 1994 Microchip Technology Inc. Chapter 7. Demonstration Program for the PIC17C42 PIC17C42 Debounce movpf btfss goto return porta,TEMP TEMP,1 Debounce ; ;Wait for key release ; END The routine Init_ports sets all pins of PORTB to be outputs and sets them to the low state (LEDs) off: Init_ports movlb clrf clrf return 0 ddrb portb ;select bank 0 ;port b all ouptuts ;and all low. Init_serial initializes the USART. The baud rate is set to 9600 for both transmit and receive, the receiver is enabled in an asynchronous continuous reception mode with 8 bit words. The transmitter is enabled in an asynchronous, 8 bit mode. Init_serial movlb movlw movfp movlw movfp clrf movlb clrf clrf bsf movlb bsf bsf retfie © 1994 Microchip Technology Inc. 0 25 wreg,spbrg 0x90 wreg,rcsta txsta 1 pir pie _rcie 0 _txen _peie ;select bank 0 ;select 9600 baud ; / ;set up serial pins ; / ;setup transmit status ;select bank 1 ;clear all interrupts ;clear all enables ;enable receive interrupt ;select bank 0 ;enable transmit ;enable peripheral ints DS33015B DS33015B - page 47 PICDEM-1 USER'S GUIDE The Service_perf routine services any interrupts received. The routine first disables all peripheral interrupts, it then checks the receive buffer for data. If the receive buffer flag is set, the data is displayed on the LEDs by the Service_recv routine. In either case the peripheral interrupts are re-enabled and the routine exited. Service_perf ;check for receive interrupts only bcf _peie ;disable perf int movlb 1 ;bank 1 btfsc _rbfl ;RX buffer full? call Service_recv ;yes then service Exit_perf bsf _peie ;enable peripheral int retfie Service_recv movlb 0 movfp rcreg,wreg ;load received value movwf portb End_recv clrf intsta ;clear all int bsf _rcie ;enable receive return DS33015B DS33015B - page 48 © 1994 Microchip Technology Inc. Chapter 7. Demonstration Program for the PIC17C42 PIC17C42 The Xmit routine increments file register COUNT and outputs it to the serial port. It then waits for the key to be released before returning. Xmit Increment Count Transmit Count Key Released? No Yes Return © 1994 Microchip Technology Inc. DS33015B DS33015B - page 49 PICDEM-1 USER'S GUIDE DS33015B DS33015B - page 50 © 1994 Microchip Technology Inc. WORLDWIDE SALES & SERVICE AMERICAS AMERICAS (continued) EUROPE Corporate Office Microchip Technology Inc. 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 602 786-7200 Fax: 602 786-7277 Technical Support: 602 786-7627 Web: http://www.mchip.com/microhip Atlanta Microchip Technology Inc. 500 Sugar Mill Road, Suite 200B Atlanta, GA 30350 Tel: 770 640-0034 Fax: 770 640-0307 Boston Microchip Technology Inc. 5 Mount Royal Avenue Marlborough, MA 01752 Tel: 508 480-9990 Fax: 508 480-8575 Chicago Microchip Technology Inc. 333 Pierce Road, Suite 180 Itasca, IL 60143 Tel: 708 285-0071 Fax: 708 285-0075 Dallas Microchip Technology Inc. 14651 Dallas Parkway, Suite 816 Dallas, TX 75240-8809 Tel: 214 991-7177 Fax: 214 991-8588 Dayton Microchip Technology Inc. 35 Rockridge Road Englewood, OH 45322 Tel: 513 832-2543 Fax: 513 832-2841 Los Angeles Microchip Technology Inc. 18201 Von Karman, Suite 455 Irvine, CA 92715 Tel: 714 263-1888 Fax: 714 263-1338 New York Microchip Technology Inc. 150 Motor Parkway, Suite 416 Hauppauge, NY 11788 Tel: 516 273-5305 Fax: 516 273-5335 San Jose Microchip Technology Inc. 2107 North First Street, Suite 590 San Jose, CA 95131 Tel: 408 436-7950 Fax: 408 436-7955 United Kingdom Arizona Microchip Technology Ltd. Unit 6, The Courtyard Meadow Bank, Furlong Road Bourne End, Buckinghamshire SL8 5AJ Tel: 44 0 1628 851077 Fax: 44 0 1628 850259 France Arizona Microchip Technology SARL 2 Rue du Buisson aux Fraises 91300 Massy - France Tel: 33 1 69 53 63 20 Fax: 33 1 69 30 90 79 Germany Arizona Microchip Technology GmbH Gustav-Heinemann-Ring 125 D-81739 D-81739 Muenchen, Germany Tel: 49 89 627 144 0 Fax: 49 89 627 144 44 Italy Arizona Microchip Technology SRL Centro Direzionale Colleoni Palazzo Pegaso Ingresso No. 2 Via Paracelso 23, 20041 Agrate Brianza (MI) Italy Tel: 39 039 689 9939 Fax: 39 039 689 9883 ASIA/PACIFIC Hong Kong Microchip Technology Unit No. 3002-3004, Tower 1 Metroplaza 223 Hing Fong Road Kwai Fong, N.T. Hong Kong Tel: 852 2 401 1200 Fax: 852 2 401 3431 Korea Microchip Technology 168-1, Youngbo Bldg. 3 Floor Samsung-Dong, Kangnam-Ku, Seoul, Korea Tel: 82 2 554 7200 Fax: 82 2 558 5934 Singapore Microchip Technology 200 Middle Road #10-03 Prime Centre Singapore 188980 Tel: 65 334 8870 Fax: 65 334 8850 Taiwan Microchip Technology 10F-1C 10F-1C 207 Tung Hua North Road Taipei, Taiwan, ROC Tel: 886 2 717 7175 Fax: 886 2 545 0139 JAPAN Microchip Technology Intl. Inc. Benex S-1 6F 3-18-20, Shin Yokohama Kohoku-Ku, Yokohama Kanagawa 222 Japan Tel: 81 45 471 6166 Fax: 81 45 471 6122 9/22/95 All rights reserved. © 1995, Microchip Technology Incorporated, USA. Information contained in this publication regarding device applications and the like is intended through suggestion only and may be superseded by updates. No representation or warranty is given and no liability is assumed by Microchip Technology Incorporated with respect to the accuracy or use of such information, or infringement of patents or other intellectual property rights arising from such use or otherwise. Use of Microchip's products as critical components in life support systems is not authorized except with express written approval by Microchip. No licenses are conveyed, implicitly or otherwise, under any intellectual property rights. The Microchip logo and name are registered trademarks of Microchip Technology Inc. All rights reserved. All other trademarks mentioned herein are the property of their respective companies.