Tuesday, July 21, 2015

ISP Vs IAP

To reprogram Flash Memory that is soldered down to PCB (either integrated into the microcontroller or external), there are two programming methods: ISP and IAP.




ISP (In-System Programming)
IAP (In-Application Programming)
ISP allows for re-programming of a Flash memory device while it is soldered into the target hardware.
IAP allows for re-programming of a Flash memory device while it is soldered into the target hardware and while the application code is running.
The application needs to be stopped during the re-programming process. Only after programming is completed, the application can be restarted.
The application need not be stopped during the re-programming process.
Usually, ISP requires that a service technician manually starts the re-programming procedure by halting the application and setting it into a special boot and/or programming mode.
With IAP it is possible to implement applications that can be re-programmed remotely without the need of a service technician to actually be present.

In general, IAP can always be realized with external Flash memory, where microcontroller and memory are separated components. This is true as long as there is some additional code memory available out of which the microcontroller can execute code, while the Flash memory is re-programmed.
In the Philips 89C51Rx2 series, ISP is implemented with the boot loader.
With on-chip Flash, IAP is only possible if supported by the microcontroller. The Philips 89C51Rx2 parts support IAP also via the boot loader.
The chip is set to ISP mode either by driving pin PSEN high externally right after a hardware reset or by software.
The application code can call functions in the boot loader area by loading parameters into the registers R0, R1 and DPTR and then calling a specific address in the boot loader. To make these functions easier to use, the Embedded Systems Academy provides a C library supporting all boot loader functions provided in ROM. This allows erasing and programming directly from the C level, simply by calling C functions.
When in ISP mode, the 89C51Rx2 accepts Flash-programming commands via the serial interface.
Such an application specific boot loader could ensure that essential initialization code gets executed, even if the chip starts in boot mode.

1 comment: