Measuring Period & Hz


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    G8RPI's Avatar
    G8RPI Guest


    Did you find this post helpful? Yes | No

    Default Frequency measurement

    Hi,
    The timer 1 will work to at least 15MHz, more than enough for your application.
    My code will also work, just adjust the counting time, variable ctime in my code, to suit the frequency range. Use pauseus instead of pause for very short counting times.Setting ctime to 100 and changing the pause command to pauseus will give a reading up to 6.5535MHz with 100Hz resolution (100us count time). The 100Hz resolution is better thn .05% at 300KHz, much more than you need for a typical LCR meter.
    An external prescaler is not required, you don't even need to use timer1's internal prescaler.

    Regards,
    Robert G8RPI.

  2. #2
    MaurI's Avatar
    MaurI Guest


    Did you find this post helpful? Yes | No

    Default

    Hello

    Well the problem is that the resolution must be about 5 Hz. To achieve that the measuring period must be long enough. Timer1 can count up to 2bytes that is not enough. Using a prescaler gives an error too. So my LAST idea was to use some high speed hardware counter that has large registers I would then connect it to PIC which will control it and calculate.

    * Does anybody know a counter of this type aprt name/number?

    Besides those Pause and Pauseus aren't precise, I have measured the frequency on PICs pins using Pause and Pauseus with High and Low and =1, =0, the error of time is about 0,06%, well it is inconspicious but...

    Thanks

  3. #3
    G8RPI's Avatar
    G8RPI Guest


    Did you find this post helpful? Yes | No

    Default

    Hi,
    5Hz Resolution at 2MHz is is 1 in 400,000 or 0,00025%! This implies that you are either trying to measure very accurate capacitors or your circuit has a very small frequency change for a given capacitance change.
    Without knowing exactly what you are trying to acheive (parameters to be measured, range of values and accuracy) and the circuit you are using, it is hard to make reasonable suggestions. Is this just a project to make a LC meter for your own use, a special meter for a particular application or a commercial design?
    If you wish to use an external hardware counter look at the CMOS (CD/HEF) 4040 (12 bit, use two) or 4518 (dual 4 bit, use 3 ic's) chips but you will have to build your own gating and multiplexing circuits, or the Intersil 7226. The 7226 is an 8 digit frequency counter ic that will drive LED's but also has a multiplexed BCD output. It is however becoming obsolete.
    I do think howevr that if you need 5Hz resolution at 2MHz to measure at normal component accuracy (around 1%) your circuit needs to be reconsidered. Perhaps auto range switching when the PIC counter overflows? My code traps a counter overflow.

    A typical precision LCR meter costing around $4000 offers 0.05% accuracy, 0.2% will cost you $2000 and 1% about $200.
    I can recommend the Peak Atlas LCR meter at under £80 (UK Pounds) or about $150.

    HTH,
    Robert.

  4. #4
    leko's Avatar
    leko Guest


    Did you find this post helpful? Yes | No

Similar Threads

  1. Frecuency Detection
    By Josuetas in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 4th February 2010, 03:01
  2. Timer + rc5
    By naga in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th November 2009, 08:56
  3. Wheel speed sensor
    By Wax-um in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 24th January 2009, 02:07
  4. RC5 decode on a 10F + Question
    By ultiblade in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 11th September 2008, 09:20
  5. Frequency Generator
    By ExYu in forum Off Topic
    Replies: 2
    Last Post: - 22nd January 2008, 19:25

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