Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {{
- ┌──────────────────────────────────────────┐
- │ DTMF_Dialer.spin │
- │ Author: tymkrs.com │
- │ See end of file for terms of use. │
- └──────────────────────────────────────────┘
- Circuit diagram:
- all caps are 10µf
- prop pin 0 ─┬────┬──┐
- prop pin 1 ──┘ ←speaker
- ┌────────┴──┘
-
- VSS
- }}
- CON
- _clkmode = xtal1 + pll16x
- _xinfreq = 5_000_000
- Left_Audio_Pin = 1 'First audio pin
- Right_Audio_Pin = 0 'Second audio pin
- OBJ
- s : "Synth"
- Pub Main
- tone("6")
- tone("0")
- tone("1")
- waitcnt(clkfreq + cnt)
- AllTones
- Pub AllTones
- tone("`")
- tone("~")
- tone("x")
- tone("x")
- tone("x")
- tone("x")
- tone("y")
- tone("y")
- tone("y")
- tone("y")
- tone("z")
- tone("z")
- tone("z")
- tone("z")
- tone("a")
- tone("b")
- tone("c")
- tone("d")
- tone("e")
- tone("f")
- tone("g")
- tone("h")
- tone("i")
- tone("j")
- tone("k")
- tone("l")
- tone("m")
- tone("n")
- tone("o")
- tone("1")
- tone("2")
- tone("3")
- tone("A")
- tone("4")
- tone("5")
- tone("6")
- tone("B")
- tone("7")
- tone("8")
- tone("9")
- tone("C")
- tone("*")
- tone("0")
- tone("#")
- tone("D")
- PUB tone(key) | Index
- case key
- 'Touch Tone DTMF
- "1":
- s.synth("A", Left_Audio_Pin, 1209)
- s.synth("B", Right_Audio_Pin, 697)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "2":
- s.synth("A", Left_Audio_Pin, 1336)
- s.synth("B", Right_Audio_Pin, 697)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "3":
- s.synth("A", Left_Audio_Pin, 1477)
- s.synth("B", Right_Audio_Pin, 697)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "4":
- s.synth("A", Left_Audio_Pin, 1209)
- s.synth("B", Right_Audio_Pin, 770)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "5":
- s.synth("A", Left_Audio_Pin, 1336)
- s.synth("B", Right_Audio_Pin, 770)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "6":
- s.synth("A", Left_Audio_Pin, 1477)
- s.synth("B", Right_Audio_Pin, 770)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "7":
- s.synth("A", Left_Audio_Pin, 1209)
- s.synth("B", Right_Audio_Pin, 852)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "8":
- s.synth("A", Left_Audio_Pin, 1336)
- s.synth("B", Right_Audio_Pin, 852)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "9":
- s.synth("A", Left_Audio_Pin, 1477)
- s.synth("B", Right_Audio_Pin, 852)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "0":
- s.synth("A", Left_Audio_Pin, 1336)
- s.synth("B", Right_Audio_Pin, 941)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "*":
- s.synth("A", Left_Audio_Pin, 1209)
- s.synth("B", Right_Audio_Pin, 941)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "#":
- s.synth("A", Left_Audio_Pin, 1477)
- s.synth("B", Right_Audio_Pin, 941)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "A":
- s.synth("A", Left_Audio_Pin, 1633)
- s.synth("B", Right_Audio_Pin, 697)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "B":
- s.synth("A", Left_Audio_Pin, 1633)
- s.synth("B", Right_Audio_Pin, 770)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "C":
- s.synth("A", Left_Audio_Pin, 1633)
- s.synth("B", Right_Audio_Pin, 852)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "D":
- s.synth("A", Left_Audio_Pin, 1633)
- s.synth("B", Right_Audio_Pin, 941)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- 'Supervisory Signals (2600)
- "`": '2600
- s.synth("A", Left_Audio_Pin, 2600)
- s.synth("B", Right_Audio_Pin, 2600)
- waitcnt(clkfreq + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- "~": 'International
- s.synth("A", Left_Audio_Pin, 2600)
- s.synth("B", Right_Audio_Pin, 2400)
- waitcnt(clkfreq + cnt)
- s.synth("A", Left_Audio_Pin, 2400)
- s.silence_b(Right_Audio_Pin)
- waitcnt(clkfreq + cnt)
- s.silence_a(Left_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 200) + cnt)
- 'MF / Blue Box
- "a": '1
- s.synth("A", Left_Audio_Pin, 700)
- s.synth("B", Right_Audio_Pin, 900)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- "b": '2
- s.synth("A", Left_Audio_Pin, 700)
- s.synth("B", Right_Audio_Pin, 1100)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- "c": '3
- s.synth("A", Left_Audio_Pin, 900)
- s.synth("B", Right_Audio_Pin, 1100)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- "d": '4
- s.synth("A", Left_Audio_Pin, 700)
- s.synth("B", Right_Audio_Pin, 1300)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- "e": '5
- s.synth("A", Left_Audio_Pin, 900)
- s.synth("B", Right_Audio_Pin, 1300)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- "f": '6
- s.synth("A", Left_Audio_Pin, 1100)
- s.synth("B", Right_Audio_Pin, 1300)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- "g": '7
- s.synth("A", Left_Audio_Pin, 700)
- s.synth("B", Right_Audio_Pin, 1500)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- "h": '8
- s.synth("A", Left_Audio_Pin, 900)
- s.synth("B", Right_Audio_Pin, 1500)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- "i": '9
- s.synth("A", Left_Audio_Pin, 1100)
- s.synth("B", Right_Audio_Pin, 1500)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- "j": '0/10
- s.synth("A", Left_Audio_Pin, 1300)
- s.synth("B", Right_Audio_Pin, 1500)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- "k": '11/ST3
- s.synth("A", Left_Audio_Pin, 700)
- s.synth("B", Right_Audio_Pin, 1700)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- "l": '12/ST2
- s.synth("A", Left_Audio_Pin, 900)
- s.synth("B", Right_Audio_Pin, 1700)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- "m": 'KP
- s.synth("A", Left_Audio_Pin, 1100)
- s.synth("B", Right_Audio_Pin, 1700)
- waitcnt(((clkfreq / 1000) * 100) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 100) + cnt)
- "n": 'KP2
- s.synth("A", Left_Audio_Pin, 1300)
- s.synth("B", Right_Audio_Pin, 1700)
- waitcnt(((clkfreq / 1000) * 100) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 100) + cnt)
- "o": 'ST
- s.synth("A", Left_Audio_Pin, 1500)
- s.synth("B", Right_Audio_Pin, 1700)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 60) + cnt)
- 'Automated Coin Toll Service tones / Red Box
- "x": 'Nickel
- s.synth("A", Left_Audio_Pin, 1700)
- s.synth("B", Right_Audio_Pin, 2200)
- waitcnt(((clkfreq / 1000) * 66) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 66) + cnt)
- "y": 'Dime
- repeat Index from 0 to 1
- s.synth("A", Left_Audio_Pin, 1700)
- s.synth("B", Right_Audio_Pin, 2200)
- waitcnt(((clkfreq / 1000) * 66) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 66) + cnt)
- "z": 'Quarter
- repeat Index from 0 to 4
- s.synth("A", Left_Audio_Pin, 1700)
- s.synth("B", Right_Audio_Pin, 2200)
- waitcnt(((clkfreq / 1000) * 33) + cnt)
- s.silence_a(Left_Audio_Pin)
- s.silence_b(Right_Audio_Pin)
- waitcnt(((clkfreq / 1000) * 33) + cnt)
- DAT
- {{
- ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
- │ TERMS OF USE: MIT License │
- ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
- │Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation │
- │files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, │
- │modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software│
- │is furnished to do so, subject to the following conditions: │
- │ │
- │The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.│
- │ │
- │THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE │
- │WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR │
- │COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │
- │ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
- └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement