5: BASIC Stamp Command Reference - DTMFOUT
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 109
The BASIC Stamp 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 BASIC Stamp 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 I/O pin is a rapid stream of pulses. The purpose of the filtering
arrangements shown in Figures 5.2 and 5.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 BASIC Stamp's 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 in Figure 5.2 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 (DTMFOUT.bs2)
This demo program is a rudimentary memory dialer. Since DTMF digits fit within a nibble (four
bits), the program below packs two DTMF digits into each byte of three EEPROM data tables.
The end of a phone number is marked by the nibble $F, since this is not a valid phone-dialing
digit.
'{$STAMP BS2} 'STAMP directive (specifies a BS2)
'-----Define variables-----
EEloc VAR BYTE ' EEPROM address of stored number.
EEByte VAR BYTE ' Byte containing two DTMF digits.
NOTE: This is written for the BS2
but can be used for the BS2e,
BS2sx and BS2p also. Locate the
proper source code file or modify
the STAMP directive before
downloading to the BS2e, BS2sx or
BS2p.
2
e
2
sx
2
p
2
Jameco (JC), 1-800-831-4242
or 415-592-8097
Interfacing to the
Telephone Line
600-600
Ω
transformer
(JC: 117760)
270V “Sidactor”
(DK: P3000AA61-ND
P3000AA61-ND)
10
Ω
(both)
3.9V zeners (both)
DK: 1N5228BCT-ND
phone line
(red and green)
0.001
µ
F
0.1
µ
F
1 k
Ω
connect switch (or
relay contacts)
Digi-Key (DK), 1-800-344-4539
or 218-681-6674
from I/O pin
Vss
Figure 5.3: Example DAA Circuit to
Interface to a Standard Telephone
Line.
T
ECHNICAL
B
ACKGROUND
.
Содержание BASIC Stamp 2e
Страница 1: ...BASIC Stamp Programming Manual Version 2 0c...
Страница 30: ...Introduction to the BASIC Stamps Page 28 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 90: ...BUTTON BASIC Stamp Command Reference Page 88 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 118: ...END BASIC Stamp Command Reference Page 116 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 128: ...FREQOUT BASIC Stamp Command Reference Page 126 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 196: ...NAP BASIC Stamp Command Reference Page 194 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 206: ...OWIN BASIC Stamp Command Reference Page 204 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 214: ...OWOUT BASIC Stamp Command Reference Page 212 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 216: ...PAUSE BASIC Stamp Command Reference Page 214 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 226: ...POLLMODE BASIC Stamp Command Reference Page 224 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 232: ...POLLOUT BASIC Stamp Command Reference Page 230 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 236: ...POLLRUN BASIC Stamp Command Reference Page 234 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 240: ...POLLWAIT BASIC Stamp Command Reference Page 238 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 262: ...RCTIME BASIC Stamp Command Reference Page 260 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 274: ...RUN BASIC Stamp Command Reference Page 272 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 310: ...SEROUT BASIC Stamp Command Reference Page 308 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 324: ...STOP BASIC Stamp Command Reference Page 322 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...