> What's the best strategy for dealing with updating > a 10-bit PWM value asynchronously with TMR2? > > It looks like you could get a glitch if the update > happens to occur just as TMR2 is overflowing. I've thought about this too. In the end I just updated the high 8 bits, then the low two bits as quickly as possible thereafter. Since PWM is usually used to achieve an average duty cycle over a longer time interval than the PWM frequency, I think you can just ignore the glitch because the average will still be correct. Yeah, I know, I'd feel better too if all 10 bits were properly double buffered in the hardware. ***************************************************************** Olin Lathrop, embedded systems consultant in Devens Massachusetts (978) 772-3129, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads