Accurate milliseconds time measurements?


Closed Thread
Results 1 to 3 of 3
  1. #1

    Default Accurate milliseconds time measurements?

    Hello. I would like to be able to verify the performance of a fan by having a PIC take some measurements and sending it to a serial port.

    Fan motor data, nominal
    Voltage: +26VDC
    Current: 0.32 Amps
    Speed: 18,300 RPM
    Fan Performance Sensor (FPS) Output: +5VDC, 50% duty cycle.

    The input power requirement of the fan drive signal shall be +28VDC. The maximum rise time of the +28VDC fan drive shall be 10ms to reach 90% of the full +28VDC.

    One of the tests will consist of measuring time delay, in milliseconds from 90% rise time of maximum +28VDC fan drive to the first rising edge of the pulsed FPS.

    Now, I know how to measure the voltages, but I'm not certain how to approach the time measurement, if it can even be done. Can anyone point me in the right direction?

    If I can figure out the above, the next challenge for me will be to figure out how to measure the steady state current and send that to a serial port as well.

    ~ Dave

  2. #2
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    This maybe?
    5.59. PULSIN

    PULSIN Pin,State,Var

    Measures pulse width on Pin. If State is zero, the width of a low pulse
    is measured. If State is one, the width of a high pulse is measured.
    The measured width is placed in Var. If the pulse edge never happens
    or the width of the pulse is too great to measure, Var is set to zero. If an
    8-bit variable is used, only the LSB of the 16-bit measurement is
    returned.

    Pin is automatically made an input. Pin may be a constant, 0 - 15, or a
    variable that contains a number 0 - 15 (e.g. B0) or a pin name (e.g.
    PORTA.0).

    The resolution of PULSIN is dependent upon the oscillator frequency. If
    a 4MHz oscillator is used, the pulse width is returned in 10us increments.
    If a 20MHz oscillator is used, the pulse width will have a 2us resolution.
    Defining an OSC value has no effect on PULSIN. The resolution always
    changes with the actual oscillator speed.

    PULSIN normally waits a maximum of 65535 counts before it determines
    there is no pulse. If it is desired to wait fewer counts before it stops
    looking for a pulse or the end of a pulse, a DEFINE can be added:

    DEFINE PULSIN_MAX 1000

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Thank you for the insight!

    ~ Dave

Similar Threads

  1. Easy and Accurate Clocks without RTC IC
    By paul borgmeier in forum Code Examples
    Replies: 18
    Last Post: - 28th October 2013, 21:28
  2. I don't understand this code!
    By Russ Kincaid in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 13th February 2008, 02:55
  3. Measuring time
    By AugustoPedrone in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th July 2007, 23:46
  4. Serout2/serin2 Pbp Problem
    By SOMRU in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th December 2006, 19:55
  5. Timer in real time
    By martarse in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th July 2005, 14:24

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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