M68HC16 Z SERIES
INITIALIZATION AND PROGRAMMING EXAMPLES
MOTOROLA
USER’S MANUAL
E-11
DC.W
BDM
;241
User Defined Interrupt Vector 186
DC.W
BDM
;242
User Defined Interrupt Vector 187
DC.W
BDM
;243
User Defined Interrupt Vector 188
DC.W
BDM
;244
User Defined Interrupt Vector 189
DC.W
BDM
;245
User Defined Interrupt Vector 190
DC.W
BDM
;246
User Defined Interrupt Vector 191
DC.W
BDM
;247
User Defined Interrupt Vector 192
DC.W
BDM
;248
User Defined Interrupt Vector 193
DC.W
BDM
;249
User Defined Interrupt Vector 194
DC.W
BDM
;250
User Defined Interrupt Vector 195
DC.W
BDM
;251
User Defined Interrupt Vector 196
DC.W
BDM
;252
User Defined Interrupt Vector 197
DC.W
BDM
;253
User Defined Interrupt Vector 198
DC.W
BDM
;254
User Defined Interrupt Vector 199
DC.W
BDM
;255
User Defined Interrupt Vector 200
E.1.4 INITSYS.ASM
*
Title : INITSYS
*
Description : Initialize & configure system including
*
the Software Watchdog and System Clock.
****************************************************************************
INITSYS:
;give initial values for extension registers
;and initialize system clock and COP
LDAB
#$0F
TBEK
; point EK to bank F for register access
LDAB
#$00
TBXK
; point XK to bank 0
TBYK
; point YK to bank 0
TBZK
; point ZK to bank 0
LDD
#$0003
; at reset, the CSBOOT block size is 512k.
STD
CSBARBT
; this line sets the block size to 64k
LDD
#$3830; async, both byte, R/W, AS, Zero WS, S/U SP, IPL all,
;AVEC off
STD
CSORBT
;
LDAA
#$7F
; w=0, x=1, y=111111
STAA
SYNCR
; set system clock to 16.78 Mhz
CLR
SYPCR
; turn COP (software watchdog) off,
; since COP is on after reset
E.1.5 INITRAM.ASM
*
Title : INITRAM
*
Description : Initialize the HC16's 1K internal SRAM
*
(put SRAM in memory map at $10000, bank 1)
*
and set the stack inside it.
*****************************************************************************
INITRAM:
;initialize internal SRAM and stack
LDD
#$0001
STD
RAMBAH
; store high ram array, bank 1
LDD
#$0000