Timer based PWM with HPWM


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305

    Default Timer based PWM with HPWM

    Having a little trouble setting up 2 PWM signals. I'm using the 18F2550 with 20MHz ceramic res, setup for USB. DEFINE OSC is 48MHz.

    Based on the pwm used in this design: http://www.picbasic.co.uk/forum/showthread.php?t=15602 I can get the 260Khz pwm to work fine but when I use CCP2 for the HPWM 2 output, HPWM 2 has a frequency that matches the timer based pwm on CCP1.

    If I setup a HPWM on CCP1 of any frequency, and another on CCP2 also of any frequency, they both change to 6.6KHz. However if I disable either one, then the remaining one functions at the desired frequency.

    Any ideas on what I am missing?

  2. #2
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default Re: Timer based PWM with HPWM

    Take a look at table 15-2 in the datasheet. If I understand it correctly both hardware PWMs must share the same frequency.

    Best Regards,
    Paul
    The way to avoid mistakes is to gain experience. The way to gain experience is to make mistakes.

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