Two independant HPWM possible?


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2005
    Posts
    44

    Default Two independant HPWM possible?

    Is there a way to have 2x HWPWM outputs from one PIC, that will run at the same frequency but at a different duty cycle?

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jamie_s View Post
    Is there a way to have 2x HWPWM outputs from one PIC, that will run at the same frequency but at a different duty cycle?
    Totally depends on the PIC. Go to Microchip's website and look.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Or, if you need fairly low frequencies (10-200hz) and your PIC doesn't have 2 CCP's, this might work...

    (SPWM_INT - Multiple Software PWM)
    http://darreltaylor.com/DT_INTS-14/SPWM.html
    <br>
    DT

  4. #4
    Join Date
    Aug 2005
    Posts
    44


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Totally depends on the PIC. Go to Microchip's website and look.
    Yeah, ive looked at some datasheets and the ones i've looked at show both pwm's using the same timer.

    Has anyone got any idea on what pics may have dual hardware pwm that would suit ?
    It needs to be hardware instead of software, and will be used to run two solenoids

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jamie_s View Post
    Yeah, ive looked at some datasheets and the ones i've looked at show both pwm's using the same timer.

    Has anyone got any idea on what pics may have dual hardware pwm that would suit ?
    It needs to be hardware instead of software, and will be used to run two solenoids
    Well, if it's going to run two solenoids, chances are they aren't going to run any more than 100Hz or so (unless you've got special solenoids that run at a lot more than that ).
    The Multiple Software PWM practically runs in the background and works well.
    Myself, I have been able to do software PWM running 63 LEDs, all with independent PWM on a 18F8722, with instruction cycles leftover to do other things.
    Past that, if you really need that much processing power (and I'm guessing you really don't, but think you do), you're probably better off with 3 separate PIC's, one master, and a couple of slave PICs, each one doing it's own PWM.

  6. #6
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Definately possible

    Hi,

    While the timebase is fixed to a single timer the frequency of the PWMs remain same. But for PICs with 2 PWMs you need to update the registers CCPR1L and CCPR2L with your desired duty cycle. Example 16F877A, 18F452.
    Regards

    Sougata

  7. #7
    Join Date
    Aug 2005
    Posts
    44


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sougata View Post
    Hi,

    While the timebase is fixed to a single timer the frequency of the PWMs remain same. But for PICs with 2 PWMs you need to update the registers CCPR1L and CCPR2L with your desired duty cycle. Example 16F877A, 18F452.
    Thanks - thats what i was looking for - the 16F877A

Similar Threads

  1. Multiple HPWM question
    By Johan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th October 2007, 13:00
  2. need help on hpwm
    By helmut in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th August 2007, 15:49
  3. HPWM of the port of two HPWM
    By ja2rqk in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th April 2007, 15:05
  4. sound command & music
    By trying in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 26th May 2006, 14:14
  5. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43

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