Specifications
BASIC Stamp II
Page 258 • BASIC Stamp Programming Manual 1.8 • Parallax, Inc.
a noisy phone line or radio link, you could use the optional ontime and
offtime values:
DTMFOUT 0,500,100,[6,2,4,8,3,3,3] ' Call Parallax, slowly.
In that instruction, ontime is set to 500 ms (1/2 second) and offtime to
100 ms (1/10th second).
Technical Background
The BS2’s controller is a purely digital device. DTMF tones are analog
waveforms, consisting of a mixture of two sine waves at different audio
frequencies. So how does a digital device generate analog output? The
BS2 creates and mixes the sine waves mathematically, then uses the
resulting stream of numbers to control the duty cycle of a very fast
pulse-width modulation (PWM) routine. So what’s actually coming out
of the BS2 pin is a rapid stream of pulses. The purpose of the filtering
arrangements shown in the schematics of figures I-2 and I-3 is to smooth
out the high-frequency PWM, leaving only the lower frequency audio
behind.
Keep this in mind if you want to interface BS2 DTMF output to radios
and other equipment that could be adversely affected by the presence
of high-frequency noise on the input. Make sure to filter the DTMF
output thoroughly. The circuits shown here are only a starting point;
you may want to use an active low-pass filter with a roll-off point
around 2 kHz.
Demo Program
This demo program is a rudimentary memory dialer. Since DTMF
Figure I-2
10µF (both)
+
+
≥40Ω Speaker
(or 8Ω in series
with 33Ω resistor)
I/O pin
C1 C2
Notes:
C1 may be omitted for piezo speakers
C2 is optional, but reduces high-frequency noise
I/O pin
Driving a Speaker
1k
0.1µF 0.01µF
1k
Driving an Audio Amplifier
Amplifier
(e.g., Radio Shack
277-1008C)










