INITIALIZATION AND PROGRAMMING EXAMPLES
M68HC16 Z SERIES
E-12
USER’S MANUAL
STD RAMBAL ; store low ram array
CLR RAMMCR ; enable ram
LDAB #$01
TBSK ; set SK to bank 1 for system stack
LDS #$03FE ; put SP at top of 1k internal SRAM
E.1.6 INITSCI.ASM
* Title : INITSCI
* Description : Initialize the SCI to transmit and receive
* at 9600 baud.
*
*************************************************************************
INITSCI: ;initialize the SCI
LDD #$0037
STD SCCR0 ;set the SCI baud rate to 9600 baud
LDD #$000C
STD SCCR1 ;enable the SCI receiver and transmitter
E.2 Programming Examples
The following programming examples use different M68HC16 Z-series modules. All
programs 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.
Several of these programs send status messages using the SCI in the QSM on the
MC68HC16Z1, MC68CK16Z1, MC68CM16Z1, MC68HC16Z2, and MC68HC16Z3.
These programs can be made to function with SCIA in the MCCI on the MC68HC16Z4
and MC68CKZ4 as follows:
• Replace SCCR0 with SCCR0A.
• Replace SCCR1 with SCCR1A.
• Replace SCSR with SCSRA.
• Replace SCDR with SCDRA.
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
.
..