Reply by 42Bastian Schick●March 14, 20072007-03-14
Charles
>> I can run my code on the microcontroller (leds,
joystick, uart) and
>> now I try to use interrupts. Has anybody a startup file (in assembler
>> for GNU compiler) for the AT91SAM7x256 with the use of interrupts??
> http://lejos.svn.sourceforge.net/viewvc/lejos/trunk/nxtvm/platform/nxt/
One hint to make life easier: A single interrupt handler instead of
the AIC method _but_ store into the SMR registers the index into
a table of ISRs.
void IrqDispatcher(int vn)
{
if ( isr[vn] ){
isr(vn); // Pass Vector to allow a single ISR
// for e.g. UART0 and UART1
} else {
panic("Illegal Interrupt:%d",vn);
}
}
Gain:
- Only one central place to save and restore working registers.
- No need to write wrapper functions for every interrupt.
- Easy way to supervise for unwanted interrupts.
--
42Bastian
Reply by Charles Manning●March 13, 20072007-03-13
On Wednesday 14 March 2007 02:49, you wrote: > I'm using the AT91SAM7X256 on the AT91SAM7x-EK
evaluation board.
>
> I can run my code on the microcontroller (leds, joystick, uart) and
> now I try to use interrupts. Has anybody a startup file (in assembler
> for GNU compiler) for the AT91SAM7x256 with the use of interrupts?? http://lejos.svn.sourceforge.net/viewvc/lejos/trunk/nxtvm/platform/nxt/
This is on the Lego NXT using a AT91SAM7S256 running approx 50,000 interrupts
per second.
Reply by boerrick●March 13, 20072007-03-13
I'm using the AT91SAM7X256 on the AT91SAM7x-EK evaluation board.
I can run my code on the microcontroller (leds, joystick, uart) and
now I try to use interrupts. Has anybody a startup file (in assembler
for GNU compiler) for the AT91SAM7x256 with the use of interrupts??
I've made my own crt.s but it is not working, why, I have no idea!