Help with PWM pulse train


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2014
    Posts
    1

    Question Help with PWM pulse train

    Hi Everyody

    I am a newbie to PIC programming. In fact, just playing with LEDs to learn control of outputs.

    I could not understand the term "CYCLE" used with command PWM. Can somebody spare a few moments to explain it?

    Example:

    a) Output required at pin B1, 10% duty cycle and frequency 410kHz - only internal oscillator 8MHz

    b) Output required at pin B1, 10% duty cycle and frequency 410kHz - external oscillator 8MHz

    c) Output required at pin B1, 10% duty cycle and frequency 410kHz - external oscillator 20MHz

    I understand how to direct output to a particular pin and calculate the duty cycle. I just could not understand how to work out CYCLES for a particular frequency of the output pulse train against the frequency of the internal/external oscillator of a PIC.

    Thanks for the help.

  2. #2
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Help with PWM pulse train

    If I understand the PBP PWM and HPWM commands correctly, if you properly define your clock source (internal or external etc) and operating frequency through the OSCON register(s), the PCP takes it from there.

    HPWM 1, 10, 410

    Hope this helps.

    Mike

Similar Threads

  1. generate a train of pulses
    By xvladx in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th January 2011, 10:02
  2. PWM Pulse Amplitude on 16F877
    By jrudd in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th June 2009, 07:24
  3. Replies: 23
    Last Post: - 23rd September 2008, 18:20
  4. Model Train controller - revisited
    By malc-c in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 8th May 2007, 09:40
  5. Recommendations - Model Train Controller
    By malc-c in forum mel PIC BASIC Pro
    Replies: 101
    Last Post: - 8th March 2007, 08:17

Members who have read this thread : 1

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