Interfacing with phone line.
HI,
·I want to make or get made the following project.
·From a PC I want to dial a phone number and from the other side
·I need a device that answer this call and send the data accumulated.
·The remote device will be counting 3 different pulse during the day.
·And at night I want to make the call and get these count.
·I can make the code in the PC and place the call using a modem.
·My·problem is with the remote modem and the microcontroller.
·Can someone help me?
·
·I want to make or get made the following project.
·From a PC I want to dial a phone number and from the other side
·I need a device that answer this call and send the data accumulated.
·The remote device will be counting 3 different pulse during the day.
·And at night I want to make the call and get these count.
·I can make the code in the PC and place the call using a modem.
·My·problem is with the remote modem and the microcontroller.
·Can someone help me?
·

Comments
·This Cermetek is only the modem so I will need
·a microcrotroller to control the modem and supplies the
·Data.
·Do you know a product that has this Cermetek and a microcontroller
·build in a sigle board?
·
Which is "an RS-232 external modem". These have an "auto-answer" mode, which would let the modem pick up the phone, and generate an "off-hook" signal for your 'remote' BS2. The remote BS2 (mounted on an RS-232 BOE) uses that signal then to know that somebody is "calling" it, and begins its part of the data transfer hand-shake.
You can connect "in-bound" RS-232 status signals (like 'Ring' and 'off-hook') to the BS2 by simply using a 22 Kohm resistor in-line to 'clip' the signal to zero to +5 volts. If you then use the programming port as the modem connection, everything coming to it from the Modem will be 'echoed' back to the modem by the BS2 hardware, so your 'local' PC program will need to 'filter' those out. But that keeps the hardware simple.
For a few dollars more, you can buy one of these for your remote BS2: http://www.kronosrobotics.com/xcart/product.php?productid=16167&cat=287&page=2
For $13 or so, this gives you a true RS-232 +- 10 volt to TTL converter, so you could then use ANY of your I/O pins on the BS2 to monitor the Modem signals, recieve data from the modem, and send data back.
Oh, and for testing, where you want to connect your modems back-to-back in the same room, you can use this: http://www.jagshouse.com/modem.html
Post Edited (allanlane5) : 5/20/2008 2:58:45 PM GMT
A Parallax Stamp is more than capable of counting pulses and controlling a Cermetek modem. If the pulses are shorter than maybe 20 milliseconds or occur more often than 50 times a second, you may need a little external logic to make sure you don't miss them, particularly if they can occur at the same time.
· increment a mechanical counter and has long duration.
· The BS2 will get this pulse and increment a var in Memory
· and this var will be send using the modem.
· But I will need 3 port to get this pulse.
··Do you know a board that can hold the BS2 and the Cermetek modem?
Regarding the "Cermetek" -- Parallax USED to make a "Cermetek" based modem App-Mod, which would plug directly into the App-Mod header on the BOE-board -- which I agree made a very nice package.
Parallax doesn't make the Cermetek App-Mod anymore.· I'm not sure Cermetek makes their chip any more -- but interfacing to it was NOT 'trivial', the phone-line interface requires a device registered with the phone company before you plug it in.· "Stand-alone" modems like the one indicated above have done all this work for you, and all you need is an RS-232 port to talk to them (using the Hayes compatible command set).
RS-232 interfacing is very easy, compared to wiring in a board to carry the Cermetek modem chip, IF you can find a Cermetek modem chip.
Then all you'll need will be a BOE with BS2 chip, and some RS-232 cables (null-modem on the BS2 end, since you'll have a Modem device (the BOE) talking to a Modem device (the Modem) ).· And maybe a box to put the BOE in if necessary.· And the wall-wart supply for the BOE.
Post Edited (allanlane5) : 5/20/2008 3:38:16 PM GMT
and there are 3 lines that generate different pulse so the 3 port.
You suggest a standard external modem controlled by the BS2 using RS-232?
Note: Use the TT7-DTMF receiver from Ramsey Electronics http://www.ramseyelectronics.com/cgi-bin/commerce.exe?preadd=action&key=TT7.
·········Leave out·the large IC (SN74154) and.........
········1.·Solder a lead from its pin 19 on·it's pad·to·jumper P3 on the·BS2.
········2. Solder·4 leads from it's pin 23-20 to jumpers P8-P11 on the BS2.
······· 3. Solder J1 to GRD. and TALK on phone com circuit board·below
Modified code·added for this circuit.
' Security_Alarm.bs2 ' {$STAMP BS2} ' {$PBASIC 2.5} ' ___________________________________________ ' | Security Alarm & DTMF Phone Communcation | ' -------------------------------------------- ' | 06/01/2008 © Braun | ' -------------------------------------------- 'Pins TmAdj CON $100 ' X 1.0 (time adjust) Hook CON 0 ' Hook Off/On Talk CON 2 ' DTMF Communication on pin 13 'Varables Switch VAR Nib ' Security switches RingCount VAR Byte ' Ring counter RingPulse VAR Word ' Ring Pulses eeLoc VAR Byte ' EEPROM address of stored number eeByte VAR Byte ' Byte containing two DTMF digits dtDig VAR eeByte.NIB1 ' Digit to dial Table VAR Nib ' Pick a phone # hiLo VAR Bit ' Bit to select upper and lower nib DTMFDV VAR Bit ' DTMF Data Valid HT9170B pin 15 'I/O INPUT 1 'Pin 1 Is Ringer INPUT 4 'BS2 Pin 4 = HT9170B DV Pin 15 INPUT 8 'BS2 Pin 8 = HT9170B D0 Pin 11 INPUT 9 'BS2 Pin 9 = HT9170B D1 Pin 12 INPUT 10 'BS2 Pin 10 = HT9170B D2 Pin 13 INPUT 11 'BS2 Pin 11 = HT9170B D3 Pin 14 INPUT 12 'Pin 12 Alarm Switch INPUT 13 'Pin 13 Alarm Switch INPUT 14 'Pin 14 Alarm Switch INPUT 15 'Pin 15 Alarm Switch 'Data Phone1 DATA $00,$00,$00,$0F ' Phone: 1-000-000-0000 Phone2 DATA $00,$00,$00,$0F ' Phone: 1-000-000-0000 Phone3 DATA $00,$00,$00,$0F ' Phone: 1-000-000-0000 Phone4 DATA $00,$00,$00,$0F ' Phone: 1-000-000-0000 Phone5 DATA $00,$00,$00,$0F ' Phone: 1-000-000-0000 'OUTPUT DTMFcs Main: 'DEBUG CLS, "Main" 'Check for open Switch Inputs (+) = open switch IF (IN12 = 1) THEN Switch = 1: GOSUB MakeCall ' IF (IN13 = 1) THEN Switch = 2: GOSUB MakeCall ' IF (IN14 = 1) THEN Switch = 3: GOSUB MakeCall ' IF (IN15 = 1) THEN Switch = 4: GOSUB MakeCall 'Check Ring Of Incoming Call IF (IN1 = 0) THEN Ringer GOTO Main Ringer: RingPulse = 0 RingCount = 0 Cont: COUNT 1, 4500, RingPulse IF RingPulse > 20 THEN RingCount = RingCount + 1 ' Add to ring count IF RingPulse < 21 THEN RETURN ' Caller Hung Up IF RingCount > 4 THEN PickUpCall ' Get Call GOTO Cont PickUpCall: HIGH Hook ' Off Hook PAUSE 1000 ' Pause 10 sec FREQOUT 2, 200, 2500 ' Sync Tone FREQOUT 2, 500, 3500 ' Sync Tone RingCount = 0 ' MC145436AP programing DO WHILE (RingPulse < 8000) ' Loop until Timeout DTMFDV = IN3 IF (DTMFDV = 0) THEN GOSUB Command ' Valid Chr HT9170B DV Pin 15 RingPulse = RingPulse + 1 ' Inc Timeout 'DEBUG CRSRXY, 1, 2, BIN DTMFDV LOOP LOW Hook ' On Hook GOTO Main MakeCall: HIGH Hook 'Off Hook PAUSE 2000 'pause 10 sec FOR Table = 0 TO 0 ' retrieve address LOOKUP Table, [noparse][[/noparse]Phone1, Phone2, Phone3, Phone4, Phone5], eeLoc Dial_Number: DO READ eeLoc, eeByte ' Retrieve byte from EEPROM eeLoc = eeLoc + 1 ' point to next pair of digits FOR hiLo = 0 TO 1 ' Dial upper and lower digits IF (dtDig = $F) THEN EXIT ' Hex $F is end-of-number flag DTMFOUT Talk, 150 */ TmAdj, 25, [noparse][[/noparse]dtDig] ' dial digit 150 ms on, 25 ms off eeByte = eeByte << 4 ' Shift in next digit NEXT LOOP UNTIL (dtDig = $F) PAUSE 2000 'Beep x times for switch PAUSE 24000 ' Pause 1 min LOW Hook ' On Hook NEXT RETURN Command: RingCount = INC ' Read Key From HT9170B PIN 11,12,13,14 SELECT RingCount CASE 0 FREQOUT 2, 500, 1600 ' KEY D CASE 1 FREQOUT 2, 500, 100 ' KEY 1 CASE 2 FREQOUT 2, 500, 200 ' KEY 2 CASE 3 FREQOUT 2, 500, 300 ' KEY 3 CASE 4 FREQOUT 2, 500, 400 ' KEY 4 CASE 5 FREQOUT 2, 500, 500 ' KEY 5 CASE 6 FREQOUT 2, 500, 600 ' KEY 6 CASE 7 FREQOUT 2, 500, 700 ' KEY 7 CASE 8 FREQOUT 2, 500, 800 ' KEY 8 CASE 9 FREQOUT 2, 500, 900 ' KEY 9 CASE 10 FREQOUT 2, 500, 1000 ' KEY 0 CASE 11 FREQOUT 2, 500, 1100 ' KEY * CASE 12 FREQOUT 2, 500, 1200 ' KEY # CASE 13 FREQOUT 2, 500, 1300 ' KEY A CASE 14 FREQOUT 2, 500, 1400 ' KEY B CASE 15 FREQOUT 2, 500, 1500 ' KEY C ENDSELECT RingPulse = 0 RETURN ENDConect the unused·BS2 Pins P4·- P6 to a·74164·(serial in / paralel out) shift register and you can control up to·8·devices.
Post Edited (CelticLord) : 6/26/2008 5:53:23 AM GMT
2. It does not solve the data transfer problem.
3. I strongly suspect it's not using an approved phone company interface, so there may be legal troubles there.
4. Simply attaching a stand-alone modem to an RS-232 port solves all three problems at the same time, for $70, legally.
1. use a "real" modem on each end to be legally connected to the phone system.
Available for almost nothing at yard sales, office equipment clearance sales, e-bay. Almost any speed capability will work fine with the Stamp.
2. the modem will give easily implemented auto answer for the remote end.
3. the stamp can easily store the data, detect that the modem has gone on-line and then download the data.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·