M68HC16 Z SERIES
INITIALIZATION AND PROGRAMMING EXAMPLES
USER’S MANUAL
E-1
APPENDIX E
INITIALIZATION AND PROGRAMMING EXAMPLES
This section contains basic initialization programs and several programming exercises
using different M68HC16 Z-series modules. The purpose of these exercises is to pro-
vide the designer and programmer with a means to shorten design time. All of the pro-
grams were written to run on the M68HC16Z1EVB evaluation board. Refer to the
M68HC16Z1EVB Evaluation Board User’s Manual (M68HC16Z1EVB/D) for further in-
formation.
NOTE
These programs will also work on the Modular Evaluation Board
(MEVB) using a microcontroller personality board for the appropriate
Z-series derivative. See
APPENDIX C DEVELOPMENT SUPPORT
for more information on the MEVB.
E.1 Initialization Programs
The following initialization routines accompany the programming examples used in
this manual. For information on assembler commands and directives, refer to the
M68HC16Z1EVB Evaluation Board User’s Manual (M68HC16Z1EVB/D).
•
EQUATES.ASM — This program lists of all the MC68HC16 registers equated to
their memory address. This allows programmers to use the register name in their
programs, and then the assembler selects the correct memory address for that
register.
•
ORG00000.ASM — This program consists of five lines of code that set the reset
vector information into the proper locations.
•
ORG00008.ASM — This program initializes the interrupt/exception vectors
($0008 – $01FE). If an interrupt occurs requiring the use of any of these vectors,
program flow continues at the label “BDM”. The programmer must add code at
the label location to put the program running on the EVB16 into background de-
bug mode or some other appropriate routine.
•
INITSYS.ASM — This program consists of ten to twelve lines of code that initial-
ize the system clock, set the extension registers, and chip-selects. It also turns off
the COP (software watchdog) that is set to “on” after reset.
•
INITRAM.ASM — This program initializes the 1-Kbyte internal SRAM at $10000,
and sets the stack inside it.
•
INITSCI.ASM — This program initializes the SCI to transmit and receive at 9600
baud.
NOTE
These programs and others can be obtained from the
Freescale
web
site at http://www.
freescale.com
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
.
..