Maximum frequency output from a PIC


Closed Thread
Results 1 to 40 of 69

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,622


    Did you find this post helpful? Yes | No

    Default Re: Maximum frequency output from a PIC

    Hi,
    With 16MHz main clock there are three different prescaler ratios all giving you 250kHz but different number of bits of resolution.
    If you set prescaler to 1:2 and load PR2 with 3 then you'll get 250kHz and 5 bits of resolution (not 5 "full" bits actually), ie you can set the dutycycle value anywhere between 0 and 16.

    If you set the prescaler to 1:1 and load PR2 with 15 you'll get the same frequency but now you've got better resolution, 0-64 instead of 0-16.

    Now, just write out whatever value you want in binary as a 10bit value: %0000010110
    The two least significant bits goes to CCP1CON.5 and CCP1CON.4 and the remaining 8 bits goes to CCPR1L, in this case (as in your example) the result would be 21 which would result in either 100% or ~20% depending on the prescaler and PR2 setting as outlined above.

    /Henrik.

  2. #2
    Join Date
    Oct 2012
    Posts
    83


    Did you find this post helpful? Yes | No

    Default Re: Maximum frequency output from a PIC

    Thank you Henrik.
    It makes more sense to me now.

    Regards,

    Nick

Similar Threads

  1. internal TMR for frequency output
    By Samoele in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th January 2009, 10:38
  2. How to calculate PIC sampling frequency
    By minmin in forum General
    Replies: 1
    Last Post: - 26th September 2006, 19:02
  3. Replies: 2
    Last Post: - 20th January 2006, 22:09
  4. Maximum frequency count on 16F628/4MHz
    By solara in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 23rd May 2005, 11:38
  5. Low frequency output
    By barkerben in forum General
    Replies: 5
    Last Post: - 16th November 2004, 16: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