|
I have the following program loaded on a Adapt11C24DXEVB Module which uses the hc11e9 microcontroller. I am trying to output a clock signal on OC4. However, no matter what I change the ADDD # to I always get the same clock output which is at 15.6Hz. Any help would be appreciated. ;generate delay using OC4s SBASE EQU $DFFF REGS EQU $1000 ; registers and offsets TCNT EQU $0E TFLG1 EQU $23 TOC2 EQU $18 TOC4 EQU $1C TCTL1 EQU $20 TCTL2 EQU $21 TMSK1 EQU $22 ; timer mask register OC2F EQU $40 ; output compare 2 flag OC2I EQU $40 ; output compare interrupte enable OC4F EQU $10 OC4I EQU $10 RAM equ $0000 ORG $B600 init SEI ; DISABLE INTERRUPTS LDX #REGS LDD TCNT,X ;ADDD #600 ? STD TOC4,X ; UPDATE TOC2 = TCNT + 833 ldaa #$0C ; om2:ol2 = 1:1 to set OC2 high first time staa TCTL1,X LDAA #$10 STAA TMSK1,X ; ARMS INTERRUPT STAA TFLG1,X ; "ACK" ANY PREVIOUS INTERRUPT CLI ; enable INTERRUPTs LOOP WAI ; WAIT FOR INTERRUPT BRA LOOP OC4ISR LDX #REGS bclr TCTL1,X,$04 ; Make OM4, OL4 = 01 (Toggle PA4) LDD TOC4,X ADDD #600 ;ADD 833 CLOCK CYCLES STD TOC4,X ldaa TCTL1,X ; INVERT OL2 TO TOGGLE eora #$04 staa TCTL1,X bclr TFLG1,X,$EF ; "ACK" ANY PREVIOUS INTERRUPT rti org $FFE2 FDB OC4ISR ;TOC4_VECT org $FFFE fdb init Thanks. |
|
|
|
I figured out my problem. My interrupt was not being caught because I am using the Buffalo monitor which means I should have entered the following for my interrupt vector: org $00DC FDB OC4ISR ;TOC4_VECT --- In , "ckbatnr" <brewton@v...> wrote: > I have the following program loaded on a Adapt11C24DXEVB Module > which uses the hc11e9 microcontroller. I am trying to output a > clock signal on OC4. However, no matter what I change the ADDD # to > I always get the same clock output which is at 15.6Hz. Any help > would be appreciated. > > ;generate delay using OC4s > > SBASE EQU $DFFF > > REGS EQU $1000 ; registers and offsets > > TCNT EQU $0E > TFLG1 EQU $23 > TOC2 EQU $18 > TOC4 EQU $1C > TCTL1 EQU $20 > TCTL2 EQU $21 > TMSK1 EQU $22 ; timer mask register > > OC2F EQU $40 ; output compare 2 flag > OC2I EQU $40 ; output compare interrupte enable > OC4F EQU $10 > OC4I EQU $10 > RAM equ $0000 > > ORG $B600 > init SEI ; DISABLE INTERRUPTS > LDX #REGS > LDD TCNT,X ;ADDD #600 ? > STD TOC4,X ; UPDATE TOC2 = TCNT + 833 > ldaa #$0C ; om2:ol2 = 1:1 to set OC2 high > first time > staa TCTL1,X > LDAA #$10 > STAA TMSK1,X ; ARMS INTERRUPT > STAA TFLG1,X ; "ACK" ANY PREVIOUS INTERRUPT > CLI ; enable INTERRUPTs > > LOOP WAI ; WAIT FOR INTERRUPT > BRA LOOP > > OC4ISR LDX #REGS > bclr TCTL1,X,$04 ; Make OM4, OL4 = 01 (Toggle PA4) > LDD TOC4,X > ADDD #600 ;ADD 833 CLOCK CYCLES > STD TOC4,X > ldaa TCTL1,X ; INVERT OL2 TO TOGGLE > eora #$04 > staa TCTL1,X > bclr TFLG1,X,$EF ; "ACK" ANY PREVIOUS INTERRUPT > rti > > org $FFE2 > FDB OC4ISR ;TOC4_VECT > > org $FFFE > fdb init > > Thanks. |
|
My copy of BUFFALO has JTOC4 at $D6, i.e. ORG $D6 JTOC4 JMP OC4ISR Also, this only works at compile time and the code is downloaded afresh after every powerdown. If the program is in autorun mode, the program itself must store the bytes that make up the instruction into RAM there. Emmett Redd Ph.D. mailto: Associate Professor (417)836-5221 Department of Physics, Astronomy, and Material Science Southwest Missouri State University Fax (417)836-6226 901 SOUTH NATIONAL Dept (417)836-5131 SPRINGFIELD, MO 65804 USA > -----Original Message----- > From: ckbatnr [mailto:] > Sent: Wednesday, October 01, 2003 2:26 PM > To: > Subject: [m68HC11] Re: problem with time program > > I figured out my problem. My interrupt was not being caught because > I am using the Buffalo monitor which means I should have entered the > following for my interrupt vector: > > org $00DC > FDB OC4ISR ;TOC4_VECT > --- In , "ckbatnr" <brewton@v...> wrote: > > I have the following program loaded on a Adapt11C24DXEVB Module > > which uses the hc11e9 microcontroller. I am trying to output a > > clock signal on OC4. However, no matter what I change the ADDD # > to > > I always get the same clock output which is at 15.6Hz. Any help > > would be appreciated. > > > > ;generate delay using OC4s > > > > SBASE EQU $DFFF > > > > REGS EQU $1000 ; registers and offsets > > > > TCNT EQU $0E > > TFLG1 EQU $23 > > TOC2 EQU $18 > > TOC4 EQU $1C > > TCTL1 EQU $20 > > TCTL2 EQU $21 > > TMSK1 EQU $22 ; timer mask register > > > > OC2F EQU $40 ; output compare 2 flag > > OC2I EQU $40 ; output compare interrupte enable > > OC4F EQU $10 > > OC4I EQU $10 > > RAM equ $0000 > > > > ORG $B600 > > init SEI ; DISABLE INTERRUPTS > > LDX #REGS > > LDD TCNT,X ;ADDD #600 ? > > STD TOC4,X ; UPDATE TOC2 = TCNT + 833 > > ldaa #$0C ; om2:ol2 = 1:1 to set OC2 high > > first time > > staa TCTL1,X > > LDAA #$10 > > STAA TMSK1,X ; ARMS INTERRUPT > > STAA TFLG1,X ; "ACK" ANY PREVIOUS INTERRUPT > > CLI ; enable INTERRUPTs > > > > LOOP WAI ; WAIT FOR INTERRUPT > > BRA LOOP > > > > OC4ISR LDX #REGS > > bclr TCTL1,X,$04 ; Make OM4, OL4 = 01 (Toggle PA4) > > LDD TOC4,X > > ADDD #600 ;ADD 833 CLOCK CYCLES > > STD TOC4,X > > ldaa TCTL1,X ; INVERT OL2 TO TOGGLE > > eora #$04 > > staa TCTL1,X > > bclr TFLG1,X,$EF ; "ACK" ANY PREVIOUS INTERRUPT > > rti > > > > org $FFE2 > > FDB OC4ISR ;TOC4_VECT > > > > org $FFFE > > fdb init > > > > Thanks. > ------------------------ Yahoo! Groups Sponsor > > To unsubscribe from this group, send an email to: |
|
|
|
you are correct, OC4 interrupt is at $D6. I typed it incorrectly in my original message. Is it correct to assume if you disable BUFFALO that you can use the hc11 interrupt locations (i.e. OC4 interrrupt would be at $FFE2? --- In , "Redd, Emmett R" <err557f@s...> wrote: > My copy of BUFFALO has JTOC4 at $D6, i.e. > > ORG $D6 > JTOC4 JMP OC4ISR > > Also, this only works at compile time and the code is downloaded afresh > after every powerdown. If the program is in autorun mode, the program > itself must store the bytes that make up the instruction into RAM there. > > Emmett Redd Ph.D. mailto:EmmettRedd@s... > Associate Professor (417)836-5221 > Department of Physics, Astronomy, and Material Science > Southwest Missouri State University Fax (417)836-6226 > 901 SOUTH NATIONAL Dept (417)836-5131 > SPRINGFIELD, MO 65804 USA > > > -----Original Message----- > > From: ckbatnr [mailto:brewton@v...] > > Sent: Wednesday, October 01, 2003 2:26 PM > > To: > > Subject: [m68HC11] Re: problem with time program > > > > I figured out my problem. My interrupt was not being caught because > > I am using the Buffalo monitor which means I should have entered the > > following for my interrupt vector: > > > > org $00DC > > FDB OC4ISR ;TOC4_VECT > > > > > > --- In , "ckbatnr" <brewton@v...> wrote: > > > I have the following program loaded on a Adapt11C24DXEVB Module > > > which uses the hc11e9 microcontroller. I am trying to output a > > > clock signal on OC4. However, no matter what I change the ADDD # > > to > > > I always get the same clock output which is at 15.6Hz. Any help > > > would be appreciated. > > > > > > ;generate delay using OC4s > > > > > > SBASE EQU $DFFF > > > > > > REGS EQU $1000 ; registers and offsets > > > > > > TCNT EQU $0E > > > TFLG1 EQU $23 > > > TOC2 EQU $18 > > > TOC4 EQU $1C > > > TCTL1 EQU $20 > > > TCTL2 EQU $21 > > > TMSK1 EQU $22 ; timer mask register > > > > > > OC2F EQU $40 ; output compare 2 flag > > > OC2I EQU $40 ; output compare interrupte > enable > > > OC4F EQU $10 > > > OC4I EQU $10 > > > RAM equ $0000 > > > > > > ORG $B600 > > > init SEI ; DISABLE INTERRUPTS > > > LDX #REGS > > > LDD TCNT,X ;ADDD #600 ? > > > STD TOC4,X ; UPDATE TOC2 = TCNT + 833 > > > ldaa #$0C ; om2:ol2 = 1:1 to set OC2 high > > > first time > > > staa TCTL1,X > > > LDAA #$10 > > > STAA TMSK1,X ; ARMS INTERRUPT > > > STAA TFLG1,X ; "ACK" ANY PREVIOUS INTERRUPT > > > CLI ; enable INTERRUPTs > > > > > > LOOP WAI ; WAIT FOR INTERRUPT > > > BRA LOOP > > > > > > OC4ISR LDX #REGS > > > bclr TCTL1,X,$04 ; Make OM4, OL4 = 01 (Toggle PA4) > > > LDD TOC4,X > > > ADDD #600 ;ADD 833 CLOCK CYCLES > > > STD TOC4,X > > > ldaa TCTL1,X ; INVERT OL2 TO TOGGLE > > > eora #$04 > > > staa TCTL1,X > > > bclr TFLG1,X,$EF ; "ACK" ANY PREVIOUS INTERRUPT > > > rti > > > > > > org $FFE2 > > > FDB OC4ISR ;TOC4_VECT > > > > > > org $FFFE > > > fdb init > > > > > > Thanks. > > > > > > ------------------------ Yahoo! Groups Sponsor > > > > To unsubscribe from this group, send an email to: > > > > > > > > > > > |
|
What exactly do you mean "disable BUFFALO"? Emmett Redd Ph.D. mailto: > Subject: [m68HC11] Re: problem with time program > > you are correct, OC4 interrupt is at $D6. I typed it incorrectly in > my original message. > > Is it correct to assume if you disable BUFFALO that you can use the > hc11 interrupt locations (i.e. OC4 interrrupt would be at $FFE2? > > --- In , "Redd, Emmett R" <err557f@s...> > wrote: > > My copy of BUFFALO has JTOC4 at $D6, i.e. > > > > ORG $D6 > > JTOC4 JMP OC4ISR > > > > Also, this only works at compile time and the code is downloaded > afresh > > after every powerdown. If the program is in autorun mode, the > program > > itself must store the bytes that make up the instruction into RAM > there. > > > > Emmett Redd Ph.D. mailto:EmmettRedd@s... |