Interrupt Question
From: Adam Caruso (Adam.Caruso_at_Marconi.com)
Date: 02/24/05
- Next message: Nicholas O. Lindan: "Re: x86 architecture concepts"
- Previous message: Nicholas O. Lindan: "Re: 8051 floating pt routines"
- Next in thread: Mike Harding: "Re: Interrupt Question"
- Reply: arya: "Re: Interrupt Question"
- Reply: s_subbarayan_at_rediffmail.com: "Re: Interrupt Question"
- Reply: Ulf Samuelsson: "Re: Interrupt Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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!
- Next message: Nicholas O. Lindan: "Re: x86 architecture concepts"
- Previous message: Nicholas O. Lindan: "Re: 8051 floating pt routines"
- Next in thread: Mike Harding: "Re: Interrupt Question"
- Reply: arya: "Re: Interrupt Question"
- Reply: s_subbarayan_at_rediffmail.com: "Re: Interrupt Question"
- Reply: Ulf Samuelsson: "Re: Interrupt Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|