piclist 2017\09\06\184237a >
Thread: High Frequency 16 bit PWM Dimming
www.piclist.com/techref/microchip/ios.htm?key=pwm
flavicon
face BY : Kerry email (remove spam text)



I think you would need to dither it.

Set up an interrupt for each PWM cycle.  Separate the 16 bit word into
10bit and 6bit.

In interrupt:
Acc += 6bit;
if(Acc>0x3f)    // If bit 7 set
{
    Acc &= 0x3f;    // Clear 7th bit
    set_PWM(10bit+1);    // Extra long cycle
}
else
    set_PWM(10bit);    // "Normal" cycle


It will average out to your 16 bit value.

Kerry




On 9/6/2017 4:41 PM, Jim Ruxton wrote:
{Quote hidden}

--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
<83bdc3e9-3b01-8474-8089-a8066a16582e@skunkworksnh.com> base64

In reply to: <6e5ca9b6-c161-10cd-3aa9-6902e58dce9f@gmail.com>
See also: www.piclist.com/techref/microchip/ios.htm?key=pwm
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) High Frequency 16 bit PWM Dimming

month overview.

new search...