== Overview ==
There is no standard for in-system programming protocols for programming [[microcontroller]] devices. Almost all manufacturers of microcontrollers support this featureISP, but all have implemented their own protocols, which often differ even for differentvarious devices from the same manufacturer. Up to 4 pins may be required for implementing a [[JTAG]] standard interface. In general, modern protocols try to keep the number of pins used low, typically to 2 pins. Some ISP interfaces manage to achieve the same with just a single pin. Newer [[ATtiny]] microcontrollers with UPDI can even reuse that programming pin also as a [[general-purpose input/output]].<ref>{{Cite web |title=Unified Program and Debug Interface (UPDI) High-Voltage Activation Information - Developer Help |url=https://developerhelp.microchip.com/xwiki/bin/view/software-tools/programmers-and-debuggers/avr-updi-info/ |archive-url=https://web.archive.org/web/20241007021157/https://developerhelp.microchip.com/xwiki/bin/view/software-tools/programmers-and-debuggers/avr-updi-info/ |archive-date=2024-10-07 |access-date=2024-12-17 |website=developerhelp.microchip.com |quote=Shared UPDI pin. This implementation is generally used on devices with smaller packages. The UPDI pin can be re-configured into a GPIO or /RESET pin. In this case, the UPDI functionality is disabled, and a high-voltage source is required to re-enable it. Examples include tinyAVR 0-series, 1-series, and 2-series devices.}}</ref>
The primary advantage of in-system programming 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 pre-programmed chips from a manufacturer or distributor, making it feasible to apply code or design changes in the middle of a production run. The other advantage is that production can always use the latest firmware, and new features as well as bug fixes can be implemented and put into production without the delay occurring when using pre-programmed microcontrollers.
== History ==
Starting from the early 1990s, an important technological evolution in the architecture of the microcontrollers was witnessed. At first, they were realized in two possible solutions: with [[Programmable read-only memory|OTP (one-time programmable (OTP)]] or with [[EPROM|EPROM memories]]. InFor EPROM, a memory-erasing process requires the chip to be exposed to ultraviolet light through a specific window above the package. In 1993 [[Microchip Technology]] introduced the first microcontroller with [[EEPROM|EEPROM memory]]: the PIC16C84. EEPROM memories can be electrically erased. This feature allowed to lower the realization costs by removing the erasing window above the package and initiate in-system programming technology. With ISP flashing process can be performed directly on the board at the end of the production process. This evolution gave the possibility to unify the programming and functional test phase and in production environments and to start the preliminary production of the boards even if the firmware development has not yet been completed. This way it was possible to correct bugs or to make changes at a later time. In the same year, [[Atmel]] developed the first microcontroller with flash memory, easier and faster to program and with much longer life cycle compared to EEPROM memories.
Microcontrollers that support ISP are usually provided with pins used by the serial communication peripheral to interface with the programmer, a flash/EEPROM memory and the circuitry used to supply the voltage necessary to program the microcontroller. The communication peripheral is in turn connected to a programming peripheral which provides commands to operate on the flash or EEPROM memory.
When designing electronic boards for ISP programming, it’s necessary to take into account some guidelines to have a programming phase as reliable as possible. Some microcontrollers with a low number of pins share the programming lines with the I/O lines. This couldcan be a problem if the necessary precautions are not taken into account in the design of the board; the device can suffer the damage of the I/O components during the programming. Moreover, it’s important to connect the ISP lines to [[high impedance]] circuitry both to avoid a damage of the components by the programmer and because the microcontroller often cannot supply enough current to pilot the line. Many microcontrollers need a dedicated RESETreset line to enter in the programming mode. It is necessary to pay attention to current supplied for line driving and to check for presence of [[Watchdog timer|watchdogs]] connected to the RESETreset line that can generate an unwanted reset and, so, to lead a programming failure. Moreover, some microcontrollers need a higher voltage to enter in Programming Mode and, hence, it’s necessary to check that this value it’s not attenuated and that this voltage is not forwarded to others components on the board.
== Industrial application ==
In-Systemsystem Programming processprogramming takes place during the final stage of production of thea product. and itIt can be performed in two different ways based on the production volumes.:
In the first method, a connector is manually connected to the programmer. This solution expects the human participation to the programming process that has to connect the programmer to the electronic board with the cable. Hence, this solution is meant for low production volumes.
The second method uses [[test point]]s on the board. These are specific areas placed on the printed board, or [[Printed circuit board|PCB]], that are electrically connected to some of the electronic components on the board. Test points are used to perform functional tests for components mounted on board and, since they are connected directly to some microcontroller pins, they are very effective for ISP. For medium and high production volumes using test points is the best solution since it allows to integrate the programming phase in an assembly line.
In production lines, boards are placed on a bed of nails called a [[Test fixture|fixture]]. The latter are integrated, based on the production volumes, in semiautomatic or automatic test systems called [[Automatic test equipment|ATE (automatic test equipment (ATE)]]. Fixtures are specifically designed for each board - or at most for few models similar to the board they were designed for – therefore these are interchangeable in the system environment where they are integrated. The test system, once the board and the fixture are placed in position, has a mechanism to put in contact the needles of the fixture with the test points on the board to test. The system it’s connected to, or has directly integrated inside, an ISP programmer. This one has to program the device or devices mounted on the board: for example, a microcontroller and/or a serial memory.
== Microchip ICSP ==
=== RJ11 pinout ===
[[File:Rj11-4-6 to icsp.jpg|thumb|RJ11 to ICSP PIC programmer]]An Microchip supports an industry standard for using [[Registered jack#RJ11|RJ11 sockets]] with an ICSP programmer is supported by Microchip. The illustration represents information provided in their data sheets. However, there is room 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 originaloriginally developed for wired desktop phones).
==References==
==See also==
*[[PIC microcontroller#Device programmers|Device Programmersprogrammers]]
{{Microchip Technology}}
|