AN2295 Freescale Semiconductor / Motorola, AN2295 Datasheet - Page 16

no-image

AN2295

Manufacturer Part Number
AN2295
Description
Developers Serial Bootloader for M68HC08 and HCS08 MCUs
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
FC Protocol, Version 1, M68HC908 Implementation
S19 File
Because bootloader operation must be transparent to the user S19 file, another piece of intelligence is
built into the PC master code (instead of the MCU slave). The relocation works like this:
If the data from an S19 record corresponds to an address in the interrupt vector table, the value is
relocated into the corresponding area in the bootloader user table, including a JMP instruction (opcode
$CC). For example, if the user S19 file contains #3 interrupt vector $E123 at address $FFE8, such a
vector is relocated into the sequence $CC, $E1, $23 (JMP $E123) that is programmed to the $FC81
address in the bootloader user table.
Using this method, the user S19 file does not need to be modified, but the lower address of the end of
FLASH memory must be considered. Also, every interrupt is delayed by the execution time of this JMP
instruction (3T) as explained in
Each Interrupt 3T
Delayed.
User Code Start
To provide a register setup similar to the way it appears after MCU reset, the user code is started in an
unusual way.
Software Reset
If the bootloader must quit and run user code, an illegal operation is intentionally executed (M68HC08
illegal opcode $32). This causes an illegal operation reset and the MCU restarts. During bootloader
startup, the system integration module (SIM) reset status register (SRSR) is tested. If a power-on-reset
is not detected, the user code is started instead of the bootloader code. This allows the transparent
operation of all other resets (such as illegal address, etc.) with only a short additional delay caused by
testing of the SRSR register and executing associated jump instructions.
Hardware Reset
In some implementations, a pin reset (caused by external reset pin) is also included as a valid source of
reset for the bootloader to start. This allows remote in-circuit reprogramming in embedded applications
that are able to drive the M68HC08 reset pin.
Another test has been added to the real bootloader application: If no source of reset is detected (i.e., if
the SRSR register is 0), the bootloader is selected by default. This may happen when reset is caused by
an external pin, but the reset pulse is shorter than specified. In that case, the minimum length of reset
pulse that will cause reset is shorter than the length needed for the proper propagation of the external
reset flag to the SRSR register.
Because the SRSR register is one-time readable (it clears after read), no subsequent reads of this register
provide a valid value. See
M68HC08 System Limitations
for details.
Developer’s Serial Bootloader for M68HC08 and HCS08 MCUs, Rev. 6
16
Freescale Semiconductor

Related parts for AN2295