Hi,
I am trying to use software interrupts for handling some special functions in supervisor mode. Even a call to an empty interrupt routine alone takes about 600 ms. The LED is blinking very slow. Normaly this procedure should take only a few cycles.
Code:
reset_vector:
ldr pc, =reset_handler // Reset
[...]
swi_vector:
ldr pc, =swi_handler // Software Interrupt
[...]
reset_handler:
// Enable Main Oscillator, Set PLL to 96 MHz, Set MCK to 48 MHz, Set up default interrupt handler
// Memory remap
// Stack init
// Copy data section
// Clear bss section
// branch to main
[...]
swi_handler:
movs pc, r14
Code:
int main(void) {
while (1) {
asm("swi #1");
PIOA->PIO_CODR = LED_A;
asm("swi #1");
PIOA->PIO_SODR = LED_A;
}
return 0;
}
Has someone any idea what can cause this problem?
(I am using a Atmel AT91SAM7A3 on the AT91SAM7A3-DK)
Thanks