How to make HPWM slower with 16F887?


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,680


    Did you find this post helpful? Yes | No

    Default Re: How to make HPWM slower with 16F887?

    I can't help but notice your table only goes to 511. That's half of the available pwm pulse width.
    that's correct dave.
    The point was to demonstrate that its possible to eliminate the visible brightness steps that are most evident at the dimmest fading levels. The steps are quite visible at the lowest 20 or so pulse widths wether its gamma corrected at full 10 bit resolution or linear at 8 bit resolution .
    100 steps was all that's necessary to prove the point , it can be done

    the missing 10 steps
    100 481
    101 522
    102 568
    103 617
    104 671
    105 729
    106 793
    107 863
    108 940
    109 1023
    Warning I'm not a teacher

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: How to make HPWM slower with 16F887?

    Thanks so much for the help. I'll give this a try.

  3. #3
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: How to make HPWM slower with 16F887?

    If it helps for a musical instrument you can connect an old AM radio tuning capacitor across one of the crystal capacitors or across the crystal itself,
    and bend the note a little. Of course you don’t have programatic control over that manual knob, but you do have infinite resolution over a range.

  4. #4
    Join Date
    Feb 2013
    Posts
    1,153


    Did you find this post helpful? Yes | No

    Default Re: How to make HPWM slower with 16F887?

    If you want to do portamento - "sliding notes" using HPWM and Picbasic pro, you should do it with ASM, because, PBP on each HPWM statement, resets and restarts PWM generator, which sounds additional bzzzzzzzz, while doing portamento.

    If you really want to go deep into music with PIC, you should try LT8500 IC - this is 48 channel 12 bit PWM generator with fine adjustments - you can have impressive 48 voice polyphony, or say 24 voice with 2 operators per channel, or 12 with 4 operators and so on.

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: How to make HPWM slower with 16F887?

    Quote Originally Posted by CuriousOne View Post
    If you want to do portamento - "sliding notes" using HPWM and Picbasic pro, you should do it with ASM, because, PBP on each HPWM statement, resets and restarts PWM generator, which sounds additional bzzzzzzzz, while doing portamento.

    If you really want to go deep into music with PIC, you should try LT8500 IC - this is 48 channel 12 bit PWM generator with fine adjustments - you can have impressive 48 voice polyphony, or say 24 voice with 2 operators per channel, or 12 with 4 operators and so on.
    That's a good idea. I didn't realize there was such a device. I found the TLC5973 which has only 3 channels, which would suit my needs just fine. Not sure how well it works with PIC, but I'm sure if I look around I'll find something similar that works with SPI or I2C.

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: How to make HPWM slower with 16F887?

    This thread is confusing. You say you want to fade the intensity of a LED and that you need to control the "fade speed". You confuse "fade speed" with PWM frequency which we've tried to explain has nothing to do with it. Then comes the ideas of using external chips, and not that the LT8500 isn't a cool chip (thanks for pointing it out!) and totally capable of dimming a LED but why on earth would you use a $6, 48 channel PWM chip in an "impossible" to breadboard 56pin QFN package, when the CCP module in the PIC you've already got is totally capable of doing what oyu want as long as you can live with 10bit resolution.

    If 12bit is really needed then the TCL5973 is much more suitable. Or you can get a PIC capable of higher resolution PWM, like the 12F1571 which will do up to 16bit resolution on up to 3 channels. At 16bits though I think the frequency is getting on the low side but at 12bits you should be totally workable. Nope, HPWM won't work with it.

    /Henrik.

  7. #7
    Join Date
    Feb 2013
    Posts
    1,153


    Did you find this post helpful? Yes | No

    Default Re: How to make HPWM slower with 16F887?

    PWM frequency, not duty cycle, has do something with fading smoothness - lower the frequency, higher the smoothness is, but flicker is more noticeable. With higher frequency, flicker is almost gone, but fading will be more ugly.

Similar Threads

  1. Can't make RA1 a digital Input on (10 out of 20) 16F887.
    By paulgrut in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 11th October 2013, 07:53
  2. USB HID is slower than often using PIC18f2550
    By Ahmadabuomar in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 16th November 2010, 15:05
  3. Mibam at 20mhz runs slower than at 4 mhz
    By Homerclese in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 31st October 2010, 19:41
  4. Code running 19 times slower than intended
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 15th April 2010, 13:20
  5. Servo Slower?
    By actionplus in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 4th September 2004, 14:56

Members who have read this thread : 0

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