MOTOROLA
3-16
CONFIGURATION AND MODES OF OPERATION
M68HC11
REFERENCE MANUAL
3.5.4.1 Loading Programs in Bootstrap Mode
This section describes the bootloader firmware in the standard MC68HC11A8. When
the security mode is not specifically requested, it is disabled at the mask level so it will
not be invoked accidentally. In these cases, the program steps, which check for secu-
rity and optionally erase the EEPROM and CONFIG register, are not included in the
bootloader program. On some early production units before 1988, the security checks
were included even on parts having the security mode disabled in the mask. Also, the
security feature was enabled in the mask of some parts where the security feature was
not specifically requested.
The bootloader ROM program initializes the SCI so that the receiver and transmitter
are enabled and the baud rate is E clock/16/16 (7812 baud if E = 2 MHz). If the security
feature is present and enabled, $FF is transmitted. The EEPROM is then erased. If the
erasure was unsuccessful, $FF is again transmitted, and erasure is attempted again.
After successful erasure of EEPROM, the RAM is written over with $FF, and the CON-
FIG register is erased. Only after all of these operations are successful can the boot-
loading process continue as if the part were never secured.
If the MCU is not secured (or if the previous erase sequence has been completed), a
break character is transmitted. For normal use of the bootloader, the user then sends
an $FF character at a baud rate of either E clock/16/16 (7812 baud if E = 2 MHz) or E
clock/16/13 (1200 baud if E = 2 MHz). This initial character is used to establish the
baud rate for the rest of the transfer and is not echoed to the transmitter as the remain-
ing characters are.
The user next downloads 256 bytes of program data, which will be put into on-chip
RAM beginning at address $0000. If the program to be loaded is less than 256 bytes,
dummy characters must be sent to make a total of 256 bytes. These 256 characters
are echoed out the SCI transmitter for the user to optionally verify that they were re-
ceived correctly. When the bootloader program receives the 256th byte, a jump is ex-
ecuted to location $0000, and the loaded program gains control.
Future M68HC11 Family derivatives could have additional features in the bootloader
program. One such feature is a variable-length download rather than the fixed-length,
256-byte download on the MC68HC11A8 version. This feature will probably be includ-
ed on M68HC11 members that have more than 256 bytes of on-chip RAM. The
MC68HC11E9 version has 512 bytes of RAM and includes a variable-length down-
load.
3.5.4.2 Executing User Programs in Bootstrap Mode
An often overlooked aspect of the bootstrap mode is that the bootloader firmware in
the bootstrap ROM executes after reset but before the user’s downloaded program be-
gins. Many users make the mistake of assuming all registers and I/O pins are still in
their reset state when their downloaded program starts. Actually, the bootloader firm-
ware has made some significant changes to the reset state of the MCU in the course
of its operation. Because the SCI receiver and transmitter have been enabled, the user
must disable them if the PD0 or PD1 pins are to be used as general-purpose I/O pins.
The port D wired-OR mode (DWOM) control bit in the SPCR has been written to one