1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Need help defining frequency

Discussion in 'C' started by muhahah, May 14, 2007.

  1. muhahah

    muhahah New Member

    Joined:
    May 14, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Last time I used C/C++ was several years ago, so I forgot most of what I knew then... What I need is hopefully very simple: a program that reads input (or writes) from LPT n times per second, where n is frequency (4-22 Khz, but this is less relevant). I have problems finding solutions for this problem on the internet, but I believe this is simply because I do not know how to ask google properly :)
    I suppose I should use the int_inp() function to read data and int_outp() to write, which is fairly simple (if there is a better solution, please let me know), so the only problem would be timing the executing of the function properly.

    Thanks to everybody in advance!
     
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    Communicating with LPT is implementation dependent. So is the ability to exercise precise time control at 22 Khz. If it's critical, you're going to have to, at least, get down to driver level. For a modern desktop multi-processing system, you might even need some hardware support.
     

Share This Page