[En-Nut-Discussion] Hi resolution timer isr in assembler

en-nut-discussion-admin at egnite.de en-nut-discussion-admin at egnite.de
Sat Jun 21 20:47:34 CEST 2003


Hi Thorsten;

This the exact same situation I ran into, although I stuck with C.

First I setup the timer:

 // set timer 2 to CTC mode, clock / 256 = 16uS
 TCCR2 = BV(WGM21) | BV(CS22);
 // Set output compare register to 30 = 480uS for now
 OCR2 = 30;
 // enable the output compare match interrupt
 TIMSK |= BV(OCIE2);

Then using AVR GCC, I setup the interrupt routine as :

SIGNAL(SIG_OUTPUT_COMPARE2)
{
 // code here
}

As for then calling the assembly routine, I think a function call in the
SIGNAL routine will work, although it has the extra indirection in there.

Cheers

Stephen Noftall

----- Original Message -----
From: <en-nut-discussion-admin at egnite.de>
To: <en-nut-discussion at egnite.de>
Sent: Saturday, June 21, 2003 11:20 AM
Subject: [En-Nut-Discussion] Hi resolution timer isr in assembler


> Hi,
>
> for multiplexing a big LED panel I need a fast timer ISR that does that
> task. I have written one in assembler but don't know how to hook it into
the
> main C program. Maybe someone has an example how to insert assembler code
> into C and how to hook it to the timer IRQ. There should be a possibility
to
> use a 4kB array of characters defined in the C program with that assembler
> code or vice versa.
>
> Thank you
> Thorsten
>
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo/en-nut-discussion




More information about the En-Nut-Discussion mailing list