This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ISR System timer

Hello,

I've installed a system timer (AT91RM9200 controller) - which runs without problems... I use this timer for several things.

Now I have critical code areas (only two lines of code) where no interrupt (of the st timer) is allowed to occur.

So (of course) I could disable the interrupts and after the critical code area I could enable the interrupts - but the problem is, that the interupt occurs only every one minute - so if I disable interrupts when the interrupt would occured in approximately 2 secs - and I need 4 sec until I could enable the interrupts again -> then I have to waite nearly one minute again that the next interupt occured... -> that's too long

Is there a possibility to know after the critical code area, if there was a interrupt (st timer)? so that the ISR is called (immediately) after the critical code area?

best regards
Johannes

Parents
  • thanks for the fast reply...

    What do you do that requires a two second long critical section

    the time should only describe my problem a little bit better - the critical section includes only one if() question and set a bit to default - thats it....

    If you by "disable interrupts" means the global interrupt-enable flag, then you will not loose the timer interrupt

    I would use the mask register of the st timer (period interval timer) - so that the Watchdog which is using the same timer would work during the critical section too....

    It is only if you disable the interrupt generation for the timer that you will loose the timer interrupt

    What do you mean by interrupt generation for the timer? The timer has only a status register - if you read the PITs timer status - so you could see if a timer overflow occured since the last read.

    best regards
    Johannes

Reply
  • thanks for the fast reply...

    What do you do that requires a two second long critical section

    the time should only describe my problem a little bit better - the critical section includes only one if() question and set a bit to default - thats it....

    If you by "disable interrupts" means the global interrupt-enable flag, then you will not loose the timer interrupt

    I would use the mask register of the st timer (period interval timer) - so that the Watchdog which is using the same timer would work during the critical section too....

    It is only if you disable the interrupt generation for the timer that you will loose the timer interrupt

    What do you mean by interrupt generation for the timer? The timer has only a status register - if you read the PITs timer status - so you could see if a timer overflow occured since the last read.

    best regards
    Johannes

Children
No data