CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: timer question

  1. #1
    Join Date
    Apr 2004
    Posts
    40

    timer question

    using QueryPerformanceCounter(), how to do i make sure i always get interval of time i need to get. if it is a bit longer, that is fine. that way i know when to fire. let's say, desired pulse frequency is 100khz. anything can be done with elapse time??. i need an example if feasible. Within win32 , firing time may not be what i want.

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125
    100Khz (10uS) is difficult to do accurately under windows. There is a fundamental difference between measuring something and triggering something.

    Can you provide additional details on what you want to do at this rate?
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Apr 2004
    Posts
    40
    let's say i need to shine a plant with a special light precisely for 10us and then off , then on. so, On period should be 10us.

  4. #4
    Join Date
    Jan 2004
    Location
    Earth
    Posts
    567
    Originally posted by galaxy4u
    let's say i need to shine a plant with a special light precisely for 10us and then off , then on. so, On period should be 10us.
    It is unlikely that you will be able to achieve an accurate 10us pulse from Windows. It would be fairly simple to generate this with a simple hardware setup consisting of a suitable timer and a FET driver. 10us pulses of light will appear continuous to the eye. It seems reasonable that such a pulse will also appear continuous to the chemical reactions that occur in herbaceous material of a plant.

    TDM

  5. #5
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125
    There are many standard PCI cards that are around $100 that have the hardware you require (plus more).

    That is how I would go.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured