How to setup 38kHz PWM with PIC18F1330


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Re: How to setup 38kHz PWM with PIC18F1330

    Well, I just found this in the DS:
    DS note, page 131:
    To get the correct PWM duty cycle, always
    multiply the calculated PWM duty cycle
    value by four before writing it to the PWM
    Duty Cycle registers....
    I think this means a "100%" (in my mind, this is a signal always high - not useful but for the theory) duty-cycle value would be:
    - PTER * 4 => 130 * 4 => 520

    So, for a 50% duty-cycle, the PDC0 value is going to to be:
    - 520 * 50% => 260

    But, playing with the values, I can see on my scope that the numbers would be more accurate taking in account the PTER+1 (131 instead of 130) value.

    Where is the truth?
    Roger

  2. #2
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Re: How to setup 38kHz PWM with PIC18F1330

    ...you were quicker
    Roger

Similar Threads

  1. 38Khz Modulator
    By Gord11 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 28th September 2011, 08:14
  2. manual hardware PWM setup on 16F1824
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 31st January 2011, 18:34
  3. Use Button For setup
    By tump in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 21st November 2007, 19:43
  4. Generated square wave 19Khz and 38Khz
    By blinkstar88 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th August 2007, 16:40
  5. pic12f683 setup
    By erice1984 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th July 2007, 11:48

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