Working PIC with Frequencies


Results 1 to 7 of 7

Threaded View

  1. #6


    Did you find this post helpful? Yes | No

    Default Re: Working PIC with Frequencies

    Quote Originally Posted by ronsimpson View Post
    [But I can't understand it very well, for example what happens if I have a PIC 16F877A working with a clock of 20MHz. Do I have to see the relationship between my frequency, for example 82.64Hz, and the clock of 20MHz and then work with your formula?
    It would be really great if you could help me with an example, I'll be really thankful!
    If clock=20mhz and you counter is running at 5mhz then the counter is counting in 0.2uS steps. If the counter=1 then 0.2uS. If the counter=10 then 2uS. 100=20uS 1/20uS=(50khz)

    If the frequency you want to look at is 82.64hz then the counter will read 60503. There are 60503 * 0.2uS in 82.64hz.

    5,000,000hz/82.64hz=60503

    Time=0.2uS X timer-count
    F=1/Time

    Your counter can not count frequency. It can count time! and F=1/T
    Thank you so much! that's easier. So now the question will be, What value should I use on my code? Timer-count values or just time values? My guess is Timer-Count values, Am I right?
    Last edited by Archangel; - 7th June 2011 at 07:23. Reason: fix quote tag

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