help with D60 Pulse Accum interrupts

Started by Wade A Smith March 23, 2004
The tip for timer interrupts was the key
(dont use BSET to clear interrupt flags)
and it works now. I *thought* that I had
Pulse Accum working. Once the Timer Interrupts
were working it became clear that the Pulse Accum
was not working.

I am working with a 912D60 board from AxMan.com

RAM starts at $0000
I/O Regis start at $0800
EEPROM starts at $0C00

I load a small "hello world" type of assembly program starting at $1000.
The timers work OK.

START:
MOVB #08,$11 ; post-reset location of INITRG
NOP ; rqt of moving the EEPROM base address.
MOVB #00,INITRM
NOP ; rqt of moving the EEPROM base address.
MOVB #EEON,INITEE ; move the base address of the EEPROM
(000-0fff) + EEON.
NOP ; rqt of moving the EEPROM base address.
MOVB #$0C,PEAR
MOVB #$F0,MODE
MOVB #$73,MISC ; Flash on, p-sel stretch = 3
<snip>
CLR PACN3
CLR PACN2
CLR PACN1
CLR PACN0
MOVB #$7f DDRT ; set to all outputs EXCEPT PR& (PulseAccum)
MOVB #$00 PORTT ; set all outputs LO
<snip>
MOVB #$FF TFLG1
BCLR RTICTL RSWAI+RSBCK ; allow RTI & COP to continue in wait
& Bkgd.
MOVB #$00 TMSK2
MOVB #$00 TCTL1 ; set PortT timers disconnected from
output pins
MOVB #$00 TCTL2 ; set PortT timers disconnected from
output pins
MOVB #$00 TCTL3 ; set PortT input capture disabled
(default)
MOVB #$00 TCTL4 ; set PortT input capture disabled
(default)
<snip>
LDAB #TEN+TFFCA ; enable timer & select fast flag
clear.
STAB TSCR
MOVB #$1E,TIOS ; config channel 1-4 as OC
<snip>
;SETUP FOR FIRST PULSE ACCUMULATOR OVERFLOW INTERRUPT
LDAA #PAOVF ; PAOVF = $02
; LDAA #(PAOVF+PAIF)
STAA PAFLG ; CLEAR PULSE ACCUMULATOR OVERFLOW FLAG
LDAA #(PAEN+PEDGE+PAOVI)
; LDAA #(PAEN+PEDGE+PAOVI+PAI)
STAA PACTL ; LOCALLY ENABLE PULSE ACC. OVERFLOW INTERRUPT

LDX #PAOVINT ; Pulse Accumulator overflow
STX $061C ; required by AxMan.com board
LDX #PAIEINT ; Pulse Accumulator input edge
STX $061A ; required by AxMan.com board

CLI ; enable cpu interrupts.

;******* start of main loop *******

<snip>
PAOVINT MOVB #$03 PAFLG ; CLEAR PULSE ACCUMULATOR OVERFLOW
FLAG
CLR PACN3
CLR PACN2
INC PNTFLG
PAOVINTB RTI

;;--------------------- Pulse Accum Input Edge
PAIEINT MOVB #PAIF,PAFLG ; CLEAR PULSE ACCUMULATOR OVERFLOW
FLAG
LDD PULSECTR
ADDD #1
STD PULSECTR
PAIEINT99 RTI
<snip>

-------------------- OK. what am I doing wrong THIS time?

Wade in Flour-dough the shoe-shine state