Accurate Freq Measurment


Results 1 to 23 of 23

Threaded View

  1. #1
    Join Date
    Dec 2005
    Posts
    24

    Default Accurate Freq Measurment

    I am using a PIC to make a very accurate (sub hertz) frequency measurement of a 4 kHz signal in as little time as possible, about ~ 100msec. I am using TIMER1 to measure the period of 400 cycles of the 4kHz signal. I am starting Timer1 on a rising edge of the 4kHz signal, keeping track of the number of cycles and then stopping Timer1 on the 400th cycle of the 4kHz signal. I then have a count and number of rollovers of the timer from which I calculate the frequency in a computer, not the PIC. Below is the code of my technique. The question I have is there a better approach to taking advantage of the PIC’s hardware Timers and/or capture compare module, such to improve the accuracy and to do this in the background. The code in currently for the PIC16F877, but I can easily switch to an 18F part.
    Thanks in advance for the help,
    Terry
    Attached Files Attached Files

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. reducing shiftout clock freq and PS2/PC interfacing ....
    By wireless magic in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 26th February 2008, 20:15
  3. accurate vref < 1vdc 16F876 comparator
    By mslaney in forum Schematics
    Replies: 1
    Last Post: - 23rd March 2005, 01:44
  4. HPWM on a 628 is not changing freq.
    By dtit in forum General
    Replies: 2
    Last Post: - 25th February 2005, 09:34
  5. More accurate resolution from the A/d converters
    By pjsmith in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th August 2004, 22:49

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