English
Language : 

MC68HC16Z1CPV16 Datasheet, PDF (478/500 Pages) Freescale Semiconductor, Inc – Symbols and Operators, CPU16 Register Mnemonics
Freescale Semiconductor, Inc.
*
has overflowed ten times.
*
****************************************************************************
INCLUDE
INCLUDE
INCLUDE
'EQUATES.ASM'
'ORG00000.ASM'
'ORG00008.ASM'
;table of EQUates for common register
;addresses
;initialize reset vector
;initialize interrupt vectors
*
We are choosing User Defined Interrupt Vector 9 (interrupt vector 64
*
at address $0080) to be the base vector number (VBA) for the GPT
*
because the least significant nibble in the address must be a $0.
*
*
The VBA should be reflected in the GPT Interrupt Configuration
*
Register (ICR) at $YFF904.
ORG
$0080
;Address for interrupt vector 64
DC.W
DC.W
DC.W
DC.W
DC.W
DC.W
DC.W
DC.W
DC.W
DC.W
DC.W
DC.W
PAOV_ROUTINE
IC1_ROUTINE
IC2_ROUTINE
IC3_ROUTINE
BDM
OC2_ROUTINE
BDM
BDM
BDM
BDM
BDM
BDM
;Adjusted Priority Channel -- PAC
;Input Capture 1
;Input Capture 2
;Input Capture 3
;Output Compare 1
;Output Compare 2
;Output Compare 3
;Output Compare 4
;Input Capture 4 / Output Compare 5
;Timer Overflow
;Pulse Accumulator Overflow -- elevated
;Pulse Accumulator Input
ORG
$0200
;start program after interrupt vectors
***** Initialization Routines *****
INCLUDE
COP
INCLUDE
INCLUDE
'INITSYS.ASM' ;initially set EK=F, XK=0, YK=0, ZK=0
;set sys clock at 16.78 MHz, disable
'INITRAM.ASM'
'INITSCI.ASM'
;turn on 1k internal SRAM at $10000
;set stack in bank 1 (SK=1, SP=03FE)
;set SCI baud rate at 9600
;enable SCI transmitter and receiver
*
Set up the interrupts
LDD
#$008E
STD
GPTMCR
LDD
#$A640
STD
ICR
LDAB
STAB
LDAB
#$17
TMSK1
#$25
;Give the GPT an IARB of $E
;so we can generate interrupts
;elevate interrupt priority of PAOV,
;set GPT IRQ level to 6,
;& assign vector 64 (User vector 9) of the
;interrupt/exception vector table as the
;GPT's Interrupt Vector Base Address
;set OC2, IC1, IC2, IC3 to generate interrupts
;set PAC Overflows to generate interrupts
E-26
INITIALIZATION AND PROGRAMMING EXAMPLES
For More Information On This Product,
Go to: www.freescale.com
M68HC16 Z SERIES
USER’S MANUAL