Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. 8254

8254

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    FlyingDancer
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups