Hi,
I am having a Motorola HC12DG128 EVB and SDI cable. Using MCUEz as PC
interface.
I want to use PORTH key wakeup interrupt.
I coded the following program segment and the linker parameter file listed
at the end of the message.
When I executed the program and after giving a signal to the PortH, pin 0 it
gives an illegal break point error message and jumps to somewhere else.
Please tell me how to configure the interrupts when we use the SDI cable and
MCUEz software.
I have been trying this for few weeks without any success and please help as
soon as possible.
Thank you in advance.
Bandara
----
----
XDEF KWisr , entry
ConstData: SECTION
PORTH: EQU $0029 ;Select port H as inturrept pin numbers 52,51,50,49
DDRH: EQU $002B ;Data Direction registor port H
KWIEH: EQU $002D ;Key wakeup intrrupt enable reg port H
KWIFH: EQU $002F ;Key wakeup intrrupt flag reg port H
initStk: EQU $2E00 ;initialiation the stak
KWHVEC: EQU $FFCE ;Vector keywakeup port H
RSTVEC: EQU $FFEF ;vector reset
KWHNUM: EQU 7 ;Number of Key Wakeup H
SetVect: EQU $FE1A
PUCR: EQU $000C
ALLBITS: EQU %11111111
BIT_0: EQU %00000001
PORTBIT: EQU %01000000
;
datasec: SECTION
codesec: SECTION
entry:
lds #initStk
bclr DDRH,ALLBITS ;make bit inputs
ldaa #BIT_0
staa KWIFH ;Clear pending flags
bset PUCR,PORTBIT
bclr KWIEH,ALLBITS
bset KWIEH,BIT_0
cli ;unmask HC12 intrrupts
Foreground:
;nop
wai
;bra Foreground
KWisr: ;here goes isr
ldd #$45ac ;simple instruction i handle here
ldd #$4555
rti
Linker Parameter file:
----
-----------------------
LINK INTRR.abs
NAMES
INTRR.o
END
SEGMENTS
MY_ROM1 = READ_ONLY 0x2000 TO 0x22FF;
MY_RAM1 = READ_WRITE 0x2300 TO 0x24FF;
MY_STK1 = READ_WRITE 0x2500 TO 0x2C00;
END
PLACEMENT
datasec,.data INTO MY_RAM1;
ConstData INTO MY_ROM1;
codesec,.text INTO MY_ROM1;
.stack INTO MY_STK1;
END
INIT entry
VECTOR ADDRESS 0xF7CE KWisr
VECTOR ADDRESS 0xFFFE entry
|