Section 30. In-Circuit Serial Programming (ICSP )

Similar documents
How to Implement ICSP Using PIC16CXXX OTP MCUs VDD. MCLR/VPP ICSP Connector. To application circuit Isolation circuits

Section 11. Timer0. Timer0 HIGHLIGHTS. This section of the manual contains the following major topics:

Rapid40i PIC Prototyping PCB User Manual

HAND HELD PROGRAMMER QUICK START GUIDE

Section 28. WDT and SLEEP Mode

PIC PORTABLE PROGRAMMER QUICK START GUIDE

PIC Microcontroller Introduction

Section 13. Timer0 HIGHLIGHTS. Timer0. This section of the manual contains the following major topics:

Rapid40iXL PIC Prototyping PCB User Manual

SX Device In-System Programming Specifications

Section 14. Timer1 HIGHLIGHTS. Timer1. This section of the manual contains the following major topics:

C and Embedded Systems. So Why Learn Assembly Language? C Compilation. PICC Lite C Compiler. PICC Lite C Optimization Results (Lab #13)

Rapid28iXL PIC Prototyping PCB User Manual

AN910. PICmicro Device Programming: What You Always Wanted to Know (But Didn t Know Who to Ask) THE BASICS INTRODUCTION. Microchip Technology Inc.

SBC65EC. Ethernet enabled Single Board Computer

MPLAB -ICD USER S GUIDE

Section 29. Device Configuration Bits

Display Real Time Clock (RTC) On LCD. Version 1.2. Aug Cytron Technologies Sdn. Bhd.

PIC 16F84A programming (II)

PIC16F87X. 28/40-pin 8-Bit CMOS FLASH Microcontrollers. Devices Included in this Data Sheet: Pin Diagram PDIP. Microcontroller Core Features:

Modtronix Engineering Modular Electronic Solutions SBC28DC. Single board computer for 28 pin DIP PICs

HI-TIDE Release Notes for Version 3.13

SBC44EC. Single board computer for 44 pin PLCC PICs

Appendix B. Following is a list of topics in this section:

CHAPTER 6 CONCLUSION AND SCOPE FOR FUTURE WORK

Reprinted by permission of T&L Publications Inc. Copyright 2001 USB MICROCONTROLLERS FOR THE MASSES

Lecture (03) PIC16F84 (2)

Lecture (04) PIC 16F84A programming I

ME 515 Mechatronics. A microprocessor

Revision: 5/7/ E Main Suite D Pullman, WA (509) Voice and Fax. Power jack 5-9VDC. Serial Port. Parallel Port

Capacitive Touch Remote Control Reference Design User s Guide

Digilab 2E Reference Manual

Lesson 14. Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27)

Figure 1.1: Some embedded device. In this course we shall learn microcontroller and FPGA based embedded system.

Section 24. Comparator

Digilab 2 Reference Manual

Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their

Application Note. EMC Design Guide. F 2 MC-8L Family. History 04 th Jul 02 NFL V1.0 new version

eip-24/100 Embedded TCP/IP 10/100-BaseT Network Module Features Description Applications

NuSpeech Family N5132 High Sound Quality Voice Synthesizer Technical Reference Manual

The FED PIC Flex 2 Development Boards

SBC45EC. Single board computer for 44 pin PLCC PICs

Digilab 2 XL Reference Manual

Embedded System Design

Breeze Board. Type A. User Manual.

SH69P21 EVB. Application Note for SH69P21 EVB SH69P21 EVB SH69P21

PIC16C52. EPROM-Based 8-Bit CMOS Microcontroller PIC16C52. Pin Diagrams. Feature Highlights. High-Performance RISC CPU. Peripheral Features

KPIC-0818P (V050919) Devices Included in this Data sheet: KPIC-0818P

NH-67, TRICHY MAIN ROAD, PULIYUR, C.F , KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL

SH69P48A EVB. Application Notes for SH69P48A EVB SH69V48A JP2 J4(ICE_J4) S1 IDD TEST JP1 74HC273 JP4 JP3 74HC273 JP6 STKOVE JP7 SW1 J5(ICE_J5)

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet... 4

