Help with PWM6 and PWM7 on 16F18857 ???


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: Help with PWM6 and PWM7 on 16F18857 ???

    Ok, thanks all for verifying approach. I found the issue to be that the resolution of the duty cycle in bits was 9, not 10, (it seems it varies with the PR2 value predetermined by the HPWM command), so with the MSB of the PWMxDCH set at 1 (PWM6DCH=128), the result was "always on" at the output, whereas I was anticipating a 50% duty cycle waveform.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Help with PWM6 and PWM7 on 16F18857 ???

    Quote Originally Posted by picster View Post
    Ok, thanks all for verifying approach. I found the issue to be that the resolution of the duty cycle in bits was 9, not 10, (it seems it varies with the PR2 value predetermined by the HPWM command), so with the MSB of the PWMxDCH set at 1 (PWM6DCH=128), the result was "always on" at the output, whereas I was anticipating a 50% duty cycle waveform.
    Note that this was at 1KHz HPWM on CCP1 through 5. At 2KHz, you regain full 10 bit resolution again, according to my trials (using a clock speed of 8MHz).

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