DTMF decode question
lfreeze
Posts: 174
I am using a bs2 to generate dtmf. I am using an cm8870 receiver to decode
the dtmf. All works well with with exception of dtmf "0", "1" or "11". I tried
replacing all the components including the stamp. The result is always the
same. The dtmf all decode correctly with the exception "0", "1" or "11"
I tried a couple of cap filters (.1 uf to .001 uf ) with no luck.
Can anyone help. I've reached the point where I am going to try a
different decode chip, but would rather avoid the time and expense
I tried the California Micro devices website, but they do not offer technical
help.
Hope someone can help
Thanks.......
Larry
the dtmf. All works well with with exception of dtmf "0", "1" or "11". I tried
replacing all the components including the stamp. The result is always the
same. The dtmf all decode correctly with the exception "0", "1" or "11"
I tried a couple of cap filters (.1 uf to .001 uf ) with no luck.
Can anyone help. I've reached the point where I am going to try a
different decode chip, but would rather avoid the time and expense
I tried the California Micro devices website, but they do not offer technical
help.
Hope someone can help
Thanks.......
Larry
Comments
Rick
thanks for the response. Yes I have the data sheet. I played with various gap lengths
but it did not help.· The binary values and freqs for the ones that are causing problems are:
freq-low······· freq-high······· binary value······ key
697·············· 1209············· 0001················· 0
941·············· 1336············· 1010················· 1
941·············· 1209············· 1011················· *
This info was extracted from the cm8870 data sheet
HERE IS THE CODE i AM USING
'FIRST STAMP GENERATES DTMF TONES
top
·'dtmfout 9,300,300,[noparse][[/noparse]0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
dtmfout 9,500,500,[noparse][[/noparse]1,1,1]
pause 1000
dtmfout 9,500,500,[noparse][[/noparse]0,0,0]
pause 1000
goto top
'SECOND STAMP SET UP TO READ DTMF GENERATED BY FIRST
top
debug " ",dec inc, " ",bin inc, cr
pause 1000
goto top
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
dual tones. I'll look at the manual and try it.
Thanks ...
Larry
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
' {$STAMP BS2}
' {$PBASIC 2.5}
Spkr PIN 10 ' Speaker / amplifier pin
Freq1 VAR Word
Freq2 VAR Word
digit VAR Byte ' DTMF digit
eePtr VAR Byte ' EEPROM pointer
Phone DATA "", 0 ' Phone #
eePtr = Phone
Dial_Phone:
DEBUG "Calling: "
DO
READ eePtr, digit ' read a digit
eePtr = eePtr + 1 ' update eePtr pointer
IF (digit = 0) THEN EXIT ' when zero, number is done
IF (digit >= "0") AND (digit <= "9") THEN
DEBUG digit
digit = digit - 48
GOSUB DTMF
ENDIF
LOOP
DEBUG CR, CR
END
DTMF:
IF (Digit = 0) THEN
Freq1 = 934
ENDIF
IF (Digit >= 7) AND (Digit <= 9) THEN
Freq1 = 845
ENDIF
IF (Digit >= 4) AND (Digit <= 6) THEN
Freq1 = 763
ENDIF
IF (Digit >= 1) AND (Digit <= 3) THEN
Freq1 = 690
ENDIF
IF (Digit = 1) OR (Digit = 4) OR (Digit = 7) THEN
Freq2 = 1202
ENDIF
IF (Digit = 2) OR (Digit = 5) OR (Digit = 8) OR (Digit = 0) THEN
Freq2 = 1329
ENDIF
IF (Digit = 3) OR (Digit = 6) OR (Digit = 9) THEN
Freq2 = 1468
ENDIF
FREQOUT Spkr, 150, Freq1, Freq2
PAUSE 45
RETURN
Post Edited (Jeffrey) : 3/15/2005 7:17:27 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
I don't see any code to read the data valid (StD) pin or the 4 data lines. Is the code for the 2nd bs2 complete? Something is missing.
Rick
The "INC" will grab the four data pins and diplay it in binary (presuming it's wired correctly), but indeed the data valid is not picked up as far as I can see. I can see how it could be overlooked, as StD is hardly mentioned in the datasheet.
Regards,
Bruce Bates
In the real world, the next tone burst may arrive before the stamp can finish the debug statement depending on baud rate and dtmf rep rate.
Rick
Post Edited (RickB) : 3/16/2005 5:00:27 PM GMT
After scratching my head for several hours it dawned on me the
binary decoded values were all correct. The debug was showing
the correct decimal value for the binary number that was decoded.
What I need to create is a debug statement that will show the dtmf number and the decimal value.
The table below shows the values I got when running my program for·dtmf 3,0,7, and 10.
DTMF from stamp----debug shows dec value·----debug shows binary value·
········ 3························ 3······································ 0011
········ 0························ 10···································· 1010
········ 7·························7······································ 0111
········ 10······················ 11····································· 1011
· The program I am using to read the dtmf is:
top
code var byte
code=inc
if in14=0 then hhhh 'std of cm8870
goto top
hhhh
if in14=0 then decode
goto top
decode
debug " ",dec code," ",bin code,cr
goto top
·Thank you for all the help....
LArry
·
Point of interest. I'm pretty sure DTMF has 16 tones, but only 12 are used by most systems, like a telephone, has 0 though 9 and then # and * The other 4 tones are reserved in phone systems for system functions.