Wall Industries SMPS and Microcontrollers

HAND-HELD THERMOCOUPLE THERMOMETER SERVICE MANUAL. CATALOG NUMBERS , and , and PROPRIETARY

RFID: Read and Display V2010. Version 1.1. Sept Cytron Technologies Sdn. Bhd.

TWR98/99. ISP Programming. Application Note. Tenx reserves the right to change or discontinue this product without notice. tenx technology inc.

Discrete Logic Replacement A Keypad Controller for Bi-directional Key Matrix

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet Example Application...

The amount of current drawn and the temperature generated by DC motor are crucial in understanding the performance and reliability of motors.

Programming for PIC18FXX2/FXX8 FLASH MCUs PIN DESCRIPTIONS (DURING PROGRAMMING): PIC18FXX2/XX8. During Programming. Pin Name Pin Type Pin Description

Doc: page 1 of 9

MCP2120/MCP2150 DEVELOPER S KIT USER S GUIDE

DERTS Design Requirements (1): Microcontroller Architecture & Programming

DEVBOARD3 DATASHEET. 10Mbits Ethernet & SD card Development Board PIC18F67J60 MICROCHIP

Mechatronics and Measurement. Lecturer:Dung-An Wang Lecture 6

2 AA Cell to 3.3V USB On-The-Go Devices White LED Drivers Handheld Devices. The HM3200B is available in the 6-pin SOT23-6.

DEMO9S08SH32/SG32 Demonstration Board for Freescale MC9S08SH32/SG32

PICmicro Microcontroller Lite programmer datasheet

PICado Alpha Development Board V1.0

CEIBO FE-5111 Development System

Section 16. Basic Sychronous Serial Port (BSSP)

CYTRON USB PIC Programmer v2009 UP00B

TECHNICAL NOTE. VS1000: Evaluation Kit EVBA_2.0. Contents. EVBA_2.0 is a plug and play Evaluation Kit for Colibrys VS1000 accelerometers line.

EE6008-Microcontroller Based System Design Department Of EEE/ DCE

eip-10 Embedded TCP/IP 10-BaseT Network Module Features Description Applications

CMS-8GP32. A Motorola MC68HC908GP32 Microcontroller Board. xiom anufacturing

DS1070K EconOscillator Programming Kit

APPLICATION NOTE Wire Communication with a Microchip PICmicro Microcontroller

which means that writing to a port implies that the port pins are first read, then this value is modified and then written to the port data latch.

1. ONCE Module 2. EBDI. Application Note. AN2327/D Rev. 0, 9/2002. M Core EBDI Interface Application Note

ECE 354 Introduction to Lab 2. February 23 rd, 2003

NeoLoch. Inquisitor Static RAM 1 Blade V3 Manual. Overview

FLASH Microcontroller Programming Specification PIN DESCRIPTIONS (DURING PROGRAMMING): PIC18FXX2/XX8. During Programming

AN ELNEC EN ISP-HC08. Application note for In-System Programming of Motorola/Freescale HC08 microcontrollers

SBR The Chameleon Converter II

Section 4. Architecture

Section 8. Reset. Reset HIGHLIGHTS. This section of the manual contains the following topics:

Flow Charts and Assembler Programs

FLASH Microcontroller Programming Specification PIN DESCRIPTIONS (DURING PROGRAMMING): PIC18FXX20. During Programming

Mercury System SB310

M68HC705L4 PROGRAMMER BOARD APPLICATION NOTE

OSC Ring Type Ring or Resonator type (optional) RESET Pin No Yes

DEMO9S08SH8/SG8 Demonstration Board for Freescale MC9S08SH8/SG8

This, plus your Basic Stamp 2 or Stamp Stack 2 Microcontroller (not included) will let you customize your robot s behavior any which way you want!

Embedded Systems. PIC16F84A Internal Architecture. Eng. Anis Nazer First Semester

ECE 354 Computer Systems Lab II. Interrupts, Strings, and Busses

