English
Language : 

MC68HC16Z1CPV16 Datasheet, PDF (470/500 Pages) Freescale Semiconductor, Inc – Symbols and Operators, CPU16 Register Mnemonics
Freescale Semiconductor, Inc.
JSR
AIX
BRA
STRING_DONE:
JSR
RTS
SEND_CH
#$01
SEND_STRING
DELAY
;go send out the byte
;increment IX to point to the next byte
;loop back and do next byte in string
;wait for a moment
;go back to whence we came
SEND_CH:
LDAA
ANDA
BEQ
LOOP5:
LDAA
STD
LDAB
ANDB
BEQ
RTS
SCSR
#$01
SEND_CH
#$00
SCDR
SCSR+1
#$80
LOOP5
;subroutine to send out one byte to SCI
;read SCI status reg to check/clear TDRE bit
;check only the TDRE flag bit
;if TDR is not empty, go back to check it
;again
;clear A to send a full word to SCDR ($FFC0E)
;transmit one ASCII character to the screen
;test the TC bit (transfer complete)
;continue to wait until TC is set
;return to send_string subroutine
***** The STRINGs *****
STRING DC
SEC_STR DC
STRING2 DC
'The System Clock is now running at 16.777 MHz...',0a,0d,00
'check this out!',0a,0d,00,00
'The System Clock is now running at 4.194 MHz...',0a,0d,00
***** Interrupts/Exceptions *****
BDM: BGND
;exception vectors point here
;and put the user into background debug mode
E.2.1.4 Example 4 - Software Watchdog, Periodic Interrupt, and Autovector Demo
*
Description : This program demonstrates the software watchdog,
*
the periodic interrupt, and an autovector.
*
The periodic interrupt runs a clock which is updated
*
on the dummy terminal. Every eight seconds the COP
*
will force a reset unless IRQ6 is grounded. When IRQ6
*
is pulled low, an autovectored interrupt routine will
*
“feed” the watchdog with $55 and $AA, and the
*
clock will run without being reset on the dummy terminal.
*
*********************************************************************
INCLUDE
INCLUDE
INCLUDE
'EQUATES.ASM' ;table of EQUates for common registers
'ORG00000.ASM' ;initialize reset vectors
'ORG00008.ASM' ;initialize interrupt vectors
ORG
DC.W
ORG
DC.W
$002C
AUTOV
$0070
VECRT
;put address of autovector routine
;at the level 6 vector (IRQ6)
;put address of periodic interrupt routine
;at 1st user defined interrupt vector
E-18
INITIALIZATION AND PROGRAMMING EXAMPLES
For More Information On This Product,
Go to: www.freescale.com
M68HC16 Z SERIES
USER’S MANUAL