In-Circuit Serial Programming (ICSP) with the EPIC™ Programmer, melabs Serial Programmer, or melabs U2/USB Programmer


Our programmers may be used for in-circuit serial programming of serial programmable PIC® MCUs through the 10-pin expansion header J3.  The U2 programming header is detailed below.  Our other programmers use the same header pin-out.
If you're designing a PCB or circuit for ICSP, read the considerations below.  At the bottom of this page, you'll find a guide for connecting a board that is already equipped with a 10-pin header that matches our programmers.  (A LAB-X Experimenter Board, for example.)
PIN# SIGNAL
1 +5V always on (It is not recommended that you use this supply to power your target board.  Current capability is limited.)
2 Programming Voltage (Vpp) - Connect to MCLR/Vpp pin on target device.
3 Reserved - do not connect
4 Switched Vdd (This pin should not be used to power your target board.  It is intended to power a target PICmicro only when one of our programming adapters is used.)
5 Reserved - do not connect
6 Programming Data - Connect to PGD or ICSPDAT on the target PICmicro
7 Reserved - do not connect
8 Programming Clock - Connect to PGC or ICSPCLK on the target PIC MCU.
9, 10 Ground - A ground connection to your target board is required.
Design considerations for ICSP-capable circuits  (Refer to schematic diagram below.)1. If possible, dedicate the Programming Clock and Data pins to ICSP.  If you must also use these pins for other purposes on your board, some thought should be given to the type of hardware that is connected.  The best case is to use the programming pins for normally-open, pushbutton inputs.  As long as you don't push the buttons while programming, the switches won't affect things at all.


If loads are connected to the clock and data lines, they must not interact with the clock and data signals.  Capacitive loads will cause problems.  High-impedance loads are usually ok.  LEDs with current-limiting resistors are less desirable, but usually don't cause problems.
You should always prototype and test the ICSP connections before sending your PCB design out for fabrication.
2.  The MCLR pin on the PIC will be driven to approximately 13V during programming.  This raises two concerns.  The first is that your circuit must allow 13V on the pin.  Don't connect the pin directly to the Vdd rail.  The second concern is that the rest of your circuit may need to be protected from this voltage.  If 13V on the MCLR pin might put at risk other components on your board, use a diode in series with the RESET pullup to keep the 13V off of the Vdd line.
  
3.  Configure MCLR as a RESET pin if possible.  The programmer will attempt to reset the target device at the beginning of the programming process.  If the MCLR pin is configured as an input, the programmer may have problems putting the chip into program-mode.  This is especially problematic if the target has been previously programmed and is using the programming clock or data lines as outputs.In some situations, there just aren't enough pins to allow the use of a RESET.  Your project will require that MCLR be used as an input.  This is common on small, 8-pin PIC MCUs.  In these cases, it helps to set the clock and data pins to inputs and place a delay at the beginning of your code.  This will allow you to cycle power to the part and start the programming process while the pause is executing.
In a PICBASIC PRO program intended for the PIC12F675, you might start with:
TRISIO = $FF   ' set all pins to inputs
PAUSE 1000     ' wait a second
This can make reprogramming much easier to accomplish when the programmer has no means to reset the target device.
 
4.  Make sure the "low-voltage programming" pin is pulled to ground.  Low-voltage programming is not used by melabs programmers and should always be disabled in the configuration settings.  Even so, the low-voltage programming pin (labeled PGM or LVP) should be pulled to ground when programming.  If it is left floating or in a high condition, it may interfere with the programming process.  We use a 100K resistor to pull the pin low when designing a board for ICSP.  For most 16F series parts, RB3 doubles as the PGM pin.  On 18F series, it is usually RB5 that needs to be low.  Notable exceptions are the 16F62x and 16F64x family, which need RB4 to be pulled low.5.  Always connect every available power pin to the appropriate power or ground source.  Many PIC devices have multiple pins that are labeled Vdd, Vss, AVdd, and AVss.  If even one of these pins is left unconnected, it may result in programming errors.  This applies to analog supply pins even if you don't plan to use the analog functions.
 
6.  Use bypass capacitors between Vdd and Vss.  This is good practice in any case, but it's especially important for ICSP.  A single capacitor of 0.1uF is the minimum recommended, but more is the norm. 7.  Connect a 5V supply to the Vdd pins on the PIC.  You can do this with the normal power supply on your board or with an external supply.  The ICSP header on the programmer has a 5V pin (pin-1) that can be used, but only if your board doesn't consume too much power.  The Vdd pin (pin-4) on the header shouldn't be used.  Such use will probably cause errors during programming, and it's possible that it will damage the programmer hardware.


