1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

AT91: System Timer Interrupt

Discussion in 'Embedded' started by Mayank Kaushik, Jan 11, 2005.

  1. 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 = AT91C_BASE_ST;

    //read ST_SR
    status = 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

    · PITS: Period Interval Timer Status
    0 = The period interval timer has not reached 0 since the last read of
    the Status Register.
    1 = 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 Kaushik, Jan 11, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.