Michael 2727
Senior Member
After a lot of mucking about, banging my head against the wall,
faulty Chips and not nearly enough test gear for the task.
I finally got this to work
Using only a dual core 08M setup I've managed to dial up
my IP server susseccfully. Why my IP server ?, because
it doesn't bother a machine if you hang up, people get annoyed.
Now I didn't do anything illegal, I simply played a recorded .WAV
generated using the " Preset Code " listed below into the mouthpeice
of my phone from my PC speaker. I did shorten the gaps between
the tones first. No direct line connection was needed.
There are 2 modes you can use -
1: A Preset Number placed into the Preset version Code, up to 15 Digits long.
2: Using a Keypad and an ADC input on the #1 Chip, any number length.
I may work on a third version where it will spit out the DTMF of a number
that is sent to the serin input of Chip#1.
The second option using the ADC input may be the fiddly part.
The principal behind this option has been discussed on the forum
on a number of occasions here -
Picaxe Archive 18: http://www.picaxeforum.co.uk/showthread.php?t=4563
12 inputs on a single ADC.
or more recently -
User Projects - Miscellaneous: http://www.picaxeforum.co.uk/showthread.php?t=7791
ADC or 'one input' Keypad Decoder.
I will not go into any detail using the ADC option, as there
will be varying results for each and every user setup.
The links should provide more than enough information to
get you going and it may be a fiddly operation to fine tune
and tweek your particular setup, so I can't help you there.
Do the best you can.
All Codes listed below -
I would also like to thank Arvin for helping me out when
I was having Hardware and temperamental Chip and
bad hair days.
faulty Chips and not nearly enough test gear for the task.
I finally got this to work
Using only a dual core 08M setup I've managed to dial up
my IP server susseccfully. Why my IP server ?, because
it doesn't bother a machine if you hang up, people get annoyed.
Now I didn't do anything illegal, I simply played a recorded .WAV
generated using the " Preset Code " listed below into the mouthpeice
of my phone from my PC speaker. I did shorten the gaps between
the tones first. No direct line connection was needed.
There are 2 modes you can use -
1: A Preset Number placed into the Preset version Code, up to 15 Digits long.
2: Using a Keypad and an ADC input on the #1 Chip, any number length.
I may work on a third version where it will spit out the DTMF of a number
that is sent to the serin input of Chip#1.
The second option using the ADC input may be the fiddly part.
The principal behind this option has been discussed on the forum
on a number of occasions here -
Picaxe Archive 18: http://www.picaxeforum.co.uk/showthread.php?t=4563
12 inputs on a single ADC.
or more recently -
User Projects - Miscellaneous: http://www.picaxeforum.co.uk/showthread.php?t=7791
ADC or 'one input' Keypad Decoder.
I will not go into any detail using the ADC option, as there
will be varying results for each and every user setup.
The links should provide more than enough information to
get you going and it may be a fiddly operation to fine tune
and tweek your particular setup, so I can't help you there.
Do the best you can.
All Codes listed below -
Code:
'
'
' DTMF Generator, Dual 08M Core.
' By Michael Jeffery (C) Oct 08 2007.
' Code for Chip#1 of 2, DTMF Dialer using ADC-4 as the input.
' 2 x 08M Chips are needed.
' See also, Chip#2 Code for DTMF Dialer.(Listen code)
'
'
'tune 0, 3,(69) '-DEC,698Hz, TUNE Value =$45, DTMF Value 697Hz, Row 1.
'tune 0, 3,(71) '-DEC,784Hz, TUNE Value =$47, DTMF Value 770Hz. Row 2.
'tune 0, 3,(72) '-DEC,831Hz, TUNE Value =$48, DTMF Value 852Hz. Row 3.
'tune 0, 3,(74) '-DEC,932Hz, TUNE Value =$4A, DTMF Value 941Hz. Row 4.
'tune 0, 3,(204)'-DEC,Pause
'tune 0, 3,(82) '-DEC,1245Hz, TUNE Value =$52, DTMF Value 1209Hz. Col 1.
'tune 0, 3,(84) '-DEC,1318Hz, TUNE Value =$54, DTMF Value 1336Hz. Col 2.
'tune 0, 3,(86) '-DEC,1480Hz, TUNE Value =$56, DTMF Value 1477Hz. Col 3.
'
' The TUNE frequencies are not a perfect match for the DTMF Spec, but are within
' 2.2 %, some DTMF Specs quote within 1.5 %, but the above does also work.
' The TUNE output is also a Square Wave, DTMF tones need to be Sine Wave
' so Capacitors on the output are added to round up the signal slightly.
' An OP Amp configured as a Square to Sine converter could be added to
' filter the output for a better result.
'
'
'
#picaxe 08m
SAMPLE:
'
readadc 4,b8
pause 10 ' Actual ADC measured @ 4.05 Volts.
if b8 <=16 then SAMPLE ' is 115 = 120k = Silence,was 117
if b8 <=30 then Button_1 ' is 120 = 110k, was 123
if b8 <=50 then Button_2 ' is 126 = 100k, was 130
if b8 <=70 then Button_3 ' is 133 = 90k, was 136
if b8 <=90 then Button_4 ' is 140 = 80k, was 145
if b8 <=110 then Button_5 ' is 149 = 70k, was 153
if b8 <=136 then Button_6 ' is 158 = 60k, was 164
if b8 <=157 then Button_7 ' is 169 = 50k, was 175
if b8 <=180 then Button_8 ' is 181 = 40k, was 189
if b8 <=200 then Button_9 ' is 195 = 30k, was 202
if b8 <=222 then Button_H ' is 211 = 20k, was 220
if b8 <=243 then Button_0 ' is 231 = 10k, was 240
if b8 <=255 then Button_S ' is 254 = shorted out
'
Button_1:
serout 0,N2400,(4)
pause 25
tune 0, 6,($45)
pause 600
goto SAMPLE
'
Button_2:
serout 0,N2400,(5)
pause 25
tune 0, 6,($45)
pause 600
goto SAMPLE
'
Button_3:
serout 0,N2400,(6)
pause 25
tune 0, 6,($45)
pause 600
goto SAMPLE
'
Button_4:
serout 0,N2400,(4)
pause 25
tune 0, 6,($47)
pause 600
goto SAMPLE
'
Button_5:
serout 0,N2400,(5)
pause 25
tune 0, 6,($47)
pause 600
goto SAMPLE
'
Button_6:
serout 0,N2400,(6)
pause 25
tune 0, 6,($47)
pause 600
goto SAMPLE
'
Button_7:
serout 0,N2400,(4)
pause 25
tune 0, 6,($48)
pause 600
goto SAMPLE
'
Button_8:
serout 0,N2400,(5)
pause 25
tune 0, 6,($48)
pause 600
goto SAMPLE
'
Button_9:
serout 0,N2400,(6)
pause 25
tune 0, 6,($48)
pause 600
goto SAMPLE
'
Button_S:
serout 0,N2400,(4)
pause 25
tune 0, 6,($4A)
pause 600
goto SAMPLE
'
Button_0:
serout 0,N2400,(5)
pause 25
tune 0, 6,($4A)
pause 600
goto SAMPLE
'
Button_H:
serout 0,N2400,(6)
pause 25
tune 0, 6,($4A)
pause 600
goto SAMPLE
'
'
'********************************************************************
'
' DTMF Generator, Dual 08M Core.
' By Michael Jeffery (C) Oct 08 2007.
' Code for Chip#1 of 2, DTMF Dialer using a Preset Number code.
' Input3 used to initiate Dialing.
' 2 x 08M Chips are needed.
' See also, Chip#2 Code for DTMF Dialer.(Listen code)
'
'
'tune 0, 8,(69) '-DEC,698Hz, TUNE Value =$45, DTMF Value 697Hz, Row 1.
'tune 0, 8,(71) '-DEC,784Hz, TUNE Value =$47, DTMF Value 770Hz. Row 2.
'tune 0, 8,(72) '-DEC,831Hz, TUNE Value =$48, DTMF Value 852Hz. Row 3.
'tune 0, 8,(74) '-DEC,932Hz, TUNE Value =$4A, DTMF Value 941Hz. Row 4.
'tune 0, 8,(204)'-DEC,Pause
'tune 0, 8,(82) '-DEC,1245Hz, TUNE Value =$52, DTMF Value 1209Hz. Col 1.
'tune 0, 8,(84) '-DEC,1318Hz, TUNE Value =$54, DTMF Value 1336Hz. Col 2.
'tune 0, 8,(86) '-DEC,1480Hz, TUNE Value =$56, DTMF Value 1477Hz. Col 3.
'
'
#picaxe 08m
PRESET:
'
'
if pin3 = 1 then Dial
pause 500
goto PRESET
'
Dial:
'
gosub Button_1 'insert number to be dialed here, Button_X.
gosub Button_2 'insert number to be dialed here, Button_X.
gosub Button_3 'insert number to be dialed here, Button_X.
gosub Button_4 'insert number to be dialed here, Button_X.
gosub Button_5 'insert number to be dialed here, Button_X.
gosub Button_6 'insert number to be dialed here, Button_X.
gosub Button_7 'insert number to be dialed here, Button_X.
gosub Button_8 'insert number to be dialed here, Button_X.
'
'gosub Button_0 'insert number to be dialed here, Button_X.
'gosub Button_0 'insert number to be dialed here, Button_X.
'gosub Button_0 'insert number to be dialed here, Button_X.
'gosub Button_0 'insert number to be dialed here, Button_X.
'gosub Button_0 'insert number to be dialed here, Button_X.
'gosub Button_0 'insert number to be dialed here, Button_X.
'gosub Button_0 'insert number to be dialed here, Button_X.
'
'
goto PRESET
'
'
Button_1:
serout 0,N2400,(4)
pause 25
tune 0, 6,($45)
pause 600
return
'
Button_2:
serout 0,N2400,(5)
pause 25
tune 0, 6,($45)
pause 600
return
'
Button_3:
serout 0,N2400,(6)
pause 25
tune 0, 6,($45)
pause 600
return
'
Button_4:
serout 0,N2400,(4)
pause 25
tune 0, 6,($47)
pause 600
return
'
Button_5:
serout 0,N2400,(5)
pause 25
tune 0, 6,($47)
pause 600
return
'
Button_6:
serout 0,N2400,(6)
pause 25
tune 0, 6,($47)
pause 600
return
'
Button_7:
serout 0,N2400,(4)
pause 25
tune 0, 6,($48)
pause 600
return
'
Button_8:
serout 0,N2400,(5)
pause 25
tune 0, 6,($48)
pause 600
return
'
Button_9:
serout 0,N2400,(6)
pause 25
tune 0, 6,($48)
pause 600
return
'
Button_S:
serout 0,N2400,(4)
pause 25
tune 0, 6,($4A)
pause 600
return
'
Button_0:
serout 0,N2400,(5)
pause 25
tune 0, 6,($4A)
pause 600
return
'
Button_H:
serout 0,N2400,(6)
pause 25
tune 0, 6,($4A)
pause 600
return
'
'
goto PRESET
'
'
'********************************************************************
'
'
' By Michael Jeffery (C) OCT 2007.
' Code for Chip#2 of 2, DTMF Dialer.
' 2 x 08M Chips are needed.
' See also, Chip#1 Code for DTMF Dialer.(Dialer Code) or
' Code for Chip#1 of 2, DTMF Dialer using a Preset Number code.
'
'
#picaxe 08m
Listen:
b0=0
serin 1,N2400,b0
pause 20
if b0 = 4 then Col_1 'DTMF Value 1209Hz. Col 1.
if b0 = 5 then Col_2 'DTMF Value 1336Hz. Col 2.
if b0 = 6 then Col_3 'DTMF Value 1477Hz. Col 3.
goto Listen
Col_1:
tune 0, 6,($52)
pause 600
goto Listen
Col_2:
tune 0, 6,($54)
pause 600
goto Listen
Col_3:
tune 0, 6,($56)
pause 600
goto Listen
'
'
' Deselect the codes not needed when downloading to
' each chip ( #1 or #2 ) or an error warning will result.
'
' Have Fun !
I was having Hardware and temperamental Chip and
bad hair days.
Attachments
-
7.3 KB Views: 509