> Your understanding is correct. Wow! I had to re-read your old archive post over and over again until it twigged. >you're going to need two phase accumulators to accomplish. and a source of code example would be your sinewave generator, the interpolation one? Yes? >One will be the PLL phase accumulator. > Although, you could use a different algorithm to measure the >incoming frequency. For example, you could measure the period of the incoming >waveform and average several of those messages with a digital filter to obtain >an average period. Then this average period could be used to create the phase >delta for your second phase accumulator. The digital filter could provide the >frequency smoothing you seek. Yes having two phase accumulators may be tricky to comprehend to begin with. The filter idea is good, so I am adding the SLEW by careful choice of the coefficients in the filter (FIR filter I assume) The filters output would then control the second/output PLL phase accumulator. and the filter examples can be found at http://www.piclist.com/techref/default.asp?from=/techref/piclist/codegen/../ ../microchip/math/&url=filter.htm Either FFT or IIR. Do you recommend a better source of code info? > Here's the code that implements the above hardware: Thanks very much, I'll try it out. > It looks to me that if the control is de-asserted that the > output would be the > input with 4 out of 16 pulses being suppressed. Yes this is what I meant by 3/4 scaling, allows 12 out of 16 pulses through hence 3/4. > If the frequency of the control > is greater than half the frequency of the input, then the > output would exactly > match the input. If the control is between 0 and one half the > input then any > where bewteen 1 and 4 pulses out of 16 will be suppressed. In > some cases, a > pulse may be partially suppressed (e.g. control is > asynchrounous to input). O.K. As the "upper limit" INPUT conditions that I'm trying to control are always more than 2 times the CONTROL frequency it would be loosing 4 out of 16 pulses. But as the INPUT and CONTROL differential became smaller and smaller, until the point that the INPUT is twice the CONTROL, the amount of pulses lost would get smaller 4,3,2,1 and eventually 0 when the CONTROL signal has no effect. Thanks once again. Pete