hello again,
now I'm able to turn on the leds on my AT91RM9200 board, but I'm not able to work with interrupts - I don't know if the problem is the code or the problem is still in the startup file? Is there a chance to get to know where the problem is?
I work with GNU compiler and that's my code for the interrupt... when I press the Halt button the yellow arrow stands at the position
0x00000018 EAFFFFFE B 0x00000018 (which is the irq-handler in the startup file)
the whole code in my main routine (timer interrupt) is
void ST_interrupt (void)__attribute__ ((interrupt)); void ST_interrupt(void) { AT91C_BASE_PIOC->PIO_OER = AT91C_PIO_PC0 | AT91C_PIO_PC1; AT91C_BASE_PIOC->PIO_PER = AT91C_PIO_PC0 | AT91C_PIO_PC1; xyz->PIOD_PPUDR = AT91C_PIO_PC0 | AT91C_PIO_PC1; AT91C_BASE_AIC->AIC_EOICR = AT91C_BASE_ST->ST_SR; } int main(void) { volatile int period; //config AIC AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SYS, AT91C_AIC_PRIOR_HIGHEST - 6, AT91C_AIC_SRCTYPE_INT_LEVEL_SENSITIVE, (void (*) ())ST_interrupt); period = 10000000; //delay in ms AT91F_ST_SetPeriodInterval(AT91C_BASE_ST, period); AT91F_AIC_EnableIt( AT91C_BASE_AIC, AT91C_ID_SYS); AT91F_ST_EnableIt(AT91C_BASE_ST, AT91C_ST_PITS); while(1); }
I also tested the version with the following:
AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SYS, AT91C_AIC_PRIOR_HIGHEST - 6, AT91C_AIC_SRCTYPE_INT_LEVEL_SENSITIVE, (&ST_interrupt);
But the result is always the same... In another thread I read that I must define the interrupt handler in the startup file, but when I take a look into the interupt example for the gnu compiler which comes with the keil enviroment - there are no changes...
I hope anybody could help me - if the problem could be in the startup file or if the startup file should be ok, when I'm able to turn on leds...
best regards Johannes