Interrupt Question

From: Adam Caruso (Adam.Caruso_at_Marconi.com)
Date: 02/24/05


Date: Thu, 24 Feb 2005 15:14:02 -0500

I recently encountered a problem, that I am having difficulty solving. Can
any please shed some light on this topic?

There is a hardware timer counter, which counts from 0 to 59. When it
rollovers from 59 to 0 it will trigger an interrupt handler ISR1.

TS=0;

ISR1( ) ( will increase TS by 1).
{
   #### A
   TS++;
}

There is another interrupt handler ISR2, which can happen at anytime and has
a higher priority than ISR1. ISR2 will want to get the exact time from the
TS value and also the value of the hardware counter.

ISR2( )
{

...
GetTime();
...

}

What is a good way to implement this?

If ISR2 preempts ISR1 at instruction #### A, will it be able to get the
correct values of TS and the hardware counter?

For example:
If the hardware counter is at 0 and TS should be at 100, how do I ensure
that I retrieve hardware counter 0 and TS=100 and not hardware counter 0 and
TS=99.

Thanks!



Relevant Pages

  • Re: Interrupt Question
    ... > There is another interrupt handler ISR2, ... > TS value and also the value of the hardware counter. ... increamenting the value of TS to pend for it.At the task what ever I am ... masking is enabled then theres no question of ISR2 preempting ISR1.So ...
    (comp.arch.embedded)
  • Re: Interrupt Question
    ... >There is another interrupt handler ISR2, which can happen at anytime and has ... >TS value and also the value of the hardware counter. ... Mike Harding ...
    (comp.arch.embedded)