Bootloader utilizes to program microcontrollers by providing a medium of communication between them. Hence small bootloader uses to make controller programmable very often as like Arduino series board. Microcontrollers like 8051, PIC without bootloader requires the external programmer to burn the program inside the memory of the microcontroller. In addition to it requires preciously control output states of various pin mode which should be in sequence according to the datasheet of the manufacturer. Here this PPT has portrayed as an example of idle configurations that requires to run the bootloader and what happens if the bootloader is installed inside the memory of the controller.
2. Introduction :-
A bootloader is a program that stays in the microcontroller and communicates with
the PC (usually through the serial interface).
The bootloader receives a user program from the PC and writes it in the flash memory,
then launches this program in execution.
Bootloader can only be used with those microcontrollers that can write their flash
memory through software.
The bootloader itself must be written into the flash memory with an external
programmer.
In order for the bootloader to be launched after each reset, a "goto bootloader"
instruction must exist somewhere in the first 4 instructions;
There are two types of bootloader, some that require that the user reallocate his code
and others that by themselves reallocate the first 4 instructions of the user program to
another location and execute them when the bootloader exits.
2
4. FirmWare
Overview There are two modes of firmware operation
Bootloader mode is entered if either of the following conditions apply. If these
conditions do not apply, the Application mode is entered.
1) If application firmware code has not been programmed into the microcontroller, the Bootloader
mode is entered.
2) If the PIC device’s RX pin is at logic level low (the RS-232 “Break” state) when the microcontroller
comes out of Reset, Bootloader mode is entered. Bootloader mode also can be entered manually or
automatically through software or hardware.
4
5. Common Bootloader based on RX pin
Schematic
5
RTS-based MCLR Reset control is
optional.
When connected, the host PC can
use the RTS serial port signal to pull
down the PIC device’s MCLR pin,
allowing the host PC software to
automatically reset the device when
entering the Bootloader mode.
6. MOSFET Based
Bootloader
6
An RS-232 transceiver chip
typically provides an internal
pull-down resistor on the
incoming TXD/RTS signals.
This allows the PIC device to
normally see logic level high
on its RX pin (the RS-232
“Idle” state) even when
disconnected at the serial
port, DB9 connector.
7. Note
7
If using a PIC device that requires high voltage (above VDD) on MCLR to enter the
In-Circuit Serial Programming™ (ICSP™) mode, the RTS/MCLR diode can interfere
with traditional ICSP programming/debugging. In this case, using an N-channel
metal oxide semiconductor field effect transistor (MOSFET) may be more
appropriate.
8. MODE
CONSIDERATION
S
In the default configuration,
bootloader firmware is stored at
the end of Flash program memory
space.
Keeping the bootloader at the end
of program memory space allows
application firmware to handle
interrupts at the normal hardware
interrupt vector address.
8
9. Application Mode
Consideration
Placing the bootloader firmware towards the end of Flash memory space should require little
or no changes to application firmware, due to the automatic Reset vector remapping done by
the host PC bootloader software.
Interrupt vectors are handled by application firmware at the normal hardware interrupt vector
addresses, so no application firmware changes are required in this design.
If the bootloader code is placed at address, 0h, the application firmware will have to support
remapping of the hardware Reset and interrupt vectors to new locations.
These new vector locations will be used by “pass-through” bootloader firmware occupying the
hardware vector addresses.
9
10. Software Design
the host PC software and write planning for the bootloader application.
Software that interface via Serial Communication protocols or via USB
Communication protocols to control various aspects of Loading Program Like
Erase previous program hex, Burn new program hex.
10