CEIBO FE-W7 Development System

NeoLoch. Inquisitor 4116 DRAM Blade Manual. Overview. Preliminary Release

IMU Axis Gyro Evaluation Board Application Note

EMBEDDED SYSTEMS COURSE CURRICULUM

Section 8. Reset HIGHLIGHTS. Reset. This section of the manual contains the following major topics:

Transcription:

Section 30. In-Circuit Serial Programming (ICSP ) HIGHLIGHTS This section of the manual contains the following major topics: 30. Introduction... 30-2 30.2 Entering In-Circuit Serial Programming Mode... 30-3 30.3 Application Circuit... 30-4 30.4 Programmer... 30-6 30.5 Programming Environment... 30-6 30.6 Other Benefits... 30-7 30.7 Field Programming of PICmicro OTP MCUs... 30-8 30.8 Field Programming of FLASH PICmicro MCUs... 30-0 30.9 Design Tips... 30-2 30.0 Related Application Notes... 30-3 30. Revision History... 30-4 30 ICSP 2000 Microchip Technology Inc. DS3953A-page 30-

PIC8C Reference Manual 30. Introduction All Enhanced MCU devices can be In-Circuit Serial Programmed (ICSP ) while in the end application circuit. This is simply done with two lines for clock and data, and three other lines for power, ground and the programming voltage. In-Circuit Serial Programming (ICSP ) is a great way to reduce your inventory overhead and time-to-market for your product. By assembling your product with a blank Microchip microcontroller (MCU), you can stock one design. When an order has been placed, these units can be programmed with the latest revision of firmware, tested and shipped in a very short time. This method also reduces scrapped inventory due to old firmware revisions. This type of manufacturing system can also facilitate quick turnarounds on custom orders for your product. Most people would think to use ICSP with PICmicro OTP MCUs only on an assembly line where the device is programmed once. However, there is a method by which an OTP device can be programmed several times depending on the size of the firmware. This method, explained in Section 30.7, provides a way to field upgrade your firmware in a way similar to EEPROM- or FLASH-based devices. DS3953A-page 30-2 2000 Microchip Technology Inc.

Section 30. ICSP 30.2 Entering In-Circuit Serial Programming Mode The device is placed into a program/verify mode by holding the CLOCK (typically on the RB6 pin) and DATA (typically on the RB7 pin) pins low, while raising the MCLR (VPP) pinfromvil to VIHH (see programming specification) and having VDD at the programming voltage. Both the CLOCK and DATA pins are Schmitt Trigger inputs in this mode. When in I/O mode and RB7 is driving data, it is a CMOS output driver. After RESET, to place the device into programming/verify mode, the program counter (PC) is at location 00h. A command is then supplied to the device. Some commands then specify that 6-bits of program data are then supplied to or read from the device, depending on whether the command was a load or a read. For complete details of serial programming, please refer to the device specific Programming Specifications. During the In-Circuit Serial Programming Mode, the WDT circuitry is disabled from generating a device RESET. 30 ICSP 2000 Microchip Technology Inc. DS3953A-page 30-3

