>Q: Given N and M with N > 0, N < M, M <= maxcount, what is the largest >space between realizable duty cycles? The smallest step (delta) is 1/N where N is the maximum divider. There is no way around this, unless. The o/p of a PWM waveform is integrated directly. The value of the integral is written V = V1*M/N where V1 is the amplitude of the PWM voltage and M<=N. There is NO way to reduce the step below Nmin/M which is 1/M. What you *can* do is use the tristate facility of the output pins. This effectively increases the number of output encoding states. With this you can have three output states so the output could be manipulated more accurately OR faster with the same number of IO operations. For example if you have to output a value N then decide if N is above M/2 (where M is the maximum output), or below, set output bit=((N - M/2) >= 0)?1:0; and output unipolar pulses using the tristate control only (i.e. set bit value and turn on/off using tristate control). You can have 9 bits resolution on an output with timing as for 8 bits (N = 256), or 8 bits with timing for 7. Of course this assumes that the external hardware cooperates and the output tends 'to' 1/2Vcc when the pin is not driven. There are some more problems with this, so I have simplified here. Peter -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads