### AN-580: Programmable Oscillator Uses Digital Potentiometers (Rev. 0) PDF

```a
AN-580
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
many filtering and waveform generation applications.
This design describes an oscillator where setting the
resistance of the digital potentiometers programs the
oscillation frequency and amplitude independently.
Figure 1 shows a typical diode-stabilized Wien-bridge
oscillator that can be used to generate accurate sine
waves from 10 k to 200 kHz.
VP
C
2.2nF
B W
C'
2.2nF
+2.5V
A R
10k⍀
FOR FREQUENCY TUNING
R'
A 10k⍀ B
W
D1
R = R' = 1/2 AD5232 10k⍀
D1 = D2 = 1N4148
R =
D2
(3)
Figure 1. Programmable Wien-Bridge Oscillator with
Amplitude Stabilization
In this classic oscillator circuit, the Wien network (R, R',
C, C') provides positive feedback, while R1 and R2 provide negative feedback with R2 = R2a储(R2b + RDIODE). To
establish a sustainable oscillation, the phase shift of the
loop gain should be zero and the magnitude of the loop
gain should be unity. In this circuit, the loop gain,
A(j)(j), can be found by multiplying the amplifier
gain with the transfer function VP/VO. With R = R' and C = C',
the loop gain is:
1+ R 2 / R1
1
3 + sRC +
sRC
1
1
or f O =
2πRC
RC
(4)
256 – D
R AB
256
(5)
and D is the decimal equivalent of the digital code
AMPLITUDE CONTROL
(1)
To sustain oscillation, the bridge must be in balance. If
the positive feedback is too large, oscillation amplitude
will increase until the amplifier saturates. If the negative
feedback is too large, the oscillation amplitude will be
damped out. According to equation (2), the attenuation
of the loop gain is 3 at resonance. Thus setting:
R2
=2
R1
(6)
balances the bridge. In practice, R2/R1 should be set
slightly larger than 2 to ensure the oscillation can start.
On the other hand, the alternate turn-on of the diodes
ensures R2/R1 to be smaller than 2 momentarily and
therefore stabilizes the oscillation.
Once the oscillation frequency is determined, the amplitude can be tuned independently by R2b since:
2
VO = I D R 2b + V D
3
REV. 0
(2)
where R is the programmable resistance as:
R2b
B100k⍀ A
A (s )β(s ) =
 Im A ( j ω )β( j ω ) 
phase angle = arctan 

 Re A ( j ω )β( j ω ) 


ωO =
R2a
2.1k⍀
W

1 
3 + j  ωRC –


ωRC 
Since the phase angle of the loop gain is defined as:
VO
–2.5V
R1
1k⍀
A ( j ω) β ( j ω) =
1+ R2
R1
We force the imaginary term to zero to set the phase shift
to zero. As a result, the oscillation frequency becomes:
V+
V–
VN
Substituting s = j and rearranging the real and imaginary terms give:
(7)
AN-580
can be used in daisy-chain mode so that parts can be
programmed to the same setting simultaneously.
Tek PreVu
Trig’d
T
R2b = 20k⍀
T
R = 8.06k⍀
f = 8.8kHz
R1
Finally, using 2.2 nF for C and C', 10 kΩ dual digital
potentiometer with R and R' set to 8 kΩ, 4 kΩ, and 670 Ω,
oscillation can be tuned to 8.8 kHz, 17.6 kHz, and 102 kHz
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 specification, AD8510 was found to be working at ±2.5 V in
this circuit.
R2
R = 4.05k⍀
f = 17.6kHz
R3
R = 670⍀
f = 102kHz
M 40.0␮s
REF2
1.00V
20.0␮s T
A CH1
E02802–0–2/02(0)
R2b can simply be shorted which gives oscillation amplitude of approximately ±0.6 V. On the other hand, VO, ID,
and VD are interdependent variables. With proper selection of R2b, equilibrium can be reached such that VO
converges. However, R2b should not be too large to
saturate the output. In this circuit, we applied a separate 100 kΩ digital potentiometer as R2b. By adjusting
the resistance setting from the minimum scale to 35 kΩ,
we were able to adjust the oscillation amplitude from
±0.6 V to ±2.3 V.
200mV
–80.0000ns
Figure 2. Programmable Frequency
Two notes of caution: In frequency-dependent applications, the bandwidth of the digital potentiometer is a
function of the programmed resistance. Therefore, care
must be taken not to violate the bandwidth limitations. In
addition, the frequency tuning in Figure 1 requires that R
and R' be adjusted to the same setting. Since the two
channels can be adjusted one at a time, an intermediate
state will occur that may not be acceptable for certain
applications. If this becomes an issue, separate devices
REFERENCES
1. Sergio Franco, Design with Operational Amplifiers