In-system programming

Stand-Alone In-System Programmer SuperProIS01
6- and 10-pin AVR ISP headers

In-system programming (ISP), also called In-Circuit Serial Programming (ICSP), is the ability of some programmable logic devices, microcontrollers, and other embedded devices to be programmed while installed in a complete system, rather than requiring the chip to be programmed prior to installing it into the system.

There are several incompatible in-system programming protocols for programming microcontroller devices such as PIC microcontrollers, AVRs, and the Parallax Propeller. ICSP has been primarily implemented by Microchip Technology for programming PIC and dsPIC devices.

The primary advantage of this feature is that it allows manufacturers of electronic devices to integrate programming and testing into a single production phase, and save money, rather than requiring a separate programming stage prior to assembling the system. This may allow manufacturers to program the chips in their own system's production line instead of buying preprogrammed chips from a manufacturer or distributor, making it feasible to apply code or design changes in the middle of a production run.

Microcontrollers are typically soldered directly to a printed circuit board and usually do not have the circuitry or space for a large external programming cable to another computer.

Typically, chips supporting ISP have internal circuitry to generate any necessary programming voltage from the system's normal supply voltage, and communicate with the programmer via a serial protocol. Most programmable logic devices use a variant of the JTAG protocol for ISP, in order to facilitate easier integration with automated testing procedures. Other devices usually use proprietary protocols or protocols defined by older standards. In systems complex enough to require moderately large glue logic, designers may implement a JTAG-controlled programming subsystem for non-JTAG devices such as flash memory and microcontrollers, allowing the entire programming and test procedure to be accomplished under the control of a single protocol.

An example of devices using ISP is the AVR line of micro-controllers by Atmel such as the ATmega series.

Microchip ICSP

For most Microchip microcontrollers, ICSP programming is performed using two pins, clock (PGC) and data (PGD), while a high voltage (12 V) is present on the Vpp/MCLR pin. Low voltage programming (5 V or 3.3 V) dispenses with the high voltage, but reserves exclusive use of an I/O pin. However, for newer microcontrollers, specifically PIC18F6XJXX/8XJXX microcontrollers families, entering into ICSP modes is a bit different.[1] Entering ICSP Program/Verify mode requires the following three steps:

  1. Voltage is briefly applied to the MCLR (master clear) pin.
  2. A 32-bit key sequence is presented on PGD.
  3. Voltage is reapplied to MCLR.
Microchip PICkit ICSP programmer

A separate piece of hardware, called a programmer is required to connect to an I/O port of a PC on one side and to the PIC on the other side. A list of the features for each major programming type are:

  1. Parallel port - large bulky cable, most computers have only one port and it may be inconvenient to swap the programming cable with an attached printer. Most laptops newer than 2010 do not support this port. Parallel port programming is very fast.
  2. Serial port (COM port) - At one time the most popular method. Serial ports usually lack adequate circuit programming supply voltage. Most computers and laptops newer than 2010 lack support for this port.
  3. Socket (in or out of circuit) - the CPU must be either removed from circuit board, or a clamp must be attached to the chip making access an issue.
  4. USB cable - Small and light weight, has support for voltage source and most computers have extra ports available. The distance between the circuit to be programmed and the computer is limited by the length of USB cable - it must usually be less than 180 cm. This can make programming devices deep in machinery or cabinets a problem.

ICSP programmers have many advantages, with size, computer port availability, and power source being major features. Due to variations in the interconnect scheme and the target circuit surrounding a micro-controller, there is no programmer that works with all possible target circuits or interconnects. Microchip provides a detailed ICSP programming guide[2] Many sites provide programming and circuit examples.

PICs are programmed using five signals (a sixth pin 'aux' is provided but not used). The data is transferred using a two wire synchronous serial scheme, three more wires provide programming and chip power. The clock signal is always controlled by the programmer.

Typical programming communication

Signals and pinout

Typical chip connections

RJ11 pinout

RJ11 to ICSP PIC programmer

An industry standard for using RJ11 sockets with an ICSP programmer is supported by Microchip. The illustration below represents information provided in their data sheets. However, there is area for confusion. The PIC data sheets show an inverted socket and do not provide a pictorial view of pinouts so it is unclear what side of the socket Pin 1 is located on. The illustration provided here is untested but uses the phone industry standard pinout (The RJ11 plug/socket was original developed for wired desktop phones).

References

See also

This article is issued from Wikipedia - version of the 3/18/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.