High Resolution Timer & Speed Calculator


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Jan 2010
    Location
    PHILADELPHIA, PA - USA
    Posts
    34


    Did you find this post helpful? Yes | No

    Default Notes, Limitations and Future Features

    Features:
    1) MAXIMUM TIME: 99 MIN, 99.9999999 SEC ...Really just a display limitation
    2) MINIMUM TIME: 0.0000522 SEC also a display limit at 9999.999998 MPH
    3) Time Resolution: 200 nS = 0.0000002 SEC
    4) Input single PULSE to Pin RC2
    5) Displays Measurement and resets awaiting next pulse.
    6) Data is sent out to 57600 N-8-1 Serial terminal on Pin RC6
    7) Status LED shows when pulse is being timed.

    Comments:
    This was an experiment in precision of the code.
    No oscillator is really this accurate.
    Probably pretty close for relative measurements.
    But Not for absolute measurements

    Currently the speed is based on fixed distance of the optical sensors.
    they are fixed and hard coded at 6.000 inches.
    The circuit I use to derive the pulse is here:
    http://www.picbasic.co.uk/forum/showthread.php?t=12614

    Future Plans:
    1) Add additional speed units (M/S, KMH)
    2) Add user menu to set gate distance and displayed units
    3) Add an oscillator correction factor after comparing it to bench-top timer.
    4) Write settings to Onboard EEPROM
    5) Try a 40 MHz crystal oscillator or other High accuracy clock
    6) Build a thermal oven for crystal oscillator ...

    Enjoy,
    --Bob
    Wozzy-2010

  2. #2
    Join Date
    Jan 2010
    Location
    PHILADELPHIA, PA - USA
    Posts
    34


    Did you find this post helpful? Yes | No

    Default Include Files:

    Please note that there are three include files in the above code which are required for it to operate.

    N-BIT_Math.pbp
    At its core is the Multibyte Arithmetic Assembly Library that was written by Alexander Avtanski.
    The Assembly Library was wrapped for PBP by Darrel Taylor [Version:1.3 Beta (JAN 07,2010)]
    This library is used to assemble the 64-Bit high precision math,
    You can find reference to it in this PB Forum Thread:
    http://www.picbasic.co.uk/forum/showthread.php?t=12433

    DT_INTS-18.bas & ReEnterPBP-18.bas
    DT_INTS-18.bas is Darrel Taylor's Base Interrupt System for PIC18F [Version:3.3 (MAR 24, 2008)]
    ReEnterPBP-18.bas is Darrel Taylor's PBP interrupts for PIC18F [Version:1.4 (MAR 24, 2008)]
    Both can be referenced at this PB Forum Thread:
    http://www.picbasic.co.uk/forum/showthread.php?t=3251
    Or directly from Darrel Taylor's web page here:
    http://darreltaylor.com/DT_INTS-18/home.html
    Please note that there are different versions for (PIC12F, 14F, & 16F) and for PIC18F.

    --Bob
    Wozzy-2010

  3. #3
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    WOZZY-2010, interesting project and well documented. Thank you for sharing it.

    Al.
    All progress began with an idea

Similar Threads

  1. SERIN MIDI out of Synch?
    By jncortes in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th June 2009, 20:08
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. Replies: 14
    Last Post: - 26th September 2007, 05:41
  4. sample code for M25P32
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th January 2007, 02:37
  5. Serin and TMR0
    By capitano in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th May 2006, 14:58

Members who have read this thread : 1

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