PIC8C Reference Manual 30.3 Application Circuit The application circuit must be designed to allow all the programming signals to be directly connectedtothepicmicromcu.figure 30- shows a typical circuit that is a starting point when designing with ICSP. The application must compensate for the following:. Isolation of the MCLR/VPP pin from the rest of the circuit 2. Loading of pins CLOCK and DATA 3. Capacitance on each of the VDD, MCLR/VPP, CLOCK and DATA pins 4. Minimum and maximum operating voltage for VDD 5. PICmicro oscillator 30.3. Isolation of the MCLR/VPP Pin from the Rest of the Circuit The MCLR/VPP pin is normally connected to an RC circuit. The pull-up resistor is tied to VDD and a capacitor is tied to ground. This circuit can affect the operation of ICSP depending on the size of the capacitor, since the VPP voltage must be isolated from the rest of the circuit. The resistor (R) should be greater than 0kΩ to provide isolation between VDD and VPP. It is, therefore, recommended that the circuit in Figure 30- be used when an RC is connected to MCLR/VPP. Another consideration with MCLR/VPP is that when the PICmicro device is programmed, this pin is driven to approximately 3V and also to ground. Therefore, the application circuit must be isolated from this voltage provided by the programmer. 30.3.2 Loading of Pins CLOCK and DATA The CLOCK and DATA pins are used by the PICmicro MCU for serial programming. CLOCK is driven by the programmer. DATA is a bi-directional pin that is driven by the programmer when programming, and driven by the MCU when verifying. These pins must be isolated from the rest of the application circuit so as not to affect the signals during programming. You must take into consideration the output impedance of the programmer when isolating CLOCK and DATA from the rest of the circuit. This isolation circuit must account for CLOCK being an input on the MCU and for DATA being bi-directional (can be driven by both the MCU and the programmer). For instance, PRO MATE II has an output impedance of kω. If the design permits, these pins should not be used by the application. This is not the case with most applications, so it is recommended that the designer evaluate whether these signals need to be buffered. As a designer, you must consider what type of circuitry is connected to CLOCK and DATA and then make a decision on how to isolate these pins. Figure 30- does not show any circuitry to isolate CLOCK and DATA on the application circuit, because this is very application dependent. To simplify this interface, the optimal usage of these I/O pins in the application are (in order):. Dedicate the CLOCK/DATA pins for the ICSP interface (not connected to other circuitry). 2. Use these pins as outputs with minimal loading on the signal line. 3. Use isolation circuitry so these signals can be driven to the ICSP specifications. Figure 30-: Typical In-Circuit Serial Programming (ICSP) Application Circuit Application PCB PIC8CXXX VDD/VPP VDD R MCLR/VPP C R2 ICSP Connector VDD VSS DATA CLOCK To application circuit Isolation circuits DS3953A-page 30-4 2000 Microchip Technology Inc.

Section 30. ICSP 30.3.3 Capacitance on Each of the VDD, MCLR/VPP, CLOCKandDATAPins The total capacitance on the programming pins affects the rise rates of these signals as they are driven out of the programmer. Typical circuits use several hundred microfarads of capacitance on VDD, which helps to dampen noise and ripple. However, this capacitance requires a fairly strong driver in the programmer to meet the rise rate timings for VDD. Most programmers are designed to simply program the MCU itself and don t have strong enough drivers to power the application circuit. One solution is to use a driver board between the programmer and the application circuit. The driver board requires a separate power supply that is capable of driving the VPP and VDD pins with the correct rise rates and should also provide enough current to power the application circuit. CLOCK and DATA are not buffered on this schematic, but may require buffering depending upon the application. A sample driver board schematic is shown in Figure 30-2. Note: The driver board design MUST be tested in the user's application to determine the effects of the application circuit on the programming signals timing. Changes may be required if the application places a significant load on the VDD, VPP, CLOCK or DATA pins. 30.3.4 Minimum and Maximum Operating Voltage for VDD 30.3.5 PICmicro Oscillator The Microchip programming specification states that the device should be programmed at 5V. Special considerations must be made if your application circuit operates at 3V only. These considerations may include totally isolating the MCU during programming. Another consideration is the device must be verified at the minimum and maximum voltages at which the application circuit will be operating. For instance, a battery operated system may operate from three.5v cells giving an operating voltage range of 2.7V to 4.5V. The programmer must program the device at 5V and must verify the program memory contents at both 2.7V and 4.5V to ensure that proper programming margins have been achieved. This ensures the PICmicro MCU operation over the voltage range of the system. The final consideration deals with the oscillator circuit on the application board. The voltage on MCLR/VPP must rise to the specified program mode entry voltage before the device executes any code. The crystal modes available on the device are not affected by this, because the Oscillator Start-up Timer waits for 024 oscillations before any code is executed. However, RC or EC oscillators do not require any start-up time; therefore, the Oscillator Start-up Timer is not used. The programmer must drive MCLR/VPP to the program mode entry voltage before the RC or EC oscillator toggles four times. If the RC or EC oscillator toggles four or more times, the program counter will be incremented to some value X. When the device enters programming mode, the program counter will not be zero and the programmer will start programming your code at an offset of X. There are several alternatives that can compensate for a slow rise rate on MCLR/VPP. Thefirst method is to not populate the resistor (R) in Figure 30-, program the device, and then insert the resistor (R). The other method is to have the programming interface drive the OSC pin of the PICmicro MCU to ground while programming. This will prevent any oscillations from occurring during programming. Connecting the application circuit to the programmer is dependent on the programming environment. Refer to Section 30.5 "Programming Environment" for more details. 30 ICSP 2000 Microchip Technology Inc. DS3953A-page 30-5

