Sign in

username:

password:



Not a member?

Search m68hc11



Search tips

Subscribe to m68hc11



m68hc11 by Keywords

27c256 | 4K81H | 68HC11A1 | 68HC11P1 | 68hc24 | 68HC711E9 | 68HC811 | 8255 | A2D | ADC | ADC12138 | Am85C30 | BRCLR | Buffalo | CMOS | EEPROM | EPROM | Ethernet | EVB | EVBU | HC11E1 | HC11E9 | HC711E9 | Horray | ImageCraft | IRQ | Keypad | LCD | MC68HC11D0FN | MC68HC11E1CFU3 | MC68HC11F1 | MC68HC711E9 | MC68HC711E9CFN2 | Microcore11 | Microstamp11 | Minikit | NVRAM | PSD | PSD8xx | PSD9xx | PT1000 | RS232 | RTS | RXD | SPI | SRAM | TXD | Watchdogs | XIRQ


Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | | problem with time program

problem with time program - ckbatnr - Oct 1 8:05:00 2003

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.






(You need to be a member of m68hc11 -- send a blank email to m68hc11-subscribe@yahoogroups.com )


Re: problem with time program - ckbatnr - Oct 1 14:26:00 2003

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.


______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of m68hc11 -- send a blank email to m68hc11-subscribe@yahoogroups.com )

RE: Re: problem with time program - Redd, Emmett R - Oct 1 16:29:00 2003

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 need to be a member of m68hc11 -- send a blank email to m68hc11-subscribe@yahoogroups.com )

Re: problem with time program - ckbatnr - Oct 4 16:21:00 2003

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:
> >
> >
> >
> >
> >
>




(You need to be a member of m68hc11 -- send a blank email to m68hc11-subscribe@yahoogroups.com )

RE: Re: problem with time program - Redd, Emmett R - Oct 5 18:35:00 2003

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...



______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of m68hc11 -- send a blank email to m68hc11-subscribe@yahoogroups.com )