<<

AN-580 a APPLICATION NOTE One Technology Way • P.O. Box 9106 • Norwood, MA 02062-9106 • Tel: 781/329-4700 • Fax: 781/326-8703 • www.analog.com

Programmable Oscillator Uses Digital Potentiometers by Alan Li, Analog Devices, San Jose, CA

Digital potentiometers are versatile, and can be used in Substituting s = j and rearranging the real and imagi- many filtering and waveform generation applications. nary terms give: This design describes an oscillator where setting the + resistance of the digital potentiometers programs the 12R R1 frequency and amplitude independently. Aj()()ωβ j ω= (2)  1  Figure 1 shows a typical -stabilized Wien-bridge 3 + jRCω –   ω  oscillator that can be used to generate accurate sine RC waves from 10 k to 200 kHz. Since the phase angle of the is defined as:

ADJUST TO SAME SETTINGS  Im Aj()()ωβ j ω  R' FOR FREQUENCY TUNING C' ⍀ phase angle= arctan   (3) VP A 10k B  ωβ ω  B Re Aj()() j  C W 2.2nF W 2.2nF +2.5V A R 10k⍀ We force the imaginary term to zero to set the phase shift V+ to zero. As a result, the oscillation frequency becomes: AD8510 VO V– ω = 1 = 1 O or fO (4) RC 2πRC –2.5V R = R' = 1/2 AD5232 10k⍀ R2a R2b = AD5231 100k⍀ 2.1k⍀ D1 = D2 = 1N4148 where R is the programmable resistance as: VN U1 = AD8510, OP1177 D1 256 – D R2b = ⍀ R R AB (5) 100k AB 256 D2 R1 W and D is the decimal equivalent of the digital code 1k⍀ programmed in the AD5232. RAB is the end-to-end resis- AMPLITUDE CONTROL tance of AD5232. Figure 1. Programmable Wien-Bridge Oscillator with To sustain oscillation, the bridge must be in balance. If Amplitude Stabilization the is too large, oscillation amplitude In this classic oscillator circuit, the Wien network (R, R', will increase until the amplifier saturates. If the negative C, C') provides positive feedback, while R1 and R2 pro- feedback is too large, the oscillation amplitude will be ʈ vide with R2 = R2a (R2b + RDIODE). To damped out. According to equation (2), the attenuation establish a sustainable oscillation, the phase shift of the of the loop gain is 3 at resonance. Thus setting: loop gain should be zero and the magnitude of the loop R 2 gain should be unity. In this circuit, the loop gain, = 2 (6) A(j)(j), can be found by multiplying the amplifier R1 balances the bridge. In practice, R2/R1 should be set gain with the transfer function VP/VO. With R = R' and C = C', the loop gain is: slightly larger than 2 to ensure the oscillation can start. On the other hand, the alternate turn-on of the 121+ RR/ As()()β s = ensures R2/R1 to be smaller than 2 momentarily and 1 (1) 3 ++sRC therefore stabilizes the oscillation. sRC Once the oscillation frequency is determined, the ampli- tude can be tuned independently by R2b since:

2 =+ VIRVODbD2 (7) 3

REV. 0 © Analog Devices, Inc., 2002 AN-580

R2b can simply be shorted which gives oscillation ampli- can be used in daisy-chain mode so that parts can be tude of approximately ±0.6 V. On the other hand, VO, ID, programmed to the same setting simultaneously. and VD are interdependent variables. With proper selec- Tek PreVuT Trig’d tion of R2b, equilibrium can be reached such that VO ⍀ T converges. However, R2b should not be too large to R2b = 20k saturate the output. In this circuit, we applied a sepa- R = 8.06k⍀ f = 8.8kHz rate 100 kΩ digital potentiometer as R2b. By adjusting R1 the resistance setting from the minimum scale to 35 kΩ, we were able to adjust the oscillation amplitude from R = 4.05k⍀ ±0.6 V to ±2.3 V. R2 f = 17.6kHz Finally, using 2.2 nF for C and C', 10 kΩ dual digital

E02802–0–2/02(0) Ω Ω Ω potentiometer with R and R' set to 8 k , 4 k , and 670 , R = 670⍀ oscillation can be tuned to 8.8 kHz, 17.6 kHz, and 102 kHz R3 f = 102kHz respectively with ±3% error (Figure 2). Higher frequency is achievable with an increase in error. At 200 kHz, the error becomes 6%. Although it deviates from the speci- M 40.0␮s A CH1 200mV ± fication, AD8510 was found to be working at 2.5 V in REF2 1.00V 20.0␮s T –80.0000ns this circuit. Figure 2. Programmable Frequency Two notes of caution: In frequency-dependent applica- tions, the bandwidth of the digital potentiometer is a REFERENCES function of the programmed resistance. Therefore, care 1. Sergio Franco, Design with Operational Amplifiers must be taken not to violate the bandwidth limitations. In and Analog Integrated Circuits, Second Edition, addition, the frequency tuning in Figure 1 requires that R McGraw- Hill, 1998. and R' be adjusted to the same setting. Since the two channels can be adjusted one at a time, an intermediate 2. Sedra/Smith, Microelectronic Circuits, Fourth Edition, state will occur that may not be acceptable for certain Oxford, 1998. applications. If this becomes an issue, separate devices 3. Walter G. Jung, IC Op-Amp Cookbook, Third Edition, Prentice Hall, 1997.

PRINTED IN U.S.A.

–2– REV. 0