This question already has an answer here:
From my understanding, for a common microcontroller (e.g. AVR, PIC), there are generally two methods of programming its flash memory.
- Using a programmer: In-Circuit Serial Programming (or some variant?)
- Some form of a bootloader, to which an external device communicates, ultimately allowing the microcontroller to flash its own memory.
Certainly there must be a very good reason to use a bootloader, else its current widespread use would be very odd. I just haven't seemed to have fully grasped it yet.
Is it that a programmer is expensive? But then, there are Arduinos (ATmega microcontroller) which can function as programmers. Is the cost of one extra IC enough to warrant the use of a bootloader? If I'm not mistaken, the latest Arduinos get rid of the FTDI chip altogether, replacing it with an ATmega processor that does the USB to serial interfacing. Surely it would be possible to integrate the programmer's function on this IC for instance?
Or take for example, the PIC microcontroller. There is something I've seen called the JDM programmer. If something like this, with virtually no active components, can program a PIC then,
- Why use a bootloader at all?
- What is the purpose of the relatively much more complex PICkit (aside from robustness)? Debugging capability?