Using the timer
-
Hi I am controlling an electrical circuit using the computer through the computer ports. I am trying to capture a fast changing analog signal using sampling. So I am just enquiring about the maximum frequency that we could set the timer to using the following function: SetTimer(1, 2000, 0); I actually want the timer to interrupt every ten micro seconds (10uS). Is it possible with this type of timers. If not, can anyone guide me to a timer that is capable of doing so. Thanx in advance
-
Hi I am controlling an electrical circuit using the computer through the computer ports. I am trying to capture a fast changing analog signal using sampling. So I am just enquiring about the maximum frequency that we could set the timer to using the following function: SetTimer(1, 2000, 0); I actually want the timer to interrupt every ten micro seconds (10uS). Is it possible with this type of timers. If not, can anyone guide me to a timer that is capable of doing so. Thanx in advance
Timers are set in milliseconds and therefore do not have the resolution you require. I suggest that you use another thread to do this work. You could then use the high-resolution performance counters
QueryPerformanceCounter()
andQueryPerformanceFrequency()
to monitor the time. Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain) -
Timers are set in milliseconds and therefore do not have the resolution you require. I suggest that you use another thread to do this work. You could then use the high-resolution performance counters
QueryPerformanceCounter()
andQueryPerformanceFrequency()
to monitor the time. Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)Are these actually counters or are they functions that retrieve the frequeny and index of a counter? Check out this link plz. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/timers/timerreference/timerfunctions/queryperformancefrequency.asp
-
Are these actually counters or are they functions that retrieve the frequeny and index of a counter? Check out this link plz. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/timers/timerreference/timerfunctions/queryperformancefrequency.asp
I was suggesting that you uses the performance counter functions in order to write your own high-resolution timer. Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain) -
I was suggesting that you uses the performance counter functions in order to write your own high-resolution timer. Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)Ahhaaa.. Ok then, but these are useful functions as well, Thanx Ant.;)