Accurate Freq Measurment


Results 1 to 23 of 23

Threaded View

  1. #16
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Terry,

    Check the datasheet to see the effect of changing the prescaler with capture enabled.

    That may be what's causing the bad capture value. You should be OK if you set it up for
    every 16th edge before enabling capture. Switching prescaler with capture enabled can
    cause odd results.

    Edit: If you do need to do this, try disabling capture first, then changing prescaler.

    CCP1CON=0 ' disable CCP module
    Capture=0 ' clear capture flag
    CCP1CON=%00000111 ' re-enable for every 16th edge

    Never tried it myself, but it looks like it should work. Disabling the CCP module clears the
    prescaler count.
    Last edited by Bruce; - 5th June 2008 at 22:37.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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