The two ways of implementing in-system programming, and how to choose between them based on cost, speed and hardware complexity.

In-system programming (ISP) is a key technique that allows devices such as microcontrollers (MCUs), memories and CPLDs to be programmed without removing them from the circuit board. Because devices can still be programmed, updated and configured after assembly, it simplifies both development and manufacturing.

There are two main ways of implementing in-system programming:

  • Direct in-system programming (direct programming)
  • In-system programming through an MCU or microprocessor (MPU)

Which one to choose depends mainly on the specific requirements of the project, the overall cost, performance expectations and the complexity of the hardware design. Each method has its own advantages and trade-offs.

Direct in-system programming

Direct in-system programming (also called direct programming) is the most common way of programming memory devices on a circuit board. The target device is programmed directly through a dedicated debug interface such as UART, SPI, I2C, JTAG or SWD (Serial Wire Debug). These interfaces let the programming system load firmware directly into the device’s memory. The actual programming can be carried out in two main ways:

  • Direct programming through the debug interface: the firmware is transferred through the debug interface directly into the target device’s memory. This method is relatively simple and is typically used when the target device itself has an interface for direct communication.
  • Indirect programming through an application in RAM: the programming system first loads an application into the target device’s RAM. Once running, this application communicates with the programming system through the debug interface and carries out the programming. RAM serves as temporary storage for executable code, allowing the programming system to write the firmware into the device’s non-volatile memory.

Advantages of direct in-system programming

  • Simplicity: because it uses standard debug interfaces directly, it is usually simpler to implement.
  • Speed: programming through dedicated interfaces is usually faster and more efficient, especially with high-speed protocols such as JTAG/SWD or SPI.
  • Wide support: many MCUs and programmable devices natively support direct programming through these common debug interfaces, making it a widely accepted and easily adopted solution.

Disadvantages of direct in-system programming

  • Limited flexibility in complex systems: when there are several devices on the board, the debug interfaces of some of them may be unavailable or hard to access. The method may then not be feasible at all, or may require additional hardware.

In-system programming through an MCU/MPU

Unlike direct programming, in-system programming through an MCU or MPU uses an intermediary microcontroller or microprocessor to program the target device. This approach is used when the target device cannot be programmed directly through a debug interface, or when the system design provides no way to access such an interface.

In this architecture, the target device is connected to a peripheral interface of the MCU/MPU, such as QSPI or specific GPIO pins. When the programming environment cannot access the target device’s debug interface directly, the MCU/MPU’s own debug interface (JTAG, USB and so on) is used to load an application into the intermediary device’s RAM. Once loaded and running, the application configures and initialises the system peripherals, takes control of them, and communicates with the programming system through the debug interface to program the target device connected to the intermediary MCU/MPU.

Advantages of programming through an MCU/MPU

  • Greater flexibility: this is particularly valuable in complex systems where the target device has no direct debug interface, or where more control over peripheral interfaces is needed.

Disadvantages of programming through an MCU/MPU

  • Increased complexity: additional software is needed to control the programming process, which makes the system design more complex.
  • Slower programming: programming speed depends on the performance of the intermediary MCU/MPU rather than on the target device’s own debug interface, so it can be slower than direct programming.

How to choose between the two

The decision depends on several factors:

  1. Project requirements. If the target device’s debug interface is accessible and programming needs to be fast and simple, direct programming is preferable. If the system is more complex, or the target device has no debug interface, programming through an MCU/MPU becomes necessary.
  2. Cost and hardware design. Direct programming usually needs fewer resources and simpler software; programming through an MCU/MPU adds software complexity and may increase costs.
  3. Performance requirements. Direct programming is faster, making it suitable for high-volume production or high-performance applications. Programming through an MCU/MPU is more flexible, but may be slower and adds overhead.
  4. System complexity. For simple systems with a limited number of devices, direct programming is usually sufficient. For larger systems with more devices, or where special control over peripheral interfaces is needed, programming through an MCU/MPU is often the better choice.

Conclusion

Direct in-system programming and in-system programming through an MCU/MPU each have their strengths and suit different types of projects. When a debug interface can be used directly, direct programming is generally preferred for its simplicity and speed; where more flexibility is needed — for example in complex systems, or when the target device lacks a direct programming interface — programming through an intermediary MCU/MPU has the advantage. The final choice depends on the specific needs of the project, including the complexity of the hardware design, performance requirements and cost considerations.