8254
-
Here is a code to figure out timer0's frequency of 8254 (1)First, llCountOfBegin=KeQueryPerformanceCounter(&llFreq); wCount2=ReadCount8254(0);//read timer0 count while (lCountINT8<500)//wCount2 is the current count, //wCount1 the former count { wCount1=wCount2; wCount2=ReadCount8254(0); if(wCount2>wCount1) lCountINT8++; } llCountOfEnd=KeQueryPerformanceCounter(&llFreq); lTemp=(ULONG)(llCountOfEnd.QuadPart-llCountOfBegin.QuadPart); (2)Then the frequency is freq=lCountINT8*llFreq.lFrqForCmpCount/lTemp; However, there is a problem. The frequency that is evaluated in this way is twice of the theoretic value When I write an initial count(lCount) into timer0's counter. The theoretic value is: 1,193,200/lCount. My test env is windows2000/xp. Do you know the reason and how to solve this problem? Thanks for your attention!