There is family of asynchronous D/A converter algorithm's that are useful when peak execution cycles are at a premium and the average is still less than the maximum available execution cycles. The random reference algorithm described a few days ago is the only one I know that is both asynchronous and doesn't need an accurate time reference. There are a couple different ways that delta mod can be used. A few days ago Nikolai Golovchenko clearly described a technique that can be extended to be both asynchronous and have extended precision. Nikolai's algothrim makes a simple assumption that each sample error is integrated over a normalized signal unit of time. If the error is integrated accounting for time then each output sample can both be asynchronous and the errors can be compensated. This idea can be extended and used in two ways. First the simplest D/A converter is a single bit (loosely delta mod) This reduces extended precision to error management. More precision at increased processing requirements. Secondly, to have a stable D/A most of the delta MOD D/A's make an assumption the output is periodic. By including time in the error calculations we can eliminate the need for tight periodic outputs. There is usually a simple way that this can be done. When we are integrating errors with normalized unit time we are actually multiplying by 1. If we have a one bit D/A then the value that we are integrating is 1 by the amount of elapsed time. The elapsed time can be had by sampling a free running timer and calculating the delta time with a subtract. The net result is an asynronous software D/A using very simple code. Walter Banks Nikolai Golovchenko wrote: > An 8 bit DAC working at higher frequency. At each sample, > calculate the error between 12 bit input and 8 bit output > (output is taken as 8 higher bits of input). Error should > be calculated in relative units, 1=full scale. (It is > simply the lower bits of input). At the next sample, add > this error to the input. This will compensate for reduced > resolution in the long run. Works as some kind of PWM, > but doesn't need high oversampling, since you need to > add only 4 bits of resolution. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.