If your board is designed to run at a lower supply voltage like 3.3V and you can't safely connect 5V to the PIC, you may have issues when erasing a flash PIC.  For some devices, a low-voltage erase option is available (Options > More Options in the meProg software).  Do not enable low-voltage programming in the configuration settings!  This setting has nothing to do with the supply voltage for the PIC.
Some of the new PIC microcontrollers cannot by powered at 5V.  These parts usually require additional circuitry for in-circuit programming.  See the following link for details:  PIC18FxxJ, PIC18FxxK, PIC24xJ, and dsPIC33FJ 3.3 Volt Programming Information
Note for PIC17C7xx:  These (practically obsolete) devices may also be programmed in-circuit. However, different pins are required than are detailed here.  See the Microchip programming spec on these devices for more information.

The following schematic shows a typical ICSP connection for the PIC16F876A 

Connecting a programmer to a LAB-X board for in-circuit serial programming
Install the programming software according to the instructions included with your programmer.
Connect your programmer to the LAB-X board using a 10-pin ribbon cable (part# 10CAB). Do not twist or fold the cable to make the connection. The connectors on the programmer and LAB-X boards should line up to allow a straight connection.
If your LAB-X board has a ZIF socket, raise the lever. Insert the microcontroller into the socket on the LAB-X board and lower the lever to lock it into place. Make sure that the notch on the end of the microcontroller is aligned with the lever end of the socket.
If your LAB-X board does not have a ZIF socket, carefully line up the PICmicro microcontroller's pins with the holes in the socket and press it into place. Make sure the notch on the end of the microcontroller is aligned with the notch at the end of the socket.
Connect a 16VDC adapter (part# ACAD) to the programmer's power jack (not required for USB/U2 Programmer). You may have different adapters for the programmer and LAB-X board. Make sure you power the programmer with the 16V adapter.
Connect a 12VDC adapter (part# ACADX) to the LAB-X power jack. You must connect power to the LAB-X board in order to program the microcontroller.
Run the programmer software on your computer and use the programming procedure to program the part.*
*The LED indicator on the EPIC will remain lit at half intensity when the EPIC is connected to the LAB-X board. The indicator should light fully when a programming operation is in progress.

No comments:

Post a Comment

Labels

PROJECTS 8086 PIN CONFIGURATION 80X86 PROCESSORS TRANSDUCERS 8086 – ARCHITECTURE Hall-Effect Transducers INTEL 8085 OPTICAL MATERIALS BIPOLAR TRANSISTORS INTEL 8255 Optoelectronic Devices Thermistors thevenin's theorem MAXIMUM MODE CONFIGURATION OF 8086 SYSTEM ASSEMBLY LANGUAGE PROGRAMME OF 80X86 PROCESSORS POWER PLANT ENGINEERING PRIME MOVERS 8279 with 8085 MINIMUM MODE CONFIGURATION OF 8086 SYSTEM MISCELLANEOUS DEVICES MODERN ENGINEERING MATERIALS 8085 Processor- Q and A-1 BASIC CONCEPTS OF FLUID MECHANICS OSCILLATORS 8085 Processor- Q and A-2 Features of 8086 PUMPS AND TURBINES 8031/8051 MICROCONTROLLER Chemfet Transducers DIODES FIRST LAW OF THERMODYNAMICS METHOD OF STATEMENTS 8279 with 8086 HIGH VOLTAGE ENGINEERING OVERVOLATGES AND INSULATION COORDINATION Thermocouples 8251A to 8086 ARCHITECTURE OF 8031/8051 Angle-Beam Transducers DATA TRANSFER INSTRUCTIONS IN 8051/8031 INSTRUCTION SET FOR 8051/8031 INTEL 8279 KEYBOARD AND DISPLAY INTERFACES USING 8279 LOGICAL INSTRUCTIONS FOR 8051/8031 Photonic Transducers TECHNOLOGICAL TIPS THREE POINT STARTER 8257 with 8085 ARITHMETIC INSTRUCTIONS IN 8051/8031 LIGHTNING PHENOMENA Photoelectric Detectors Physical Strain Gage Transducers 8259 PROCESSOR APPLICATIONS OF HALL EFFECT BRANCHING INSTRUCTIONS FOR 8051/8031 CPU OF 8031/8051 Capacitive Transducers DECODER Electromagnetic Transducer Hall voltage INTEL 8051 MICROCONTROLLER INTEL 8251A Insulation Resistance Test PINS AND SIGNALS OF 8031/8051 Physical Transducers Resistive Transducer STARTERS Thermocouple Vacuum Gages USART-INTEL 8251A APPLICATIONs OF 8085 MICROPROCESSOR CAPACITANCE Data Transfer Instructions In 8086 Processors EARTH FAULT RELAY ELECTRIC MOTORS ELECTRICAL AND ELECTRONIC INSTRUMENTS ELECTRICAL BREAKDOWN IN GASES FIELD EFFECT TRANSISTOR (FET) INTEL 8257 IONIZATION AND DECAY PROCESSES Inductive Transducers Microprocessor and Microcontroller OVER CURRENT RELAY OVER CURRENT RELAY TESTING METHODS PhotoConductive Detectors PhotoVoltaic Detectors Registers Of 8051/8031 Microcontroller Testing Methods ADC INTERFACE AMPLIFIERS APPLICATIONS OF 8259 EARTH ELECTRODE RESISTANCE MEASUREMENT TESTING METHODS EARTH FAULT RELAY TESTING METHODS Electricity Ferrodynamic Wattmeter Fiber-Optic Transducers IC TESTER IC TESTER part-2 INTERRUPTS Intravascular imaging transducer LIGHTNING ARRESTERS MEASUREMENT SYSTEM Mechanical imaging transducers Mesh Current-2 Millman's Theorem NEGATIVE FEEDBACK Norton's Polarity Test Potentiometric transducers Ratio Test SERIAL DATA COMMUNICATION SFR OF 8051/8031 SOLIDS AND LIQUIDS Speed Control System 8085 Stepper Motor Control System Winding Resistance Test 20 MVA 6-digits 6-digits 7-segment LEDs 7-segment A-to-D A/D ADC ADVANTAGES OF CORONA ALTERNATOR BY POTIER & ASA METHOD ANALOG TO DIGITAL CONVERTER AUXILIARY TRANSFORMER AUXILIARY TRANSFORMER TESTING AUXILIARY TRANSFORMER TESTING METHODS Analog Devices A–D BERNOULLI’S PRINCIPLE BUS BAR BUS BAR TESTING Basic measuring circuits Bernoulli's Equation Bit Manipulation Instruction Buchholz relay test CORONA POWER LOSS CURRENT TRANSFORMER CURRENT TRANSFORMER TESTING Contact resistance test Current to voltage converter DAC INTERFACE DESCRIBE MULTIPLY-EXCITED Digital Storage Oscilloscope Display Driver Circuit E PROMER ELPLUS NT-111 EPROM AND STATIC RAM EXCITED MAGNETIC FIELD Electrical Machines II- Exp NO.1 Energy Meters FACTORS AFFECTING CORONA FLIP FLOPS Fluid Dynamics and Bernoulli's Equation Fluorescence Chemical Transducers Foil Strain Gages HALL EFFECT HIGH VOLTAGE ENGG HV test HYSTERESIS MOTOR Hall co-efficient Hall voltage and Hall Co-efficient High Voltage Insulator Coating Hot-wire anemometer How to Read a Capacitor? IC TESTER part-1 INSTRUMENT TRANSFORMERS Importance of Hall Effect Insulation resistance check Insulator Coating Knee point Test LEDs LEDs Display Driver LEDs Display Driver Circuit LM35 LOGIC CONTROLLER LPT LPT PORT LPT PORT EXPANDER LPT PORT LPT PORT EXTENDER Life Gone? MAGNETIC FIELD MAGNETIC FIELD SYSTEMS METHOD OF STATEMENT FOR TRANSFORMER STABILITY TEST METHODS OF REDUCING CORONA EFFECT MULTIPLY-EXCITED MULTIPLY-EXCITED MAGNETIC FIELD SYSTEMS Mesh Current Mesh Current-1 Moving Iron Instruments Multiplexing Network Theorems Node Voltage Method On-No Load And On Load Condition PLC PORT EXTENDER POTIER & ASA METHOD POWER TRANSFORMER POWER TRANSFORMER TESTING POWER TRANSFORMER TESTING METHODS PROGRAMMABLE LOGIC PROGRAMMABLE LOGIC CONTROLLER Parallel Port EXPANDER Paschen's law Piezoelectric Wave-Propagation Transducers Potential Transformer RADIO INTERFERENCE RECTIFIERS REGULATION OF ALTERNATOR REGULATION OF THREE PHASE ALTERNATOR Read a Capacitor SINGLY-EXCITED SOLIDS AND LIQUIDS Classical gas laws Secondary effects Semiconductor strain gages Speaker Driver Strain Gages Streamer theory Superposition Superposition theorem Swinburne’s Test TMOD TRANSFORMER TESTING METHODS Tape Recorder Three-Phase Wattmeter Transformer Tap Changer Transformer Testing Vector group test Virus Activity Voltage Insulator Coating Voltage To Frequency Converter Voltage to current converter What is analog-to-digital conversion Windows work for Nokia capacitor labels excitation current test magnetic balance voltage to frequency converter wiki electronic frequency converter testing voltage with a multimeter 50 hz voltages voltmeter

Search More Posts

Followers