Application Note
AN1060 — Rev. 1.0
MOTOROLA
217
Samples taken at [7] detect the failing edge of the start bit and verify it is
a logic 0. Samples taken at the middle of what the receiver interprets as
the first five bit times [8] detect logic 0s. The sample taken at the middle
of what the receiver interprets as bit 5 [9] may detect either a 0 or a 1
because the receive data has a rising transition at about this time. The
samples for bits 6 and 7 detect 1s, causing the receiver to think the
received character was $C0 or $E0 [10] at 7812 baud instead of the $FF
which was sent at 1200 baud. The stop bit sample detects a 1 as
expected [11], but this detection is actually in the middle of bit 0 of the
1200 baud $FF character. The SCI receiver is not confused by the rest
of the 1200 baud $FF character because the receive data line is high [12]
just as it would be for the idle condition. If a character other than $FF is
sent as the first character, an SCI receive error could result.
Main Bootloader Program
Figure 3
is a flowchart of the main bootloader program in the
MC68HC711E9. This bootloader demonstrates the most important
features of the bootloaders used on all M68HC11 Family members. For
complete listings of other M68HC11 versions, refer to
Listing 3.
MC68HC711E9 Bootloader ROM
at the end of this application note,
and to
Appendix B
of the
M68HC11 Reference Manual
, Motorola
document order number M68HC11RM/AD.
The reset vector in the boot ROM points to the start [1] of this program.
The initialization block [2] establishes starting conditions and sets up the
SCI and port D. The stack pointer is set because there are push and pull
instructions in the bootloader program. The X index register is pointed at
the start of the register block ($1000) so indexed addressing can be
used. Indexed addressing takes one less byte of ROM space than
extended instructions, and bit manipulation instructions are not available
in extended addressing forms. The port D wire-OR mode (DWOM) bit in
the serial peripheral interface control register (SPCR) is set to configure
port D for wired-OR operation to minimize potential conflicts with
external systems that use the PD1/TxD pin as an input. The baud rate
for the SCI is initially set to 7812 baud at a 2-MHz E-clock rate but can
automatically switch to 1200 baud based on the first character received.
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.