Timer1 - frequency measurement


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Posts
    38

    Default Timer1 - frequency measurement

    Hi,

    Has anyone got a sample program showing how to measure the frequency of an input, i want to measure the frequency of a transmitter.

    i'm using a pic16f870, i've been reading the information on timer1 but i don't totally understand how to accomplish what i need.

    Thanks

    Dan

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by -Dan- View Post
    Hi,
    Has anyone got a sample program showing how to measure the frequency of an input, i want to measure the frequency of a transmitter.
    i'm using a pic16f870, i've been reading the information on timer1 but i don't totally understand how to accomplish what i need.
    Thanks
    Dan
    Straight from the manual...
    COUNT Pin,Period,Var
    Count the number of pulses that occur on Pin during the Period and
    stores the result in Var. 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).................
    But seriously, what frequency range are you planning on counting?

  3. #3
    Join Date
    Jul 2007
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Straight from the manual...

    But seriously, what frequency range are you planning on counting?

    I considered using count, but i do not no its limitations what will it count up to?.

    I want to measure in the 88-200mhz range, i doubt the pic can support this kind of range so i have got an external prescaler which will divide by 256 or 64.

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by -Dan- View Post
    I considered using count, but i do not no its limitations what will it count up to?.
    COUNT Pin,Period,Var
    Count the number of pulses that occur on Pin during the Period and
    stores the result in Var. Pin is automatically made an input.........
    Does that give you a clue as to the answer?

    so i have got an external prescaler which will divide by 256 or 64.
    You're going to divide RF using an 'external prescaler'?
    Good luck with that...

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Default

    Hi, Dan

    The Web is full of Ham Freqmeters ...

    "Google is you friend."

    EPE's last edition show a nice 50 Mhz one ... w/o prescaler.
    µChip ANs show the original idea for those ones.

    just yours to choose which one !!!

    Alain
    Last edited by Acetronics2; - 27th October 2008 at 17:14.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Jul 2007
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Does that give you a clue as to the answer?


    You're going to divide RF using an 'external prescaler'?
    Good luck with that...
    See the below image

    http://hem.passagen.se/communication/pic/fct_sch.gif

    this is a project i found that does what i wanted, but it does not explain the programming side of capturing the frequency, which i want to understand.

    I only want to learn lol

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Talking

    Looking at this ...pic. I do think PbP has not its place inside the 870 !!!

    125 Khz * 256 = ... 32 Mhz

    Alain
    Last edited by Acetronics2; - 27th October 2008 at 17:33.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    That link doesn't work so good for me...might for some, not for me at the moment...

    COUNT Pin,Period,Var
    Count the number of pulses that occur on Pin during the Period and
    stores the result in Var. Pin is automatically made an input.........
    So what did you get out of this?

Similar Threads

  1. Help with TIMER1 + SLEEP
    By Yodoad in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd May 2009, 15:07
  2. Advice on frequency measurement to 30MHz
    By Andy Wood in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th March 2009, 04:23
  3. inaccurate frequency using TMR1 PI18F452
    By nkarpovich in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 14th October 2006, 16:22
  4. frequency measurement
    By big-x in forum General
    Replies: 2
    Last Post: - 25th November 2005, 00:53
  5. Timer1 and Interupt wierdness
    By mind in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 23rd August 2005, 01: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