Home |
RTKernel-32 Programming Manual Multitasking, Real-Time, and RTKernel-32 Alternate APIs for RTKernel-32 Driver HRTPENT Preconfigured Driver Library Drvrt32.lib |
Driver HRTPENTApplications that will always run on Pentium or higher CPUs can use this driver for high resolution time values. Pentium and higher CPUs contain a 64-bit counter register which is incremented in every clock cycle. The resolution of the Pentium timer is far superior to the 8253 and reading the timer register is much faster. The only disadvantage is that the timer will run at different speeds, depending on the CPU's clock rate. At program initialization, the driver tries to determine the CPU's clock rate using function RTSMBIOSGetCPUSpeed. If that fails, a default value of 120MHz is used. The application should then calibrate the driver either manually by calling function FTSetResolution or with function FTCalibrate, as demonstrated by program RTBenchP. Please note that on some multiprocessor systems, the Time Stamp Counter registers on each CPU may drift apart. This can cause problems for tasks which may start to measure a time period while running on one CPU and then read the time on some other CPU later on. To avoid large drifts, RTTarget-32 API function RTMPSynchTimeStampCounters can be called periodically. Alternatively, all multiprocessor targets will also have an ACPI BIOS and thus support the HRTPM or HRTHPET driver. Requirements: Intel Pentium or higher CPU. Incompatible with clock driver CLKHRTPC (use CLKPC or CLKAPIC instead).
|