Hello! Welcome to Embedic!
This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > Embedded Events > Introduction to Programming of Microcontroller: ISP, IAP and ICP

Introduction to Programming of Microcontroller: ISP, IAP and ICP

Date: 30-11-2022 ClickCount: 2317

1. What is Microcontroller Programming

 

Microcontroller programming is to load the original program into the computer after compiling and processing, and let the computer execute the written program. For example, when program a single-chip program, it loads the .hex file and stores it in the single-chip computer. The written program can be realized when the computer is turned on. . To put it simply, the process of making the microcomputer boot and execute the programming.

 

Chip programming is an important part of the production process of electronic products. The efficiency is an important aspect that customers pay attention to. Generally, the current programming are divided into 2 methods, offline programming and online programming.

 

Offline programming: Through the link of the adapter and the chips of different packages, the chip and the adapter can be used together to realize the programming of the program. The essence of the adapter is similar to a precision fixture, and chips in different packages need to be matched with different adapters.

 

If there is an error during the production test, the chip needs to be disassembled from the adapter and re-programmed according to the prescribed process, which consumes a lot of manpower and material resources, and the cost is high, and it is also relatively prone to problems. Therefore, offline programming is generally not recommended.

 

Online programming: Online programming uses the standard communication bus of the chip, such as USB, SWD, JTAG, UART, etc. The interface is generally fixed, and there are few pins that need to be connected during programming. Since the communication rate of the interface is not high, the programming can be completed by using ordinary wires without high consumption.

 

Online programming is programmed by connecting wires. If an error is found during production testing, you can perform programming again without disassembling the chip. It not only saves production cost, but also increases the efficiency of programming. So now the way of online burning is generally used.

 

2. Three Common Methods of Microcontroller Programming: ISP, IAP and ICP

Let's talk about the three common methods of microcontroller programming: ISP, IAP and ICP, and their differences. What are the principles of these three program? Before analyzing the principle, you need to know the access address of the microcontroller Flash to see where the program is burned.

 

1). The location of MCU Flash in the address mapping table

 

The figure below is an address mapping table of STM32F4xx, from 0x0000 0000 to 0xFFFF FFFF, totaling 4Gbyte. The access addresses of the on-chip Flash, on-chip RAM, on-chip peripherals and external expansion interfaces of the microcontroller are all mapped within the range of 4Gbyte.

 

address mapping table of stm32f4xx

 

In this picture, we need to pay attention to the lower part:

 

Main memory main storage area: Usually, the code we write is placed at the starting position of the main storage area (0x0800 0000) to start running. When run the program, just from here 0x0800 0000.

 

System memory system storage area: System memory (starting position 0x1FFF 0000). This is a piece of ROM that cannot be modified after leaving the factory.

 

After understanding the specific address of the program, we also need to look at the startup method of the single-chip microcomputer:

 

2). Introduction to ISP, ICP, and IAP

 

ISP

 

ISP: In System Programming.

ISP means that programming can be performed on the board level, that is, the entire program is written without dismantling the chip, usually through the ISP interface line.

Chips that support ISP generally solidify a boot program (upgraded with ISP) inside the chip. BOOT0 = 1, BOOT1 = 0

Start address: 0x1FFF0000

For example:

use Flash loader to program STM32, use STC-ISP to program STC chip.

use stc-isp to program stc chip

ICP

 

ICP: In Circuit Programming

ICSP: In-Circuit Serial Programming, in-circuit serial programming. Such as: EEPROM programming, etc.

BOOT0 = 0, BOOT1 = x

Start address: 0x08000000

 

There are different opinions on the ICP programming method on the Internet. From the literal meaning (in the circuit), all the chips that are being programmed need to be powered on, and they are all in the circuit. Strictly speaking, programming using J-Link, ST-Link, e-Link32 and other tools also belongs to in-circuit programming (ICP).

 

icp

 

IAP

 

IAP: In application programming. Perform programming (upgrade program, update firmware) while the program is running.

 

The principle of IAP is quite different from the above two. In this way, the main storage area is divided into two areas (allocated by the developer according to actual needs). This part at the beginning of 0800 0000 stores a developer's own The designed Bootloader program, the other part stores the APP program that actually needs to run.

 

IAP is the programming of part of the User Flash by the user's own program during operation. The purpose is to update and upgrade the firmware program in the product through the reserved communication port conveniently after the product is released.

 

IAP communication port There are many kinds of IAP communication ports: UART serial port, ETH Ethernet, I2C, SPI, etc. It stands to reason that as long as the communication port that can transmit data can realize the function of IAP.

iap

 

The Difference Between ISPs and IAPs

 

1) For Applications

 

1. The update of ISP program needs to be solved on site, but it does not need to dismantle the machine;

 

2. IAP If there is a network management system, use the network management to download everything, and people don't have to run around.

 

2) How ISPs and IAPs Work

 

The implementation of ISP is relatively simple, and the common practice is that the internal memory can be rewritten by the software of the host computer through the serial port. For the microcontroller, the data can be received through SPI or other serial interfaces and written into the memory. So even if we solder the chip on the circuit board, as long as the serial port to interface with the host computer is reserved, the internal memory of can be rewritten.

 

The implementation of IAP is complicated. When implementing the function, it needs to have two areas for storage inside the MCU. Generally, there are 2 areas, one is called the BOOT area, and the other is storage area. The MCU is powered on and runs in the BOOT area. If the conditions for external program rewriting are met, the program in the storage area will be rewritten. If the conditions for rewriting the program externally are not met, the program pointer jumps to the storage area and starts to execute the program placed in the storage area, thus realizing the IAP function.

 

3) Advantages of ISPs and IAPs

 

ISP: The experiment and development of the microcontroller can be carried out without a programmer. The MCU chip can be directly welded to the circuit board, and the finished product is ready after debugging, which eliminates the frequent insertion and removal of the chip to the chip and the circuit board during debugging. Inconvenience caused.

 

IAP: The IAP technology maps the Flash memory into two memory parts structurally. When running the user program on one memory bank, the other memory bank can be reprogrammed, and then the program is transferred from one memory bank to the other.

 

The realization of ISP generally requires few external circuits to assist the realization, while the realization of IAP is more flexible. Usually, the serial port of the single-chip microcomputer can be used to connect to the RS232 port of the computer, and the internal memory can be programmed through a specially designed firmware program. It is very convenient to realize remote upgrade and maintenance through Internet or other communication methods.

 

  • Top 10 MCUs Most Popular with Manufacturers in 2022
  • What is AVR Microcontroller:Features, Architecture and Application 2022

Hot Products

  • TMS320C6455DZTZ

    Manufacturer: Texas Instruments

    IC DSP FIXED-POINT 697FCBGA

    Product Categories: DSP

    Lifecycle:

    RoHS:

  • TMS320C6745BPTPD4

    Manufacturer: Texas Instruments

    IC DSP FIX/FLOAT POINT 176HLQFP

    Product Categories: DSP

    Lifecycle:

    RoHS:

  • VCE6467TZUTL1

    Manufacturer: Texas Instruments

    IC DGTL MEDIA SOC 529FCBGA

    Product Categories: SOC

    Lifecycle:

    RoHS:

  • TMX320DM8148BCYE

    Manufacturer: Texas Instruments

    IC DGTL MEDIA PROCESSR 684FCBGA

    Product Categories: DSP

    Lifecycle:

    RoHS:

Customer Comments

  • Looking forward to your comment

  • Comment

    Verification Code * 

Compare products

Compare Empty