At 18:48 02/22/99 -0800, Scott Dattalo wrote: >you're (mostly) describing a phase accumulator. if i had heard that term before, maybe i wouldn't have taken such a long way around it! :) >If you had a 20Mhz crystal and used the isochronous software pwm routine I >mentioned in the last post, then delta t = 51.2uS. For N=14 bits you get a >really simple equation (if I did the arithmetic correctly): > >delta phi = 0.83886 * f > >So to generate 2500Hz, delta phi would be 2097. i still see one problem here. 51.2us=19.5kHz, that's less than 8 points per period at 2500Hz. if i rewrite the pwm for a resolution of 128 (and double the frequency), i guess the free cycles would be less than half, too, and that's probably not enough. what i was trying to figure out is how to get an interrupt out of the hardware pwm module (like when the counter is reset), but i guess that's not possible. or only with feeding the pwm output back to RB0 and make sure the pwm register never gets 0. any ideas on that? i'd like to use the hardware pwm, because it gives me 4 times the frequency. thanks a lot, ge