PIC8C Reference Manual 30.4 Programmer PIC8CXXX MCUs only use serial programming and, therefore, all programmers supporting these devices will support ICSP. One area of consideration with the programmer is the drive capability. As discussed before, it must be able to provide the specified rise rates on the ICSP signals and also provide enough current to power the application circuit. Figure 30-2 shows an example driver board. This driver schematic does not show any buffer circuitry for CLOCK and DATA. It is recommended that an evaluation be performed to determine if buffering is required. Another consideration with the programmer is what VDD levelsareusedtoverifythememory contents of the device. For instance, the PRO MATE II verifies program memory at the minimum and maximum VDD levels for the specified device and is, therefore, considered a production quality programmer. On the other hand, the PICSTART Plus only verifies at 5V and is for prototyping use only. The Microchip programming specifications state that the program memory contents should be verified at both the minimum and maximum VDD levels that the application circuit will be operating. This implies that the application circuit must be able to handle the varying VDD voltages. There are also several third party programmers that are available. You should select a programmer based on the features it has and how it fits into your programming environment. The Microchip Development Systems Ordering Guide (DS3077) provides detailed information on all our development tools. The Microchip Third Party Guide (DS0004) provides information on all of our third party tool developers. Please consult these two references when selecting a programmer. Many options exist, including serial or parallel PC host connection, stand-alone operation, and single or gang programmers. Some of the third party developers include Advanced Transdata Corporation, BP Microsystems, Data I/O, Emulation Technology, and Logical Devices. 30.5 Programming Environment The programming environment affects the type of programmer used, the programmer cable length and the application circuit interface. Some programmers are well suited for a manual assembly line, while others are desirable for an automated assembly line. You may want to choose a gang programmer to program multiple systems at a time. The physical distance between the programmer and the application circuit affects the load capacitance on each of the programming signals. This directly affects the drive strength needed to provide the correct signal rise rates and current. This programming cable must also be as short as possible and properly terminated and shielded, or the programming signals may be corrupted by ringing or noise. Finally, the application circuit interface to the programmer depends on the size constraints of the application circuit itself and the assembly line. A simple header can be used to interface the application circuit to the programmer. This might be more desirable for a manual assembly line where a technician plugs the programmer cable into the board. A different method uses spring loaded test pins (commonly referred to as pogo pins). The application circuit has pads on the board for each of the programming signals, and there is a fixture that has pogo pins in the corresponding configuration. The application circuit or fixture is moved into position, such that the pogo pins come into contact with the board. This method might be more suitable for an automated assembly line. After taking into consideration the various points with the application circuit, the programmer and the programming environment, anyone can build a high quality, reliable manufacturing line based on ICSP. DS3953A-page 30-6 2000 Microchip Technology Inc.

Section 30. ICSP 30.6 Other Benefits ICSP provides other benefits, such as calibration and serialization. If program memory permits, it would be cheaper and more reliable, to store calibration constants in program memory instead of using an external serial EEPROM. For example, if your system has a thermistor that can vary from one system to another, storing some calibration information in a table format allows the microcontroller to compensate (in software) for external component tolerances. System cost can be reduced without affecting the required performance of the system by using software calibration techniques. But how does this relate to ICSP? The PICmicro MCU has already been programmed with firmware that performs a calibration cycle. The calibration data is transferred to a calibration fixture. When all calibration data has been transferred, the fixture places the PICmicro MCU in programming mode and programs the PICmicro MCU with the calibration data. Application note AN656, "In-Circuit Serial Programming of Calibration Parameters Using a PICmicro Microcontroller," shows exactly how to implement this type of calibration data programming. The other benefit of ICSP is serialization. Each individual system can be programmed with a unique or random serial number. One such application of a unique serial number would be for security systems. A typical system might use DIP switches to set the serial number. Instead, this number can be burned into program memory, thus reducing the overall system cost and lowering the risk of tampering. 30 ICSP 2000 Microchip Technology Inc. DS3953A-page 30-7

PIC8C Reference Manual 30.7 Field Programming of PICmicro OTP MCUs An OTP device is not normally capable of being reprogrammed, but the PICmicro architecture gives you this flexibility, provided the size of your firmware is at least half that of the desired device, and the device is not code protected. If your target device does not have enough program memory, Microchip provides a wide spectrum of devices from 0.5K to 6K word program memory with the same set of peripheral features that will help meet the criteria. The Enhanced MCU devices have three vectors; RESET and two interrupt vector addresses. When the PICmicro device encounters a RESET or interrupt condition, the code located at one of these locations in program memory is executed. For an example of reprogramming an OTP device, we will use an example from our Mid-Range family. This technology is applicable to all EPROM based PICmicro devices. The first listing of Example 30- shows the code that is first programmed into the PICmicro device. The second listing of Example 30- shows the code that is programmed into the PICmicro device for the second time. Example 30- shows that to program the device a second time, the memory location 0x0000 (originally goto Main (0x2808)), is reprogrammed to all 0 s. This happens to be a NOP instruction. This location cannot be reprogrammed to the new opcode (0x2860), because the bits that are 0 s cannot be reprogrammed to s. Only bits that are s can be reprogrammed to 0 s. The next memory location, 0x000, was originally blank (all s) and now becomes a goto Main (0x2860). When a RESET condition occurs, the MCU executes the instruction at location 0x0000, which is the NOP (a completely benign instruction), and then executes the goto Main to start the execution of code. The example also shows that all program memory locations after 0x005A are blank in the original program, so that the second time the PICmicro device is programmed, the revised code can be programmed at these locations. The same descriptions can be given for the interrupt vector locations. Now your one-time programmable Enhanced MCU is exhibiting EEPROM- or FLASH-like qualities. DS3953A-page 30-8 2000 Microchip Technology Inc.

Section 30. ICSP Example 30-: Programming Cycle Listing Files First Program Cycle Second Program Cycle Prog Opcode Assembly Prog Opcode Assembly Mem Instruction Mem Instruction ----------------------------------------------------------------------------------------- 0000 2808 goto Main ;Main loop 0000 0000 nop 000 3FFF <blank> ; at 0x0008 000 2860 goto Main; Main now 0002 3FFF <blank> 0002 3FFF <blank> ; at 0x0060 0003 3FFF <blank> 0003 3FFF <blank> 0004 2848 goto ISR ; ISR at 0004 0000 nop 0005 3FFF <blank> ; 0x0048 0005 28A8 goto ISR ; ISR now at 0006 3FFF <blank> 0006 3FFF <blank> ; 0x00A8 0007 3FFF <blank> 0007 3FFF <blank> 0008 683 bsf STATUS,RP0 0008 683 bsf STATUS,RP0 0009 3007 movlw 0x07 0009 3007 movlw 0x07 000A 009F movwf ADCON 000A 009F movwf ADCON 0048 C0C btfss PIR,RBIF 0048 C0C btfss PIR,RBIF 0049 284E goto EndISR 0049 284E goto EndISR 004A 806 btfsc PORTB,0 004A 806 btfsc PORTB,0 0060 3FFF <blank> 0060 683 bsf STATUS,RP0 006 3FFF <blank> 006 3005 movlw 0x05 0062 3FFF <blank> 0062 009F movwf ADCON 00A8 3FFF <blank> 00A8 C0C btfss PIR,RBIF 00A9 3FFF <blank> 00A9 28AE goto EndISR 00AA 3FFF <blank> 00AA 806 btfsc PORTB,0 ----------------------------------------------------------------------------------------- 30 ICSP 2000 Microchip Technology Inc. DS3953A-page 30-9

