HWPM higher resolution stepping


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2009
    Posts
    583

    Default HWPM higher resolution stepping

    Hi

    I'm using hardware PWM on a 18F4520 to control two channels of LEDs for an aquarium light. Using the hpwm 1,W_PWM,750 command in PBPro, the variable W_PWM has 255 steps, however this gives a noticeable stepped phase when dimming the LEDs up and down at low values of W_PWM. Is there a way of using a higher value so that W_PWM has more resolution say 1024 steps - or is this not supported ?

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: HWPM higher resolution stepping

    Hi,
    No, the HPWM command is limited to 8bit resolution. Years ago Darrel wrote a routine called HPWM10 or something like that which could be used instead of the normal HPWM to get 10bit resolution and provide glitchfree operation (IIRC) search the forum and you should be able to find it.

    With that said it's pretty straight forward to set the registers for the CCP manually. Plenty of examples on that as well floating around.

    /Henrik.

  3. #3
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: HWPM higher resolution stepping

    Cheers Henrik, I'll have a search and see if I can find Darrels routine

Similar Threads

  1. Synchronising HWPM to an external source
    By galliumman in forum General
    Replies: 3
    Last Post: - 6th December 2009, 18:03
  2. PIC16F616 HWPM Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 4th April 2009, 09:20
  3. Zero crossing output with HWPM
    By bradhartmann in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th December 2007, 19:17
  4. can HWPM use in PIC16f84a?
    By tkly36 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th November 2006, 17:38
  5. Stepping motor Driver
    By mesamune80 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 8th August 2006, 04:36

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