Greetings!
I'm working on a personal project that involves interfacing a PIC micro to the telephone and dialing out a specific phone number using DTMF tones generated by the PIC. I am using a 16F876A and am following a schematic I found in the old Basic Stamp Nuts & Volts articles (NV 19 Fig 19-1, see attachment). I have recreated the circuit verbatim with the following exception:
-I am using .1uF capacitors and 100 ohm resistors on the tip and ring lines in place of relays/switches
I have constructed the circuit and written a really simple PBP program just to see if I can connect, shown below.
Given all of this, the circuit doesn't work. The code sends the tones to the speaker and to the LCD, so I know that's working, so it's something in the circuit. I have read on this forum that for phone circuits the oscillator should be 20 MHz, but I will admit I haven't tried that yet. I'll do that later today/tomorrow. Just wanted to get this out there in case anyone saw something glaringly wrong with the circuit.
I'd appreciate any advice anyone can provide, troubleshooting the circuit, etc.
Code:
' PIC16F876 to predefined connections:
'
' PIC LCD Other Connections
' ------ ------- -----------------------------
' OSC1 Resonator - 4 mhz
' OSC2 Resonator - 4 Mhz
' MCLR Vdd via 1k resistor
' Vdd 5v
' Vss Gnd
' RB2 Output to serial LCD
' RB4 Output to speaker
' RB5 Output to phone line
' -----[ Revision History ]------------------------------------------------
'
' ----[ Includes / Defines ]-------------------------------------------
'
INCLUDE "MODEDEFS.BAS" 'This statement is needed for serout defines.
Define LOADER_USED 1 'Only required if bootloader used to program PIC
'define osc 20 'Oscillator speed is 20 MHz
' -----[ Constants ]-------------------------------------------------------
' -----[ Variables ]-------------------------------------------------------
'
' -----[ Initialization ]--------------------------------------------------
'
' -----[ Main Code ]-------------------------------------------------------
'
Start:
serout 2,N2400,[254,1]
serout 2,N2400,["DIALING...",254,192]
pause 1000
DTMFout 4,[1,8,1,8]
DTMFout 5,[1,8,1,8]
serout 2,N2400,[#1,32,#8,32,#1,32,#8]
pause 1000
Goto Start ' Loop back and do it all again
Bookmarks