pic18f252 PWM duty update : Help


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default Re: pic18f252 PWM duty update : Help

    Henrik,
    thanks for the interest.
    I have read the data sheet again but it is still not clear to me: could you please spend few more words for me ?
    ( Will I have 10 bit resolution if PR2 is set to 256 since 256*4 =1023 : is this assumption correct ? ).
    Thanks for your time
    bst rgds,
    Ambrogio

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: pic18f252 PWM duty update : Help

    Hello,
    Well, PR2 is 8 bits so you can only really set it to 255 but otherwise yes you're correct.
    This will of course also change the frequency - there's always a tradeoff between frequency and resolution. If you need to "hit" 10kHz exactly then you'll have to live with ~9.5 bits of resolution or change your oscillator frequency to one that better matches your needs. Faster isn't always better.

    /Henrik.

  3. #3
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default Re: pic18f252 PWM duty update : Help

    Thanks Henrik: it is clear to me now.
    Best regards,
    Ambrogio
    IW2FVO
    North Italy

Similar Threads

  1. 3 channel PWM with customize duty cycle
    By photoelectric in forum mel PIC BASIC Pro
    Replies: 56
    Last Post: - 16th May 2011, 13:49
  2. Replies: 9
    Last Post: - 8th October 2008, 11:15
  3. PWM PIN(S), DUTY, CYCLE ?Plural possible?
    By earltyso in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th November 2007, 20:41
  4. Help with PWM and duty and integers
    By JDM160 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th March 2005, 06:03
  5. PWM _ Duty Cycle in Tenths
    By rwskinner in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 17th May 2004, 12:09

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