BS2 Code for an 8870 DTMF Decoder
I have a bunch of 8870 DTMF decoders I want to use for some projects. Its a little brother to the 8880 for which there is a lot of code.
The 8870, since it only neds to decode doesn't seem to need much of the code commanding read or write etc. I did some quick breadbaording and coding yesterday but had no luck ... essentially I looped reading the 'Data valid' pin, then when it asserted, I read the four data pins. I know I am doing something wrong so .... I thought I would ask around.
Anybody got some 8870 code to share? TNX.
cheers ... 73 de brian, n1bq, underhill center, vermont
The 8870, since it only neds to decode doesn't seem to need much of the code commanding read or write etc. I did some quick breadbaording and coding yesterday but had no luck ... essentially I looped reading the 'Data valid' pin, then when it asserted, I read the four data pins. I know I am doing something wrong so .... I thought I would ask around.
Anybody got some 8870 code to share? TNX.
cheers ... 73 de brian, n1bq, underhill center, vermont
Comments
··········· You should be able to just use· the old docs we had on the 8880 and just remove the transmit part, but if not I did a quick search and found this site http://www.bobblick.com/techref/projects/tonedec/tonedec.html
I have also attached our old docs to the post.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Stephen Swanson
Technical Support
Parallax, Inc.
sswanson@parallax.com
I used the string "8870 dtmf decode bs2" in Google and I got this:
<http://pages.infinit.net/cyrberg/files/Phone_V1.pdf>
Thanks, I will get back at you with a cleaned up version of the 8870 part of this code as soon as I get it working
cheers ... 73 de brian, n1bq, underhill center, vermont
'---------------------- ' M8870 Code Snippet '---------------------- '----[noparse][[/noparse] Constants ]------------------------------------------------------- Q0 PIN 0 ' data bit 0 Q1 PIN 1 ' data bit 1 Q2 PIN 2 ' data bit 2 Q3 PIN 3 ' data bit 3 '----- StD PIN 4 ' delayed steering - i.e. valid data TOE PIN 5 ' Tri-state output enable raise logic high ' to get data from chip TIMEOUT CON 5000 ' some value for timeout so loop ends '------------------------------------------------------------------------- Tone_val VAR Byte index VAR Word '------------------------------------------------------------------------- ' Get_DTMF - returns 0-15 for valid DTMF, 99 for timeout '-------------------------------------------------------- Get_DTMF: Tone_val =99 FOR index=0 to TIMEOUT STEP 1 IF IN4 = 1 THEN HIGH TOE Tone_val = INA LOW TOE EXIT ENDIF NEXT RETURN