Drift in the system clock?
-
I have been working on a real time project which is highly dependent on the system clock of PC. But my team members are very much worried of the "Drift in the System Clock"? Can any body give some hint what it is and what are the solutions to come over this problem. Thanks in Advance Anil Kumar
-
I have been working on a real time project which is highly dependent on the system clock of PC. But my team members are very much worried of the "Drift in the System Clock"? Can any body give some hint what it is and what are the solutions to come over this problem. Thanks in Advance Anil Kumar
'Drift' is basically when the system clock deviates from the actual wall clock time. It can occur when the actual system clock interrupt period is different from that programmed in, or when handling of the clock interrupt is delayed, although this is unlikely since the clock interrupt has a high priority. The first can occur either through systemic errors such as a badly tuned clock circuit which always 'ticks' faster or slower than programmed, or simply through variation in the tick rate due to changes in the values of components with temperature. PC real-time clock circuits typically aren't very accurate. Windows NT-based operating systems support modifying the real-time clock adjustment - the amount added to the real-time clock at each clock interrupt. This feature is generally used to slowly correct a large error. This only affects the system clock, not the value returned by
GetTickCount
. The clock resolution can be varied by system; ClockRes[^] says mine is currently 15.625ms. Stability. What an interesting concept. -- Chris Maunder -
'Drift' is basically when the system clock deviates from the actual wall clock time. It can occur when the actual system clock interrupt period is different from that programmed in, or when handling of the clock interrupt is delayed, although this is unlikely since the clock interrupt has a high priority. The first can occur either through systemic errors such as a badly tuned clock circuit which always 'ticks' faster or slower than programmed, or simply through variation in the tick rate due to changes in the values of components with temperature. PC real-time clock circuits typically aren't very accurate. Windows NT-based operating systems support modifying the real-time clock adjustment - the amount added to the real-time clock at each clock interrupt. This feature is generally used to slowly correct a large error. This only affects the system clock, not the value returned by
GetTickCount
. The clock resolution can be varied by system; ClockRes[^] says mine is currently 15.625ms. Stability. What an interesting concept. -- Chris MaunderHi Mike, Thanks first for the reply,:-D As you have mentioned that Drift in the system clock is due to not Handling the clock interrupt properly(Not exactly at the programmed time sooner or later). If this is the case then in embedded systems like (Mobile phones and PDAs) where applications are very time critical then it is the responsibility of the RTOS to provide the best Clock or GetTickCOunt functionality. Specialy in my project where i am Handling the Audio/Video Synchronization i can ask my RTOS provider for this or if there is a way to know that drift at software level and compensate it. Any comment will be very useful. Regards Anil Kumar
-
Hi Mike, Thanks first for the reply,:-D As you have mentioned that Drift in the system clock is due to not Handling the clock interrupt properly(Not exactly at the programmed time sooner or later). If this is the case then in embedded systems like (Mobile phones and PDAs) where applications are very time critical then it is the responsibility of the RTOS to provide the best Clock or GetTickCOunt functionality. Specialy in my project where i am Handling the Audio/Video Synchronization i can ask my RTOS provider for this or if there is a way to know that drift at software level and compensate it. Any comment will be very useful. Regards Anil Kumar
Hi I know that the answer is related to HIGH-RESOLUTION-TIMER which sets windows timer exactly in correct 1 millisecond intervals. I don't know how to use or set it, you can search the internet. but I know that all mediaplayers, use this for audio/video sync. So search the internet for High Resolution Timer. hope it helps