English
Language : 

MC68HC16Z1CPV16 Datasheet, PDF (469/500 Pages) Freescale Semiconductor, Inc – Symbols and Operators, CPU16 Register Mnemonics
Freescale Semiconductor, Inc.
STD
SCCR1
;enable SCI receiver and transmitter
LDAB
TBZK
LDZ
#$01
#$0000
;point ZK at bank 1 (the SRAM)
;for indexing the variables CNT and DLY
CNT
EQU
$0000
DLY
EQU
$0002
;loop counter
;delay counter
***** Main Program *****
MAIN:
NOT_L:
LOOP1:
LDAB
STAB
BRCLR
LDD
STD
JSR
LDX
JSR
LDAB
STAB
LDX
JSR
DEC
BNE
#$7F
;set clock speed to 16.777MHz
SYNCR
;w=0, x=1, y=111111
SYNCR+1,#8,NOT_L ;wait until synthesizer lock bit is set
#$01B5
SCCR0
;set baud rate to 1200
DELAY
;delay for modulus counter of SCI to flush
#STRING
;load address of string into IX
SEND_STRING
;subroutine to send string to dummy terminal
#$05
;set up loop counter
CNT,Z
#SEC_STR
;load address of string into IX
SEND_STRING
;subroutine to send string to dummy terminal
CNT,Z
;decrement loop counter
LOOP1
;loop 5 times
LOOP2:
LOOP3:
LDAB
STAB
BRCLR
LDD
STD
JSR
LDX
JSR
LDAB
STAB
LDX
JSR
DEC
BNE
#$4F
;change clock frequency to 4.194MHz
SYNCR
;w=0, x=1, y=001111
SYNCR+1,#8,LOOP2 ;wait until synthesizer lock bit is set
#$006D
SCCR0
;set BAUD rate back to 1200
DELAY
;delay for modulus counter of SCI to flush
#STRING2
;load address of string into IX
SEND_STRING
;subroutine to send string to dummy terminal
#$05
;set up # of loops for loop counter to 5
CNT,Z
#SEC_STR
;load address of string into IX
SEND_STRING
;subroutine to send string to dummy terminal
CNT,Z
;decrement loop counter
LOOP3
;loop 5 times
LBRA MAIN
;branch back to main
***** Subroutines *****
DELAY: LDD
STD
LOOP4: DEC
BNE
RTS
#$FFFF
DLY,Z
DLY,Z
LOOP4
;delay loop
SEND_STRING:
LDAB
BEQ
0,X
STRING_DONE
;subroutine to send out the entire ASCII
;string
;get next byte in string as pointed to by IX
;if B=00, then message is done
M68HC16 Z SERIES
USER’S MANUAL
INITIALIZATION AND PROGRAMMING EXAMPLES
For More Information On This Product,
Go to: www.freescale.com
E-17