Philips SemiconductorsApplication noteIn-system programming of the P87LPC76x family ofmicrocontrollersAN466INTRODUCTIONThe P87LPC76x microcontroller family is programmed serially,•The handling, which can damage the device is eliminated.which allows you to do in-system programming. For example,•Software can be used to differentiate between products whichaddress and data used to program the device are sent in a serialshare a common hardware design.format on two-wires. Device configuration is done via this sameinterface. This application note discusses how to use the serialThe basic approach is simple. As shown in Figure 1, a standardprogramming while mounted in the end product.commercial programmer is connected to the system board via a5 wire cable. One end of the cable has a header, which fits into theprogrammer’s ZIF socket while the other end plugs into the circuitIN SYSTEM PROGRAMMINGboard. Connection to the device pins are shown below. In thisSince only 5 pins are required to program members of the LPCexample, the application is isolated from the device duringfamily, it is practical to design an interface that allows a member ofprogramming. If the application cannot be isolated, then thethe P87LPC76x family to be programmed after it is soldered in theprogrammer must be able to drive the impedance created by thefinal product. Programming a device after it is soldered on a circuitapplication and the device to be programmed. If the programmerboard has many advantages including:cannot drive the circuit to the voltage levels within the time required•by the device being programmed, the programmer output will requireThe latest software revision can be loaded into the product justbuffering. Care needs to be taken to make sure that the applicationprior to shipment.is not damaged during the programming.•The 32 byte customer data area of the EPROM on the LPC canbe programmed to have unique serial numbers or calibration data,etc.PROGRAMMERVDDappJumpersVVDDprogDDVVpppp87LPC76xP0.4P0.4P0.5P0.5VSSVSSProgrammerHeaderApplicationSocketApplication BoardVSSSU01365Figure 1. Programmer ConnectionThe signals that connect the programmer to the board are given in Table 1 .2001 Aug 072Philips SemiconductorsApplication noteIn-system programming of the P87LPC76x family ofAN466microcontrollersTable 1.Programmer ConnectionsFunctionPin NumberBreak NormalConnection?20 pin pkgs16 pin pkgs14 pin pkgsVSS543NoP1.5 / RST / VPP432Yes1,3P0.4 / Alt Function(s) / Programming Data / Programming171413Yes1AddressP0.5/Alt Function(s)/Programming Clock161312Yes1VDD151211Yes2NOTES:1.The connections do not have to be broken when the programmer can drive the part and application to a “1” or “0” while programming andwhen the part can drive the application to “1” or “0” when the program is verified by the programmer, but this is not recommended.2.The connection to VDD does not have to be broken when the programmer and application-board have the same VDD.3.VPP is 10.75 V. If this pin is not isolated from the application, the application must be able to withstand this voltage.Note: The alternative functions on P0.4 and P0.5 vary between different members of the P87LPC76x family.A few precautions need to be taken when designing a board that allows a member of the 87LPC76x family to be programmed once it issoldered in place.SIGNATURE BYTESEach member of the P87LPC76x contains three signature bytes that can be read and used by the programming system to identify the devicebeing programmed. The code contained in the signature bytes for the devices in the family are shown in Table 2.Table 2.Signature BytesDeviceAddressAddressAddressProgramFC30 hFC31 hFC60 hMemoryP87LPC76015 hDD h07 h1 kbyteP87LPC76115 hDD h06 h2 kbytesP87LPC76215 hDD h03 h2 kbytesP87LPC76415 hDD h00 h4 kbytesP87LPC76715 hDD h01 h4 kbytesP87LPC76815 hDD h04 h4 kbytesP87LPC76915 hDD h02 h4 kbytesThe signature byte codes for future members of the family will bedevice. These locations can be programmed at the same time as theincluded in the data sheets for each device as it is introduced. Therest of program memory and configuration bytes.signature bytes may be read by the user program by placing theaddress indicated above in the DPTR and using a MOVCSystem Configuration Bytesinstruction.A number of user configurable features of the P87LPC76x familyCustomer Data Areamust be defined before power is applied to the device. As a resultthey cannot be set by the user’s program. These functions areInside the EPROM there are 32 bytes reserved for fixed data. Thisenabled by programming UCFG1 located at FD00 h and UCFG2block starts at address FCE0 h and ends at FCFF h. Since this datalocated at FD01 h. These bytes can be programmed at the sameexists in the code memory space, it can be accessed by placing thetime as the rest of the memory. A MOVX instruction can be used todesired address in the DPTR and using the MOVC instruction.read these locations. The control register formats are shown in theTypical contents of these locations might include code revisionfollowing two figures.identification, checksum storage, or a unique serial number for each2001 Aug 073Philips SemiconductorsApplication noteIn-system programming of the P87LPC76x family ofAN466microcontrollersTable 3.User Configuration Register 1UCFG1 ADDRESS FD00 H UNPROGRAMMED VALUE FF H76543210WDTERPDPRHIBOVCLKRFOSC2FOSC1FOSC0BITSYMBOLFUNCTIONUCFG1.7WDTEWatchdog Timer Enable. When “1” watchdog is enabled;. A “0” disables watchdog, however the timermay still be used to generate an interrupt.UCFG1.6RPDReset Pin Disable. A “1” disables the reset function on pin P1.5 allowing its use as an input only pin. A“0” enables the reset function on pin P1.5.UCFG1.5PRHIPort Reset High. When “1” a reset causes ports to be initialized high, when “0” reset causes the portsto be initialized low.UCFG1.4BOVBrownout Voltage Select. When “1”, the brownout detect voltage is 2.5 V, when “0” it is 3.8 V.UCFG1.3CLKRClock Rate Select. When “0” the processor operates with the standard 80C51 12 clock cycles permachine cycle, when “1” there are 6 clock cycles per machine cycle.UCFG1.2–UCFOSC2–0CPU oscillator type select. Combinations other than those shown below should not be used.FG1.01 1 1External clock input on X1. (Default on unprogrammed device)0 1 1Internal RC Oscillator, 6 Mhz (see datasheet for tolerance)0 1 0Low frequency crystal or resonator, 20 kHz to 100 kHz.0 0 1Medium frequency crystal or resonator, 100 kHz to 4 MHz.0 0 0High frequency crystal or resonator, 4 Mhz to 20 MHz.Table 4.User Configuration Register 2UCFG2 ADDRESS FD01 H UNPROGRAMMED VALUE FF H76543210SB2SB1ReservedReservedReservedReservedReservedReservedBITSYMBOLFUNCTIONUCFG2.7–SB2–1Security Bits 2–1. Function described below.UCFG2.61 1No security features enabled. EPROM can be programmed and verified.1 0Further EPROM programming disabled; verify enabled.0 1This combination is not supported.0 0All EPROM verification and programming disabled.2001 Aug 074Philips SemiconductorsApplication note
In-system programming of the P87LPC76x family ofmicrocontrollersAN466
Definitions
Short-form specification — The data in a short-form specification is extracted from a full data sheet with the same type number and title. Fordetailed information see the relevant data sheet or data handbook.
Limiting values definition — Limiting values given are in accordance with the Absolute Maximum Rating System (IEC 134). Stress above oneor more of the limiting values may cause permanent damage to the device. These are stress ratings only and operation of the device at these orat any other conditions above those given in the Characteristics sections of the specification is not implied. Exposure to limiting values for extendedperiods may affect device reliability.
Application information — Applications that are described herein for any of these products are for illustrative purposes only. PhilipsSemiconductors make no representation or warranty that such applications will be suitable for the specified use without further testing ormodification.
Disclaimers
Life support — These products are not designed for use in life support appliances, devices or systems where malfunction of these products canreasonably be expected to result in personal injury. Philips Semiconductors customers using or selling these products for use in such applicationsdo so at their own risk and agree to fully indemnify Philips Semiconductors for any damages resulting from such application.
Right to make changes — Philips Semiconductors reserves the right to make changes, without notice, in the products, including circuits, standardcells, and/or software, described or contained herein in order to improve design and/or performance. Philips Semiconductors assumes noresponsibility or liability for the use of any of these products, conveys no license or title under any patent, copyright, or mask work right to theseproducts, and makes no representations or warranties that these products are free from patent, copyright, or mask work right infringement, unlessotherwise specified.
Philips Semiconductors811 East Arques AvenueP.O. Box 3409
Sunnyvale, California 94088–3409Telephone 800-234-7381
© Copyright Philips Electronics North America Corporation 2001
All rights reserved. Printed in U.S.A.
Date of release: 08-01
Document order number:9397 750 08666PhilipsSemiconductors2001 Aug 075