PIC8C Reference Manual 30.8 Field Programming of FLASH PICmicro MCUs With the ICSP interface circuitry already in place, FLASH-based PICmicro MCUs can be easily reprogrammed in the field. These FLASH devices allow you to reprogram them even if they are code protected. A portable ICSP programming station might consist of a laptop computer and programmer. The technician plugs the ICSP interface cable into the application circuit and downloads the new firmware into the device. The next thing you know, the system is up and running without those annoying bugs. Another instance would be that you want to add an additional feature to your system. All of your current inventory can be converted to the new firmware, and field upgrades can be performed to bring your installed base of systems up to the latest revision of firmware. DS3953A-page 30-0 2000 Microchip Technology Inc.

Section 30. ICSP Figure 30-2: Example Driver Board Schematic R5 00 3 2 C7 0.00 UD 4 TLE244A 2 R7 00 Q 2N2907 3 R6 +8V 00 2 3 Q3 2N2222 R3 PVDD C6 PVDD 0. 4 U2A 74HC26 CLOCK 2 3 PRB6 UA 7 4 U2B 74HC26 5 6 30 2 3 VDD 6 5 VPP 4 +5V JP 23 4 5 HEADER 2 JP2 HEADER R0 00 9 0 C8 0.00 UC 8 TLE244A R 5.k 2 R8 00 Q2 2N2907 3 TLE244A C3 0. UB 7 TLE244A +5V VR LM7808 VIN C5 0. GND 3 R9 +5V 00 2 3 Q4 2N2222 R2 5.k VPP VDD VOUT 2 DATA CLOCK +5V C9 00 +8V C4 0. R4 0 U2C 74HC26 9 8 PVPP 3 U2D 74HC26 2 PVPP PVDD DATA CLOCK JP3 23 4 5 HEADER Note: All resistors are in Ohms, all capacitors are in µf. ICSP 2000 Microchip Technology Inc. DS3953A-page 30-

PIC8C Reference Manual 30.9 Design Tips Question : When I try to do ICSP, the entire program is shifted (offset) in the device program memory. Answer : If the MCLR pin does not rise fast enough, while the device s voltage is in the valid operating range, the internal Program Counter (PC) can increment. This means that the PC is no longer pointing to the address that you expected. The exact location depends on the number of device clocks that occurred in the valid operating region of the device. Question 2: I am using a PRO MATE II with a socket that I designed to bring the programming signal to my application board. Sometimes when I try to do ICSP, the program memory is programmed wrong. Answer 2: The voltages / timings may be violated at the device. This could be due to the: Application board circuitry Cable length from programmer to target Large capacitance on VDD that affects levels / timings DS3953A-page 30-2 2000 Microchip Technology Inc.

Section 30. ICSP 30.0 Related Application Notes This section lists application notes that are related to this section of the manual. These application notes may not be written specifically for the Enhanced family (that is, they may be written for the Base-Line, the Mid-Range or High-End families), but the concepts are pertinent, and could be used (with modification and possible limitations). The current application notes related to In-Circuit Serial Programming are: Title Application Note # In-Circuit Serial Programming of Calibration Parameters using a PICmicro Microcontroller AN656 In-Circuit Serial Programming Guide DS30277 Note: Please visit the Microchip Web site for additional software code examples. These code examples are stand alone examples to assist in the understanding of the PIC8CXXX. The web address for these examples is: http://www.microchip.com/0/faqs/codeex/ 30 ICSP 2000 Microchip Technology Inc. DS3953A-page 30-3

PIC8C Reference Manual 30. Revision History Revision A This is the initial released revision of the Enhanced MCU In-Circuit Serial Programming module description. DS3953A-page 30-4 2000 Microchip Technology Inc.