AT91: System Timer Interrupt

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Hi,

Im working on a project involving the AT91rm9200. Im trying to generate
interrupts through the System Timer`s Periodic Interval Timer. Its not
working the way i want it to. Im getting periodic interrupts all right,
but im not able shut it off properly. I keep getting timer interrupts
continuously..the code of my C interrupt handler is below: (as may be
evident, im using atmel`s pre-canned asm routines in the file irq.mac
for backstage interrupt handling, but the C routines are mine )

void timer_c_irq_handler()
{
//Dummy variable used for clearing ST_SR
volatile int status;

AT91PS_ST pST 3D% AT91C_BASE_ST;

//read ST_SR
status 3D% pST->ST_SR;

//clear the interrupt for re-use
AT91F_AIC_ClearIt( AT91C_BASE_AIC,AT91C_ID_SYS );

//Disable interrupts by the timer
//AT91F_ST_DisableIt( AT91C_BASE_ST, AT91C_ST_PITS );

AT91F_DBGU_Printk("\n\rSystem Timer interrupt..\n\r");

}

As u can see, im trying to clear the ST_SR registe`s PITS bit by
reading it after the interrupt has occured..this is because the manual
says:

B7% PITS: Period Interval Timer Status
0 3D% The period interval timer has not reached 0 since the last read of
the Status Register.
1 3D% The period interval timer has reached 0 since the last read of the
Status Register.

So shouldnt PITS go to 0 if i read it again in the irq handler above,
and stop bothering the AIC? Everything works fine if i uncomment the
"DisableIt" function call, but just want to be clear about where im
going wrong.

Thanx in anticipation

Mayank


Site Timeline