Shop OBEX P1 Docs P2 Docs Learn Events
BS2 connected to US Robotics 5686 E modem problems — Parallax Forums

BS2 connected to US Robotics 5686 E modem problems

WillWhiteWillWhite Posts: 15
edited 2009-03-11 20:46 in BASIC Stamp
Greetings all,

It's been a while since I've been able to mess with my BS2 since it's been working great for 3 years just listening to serial traffic and burping back out the info over the phone.

Well, the time has come to move to the modern age.....We've got caller-id capability in our PBX now and I'd like to reprogram the stamp to collect the caller-id data from a modem.

I'm able to talk to the Stamp from the computer and "pretend" I'm the modem. That's not a problem.

I can talk to the modem from the computer and "pretend" I'm the stamp (sending what I want it to see).

The problem I'm running into is with the stamp talking to the modem. I'm not getting the expected result from my test program. This is the code I'm running:


' {$STAMP BS2}

Modem_Talk:

array     VAR Byte(20)
phrase    VAR  Byte      ' test1
command    VAR  Byte      ' test2
DEBUG "This is a modem test",CR
DEBUG "Setting Pin 0 to Input",CR
INPUT 0
DEBUG "Pin 0 set to Input",CR,CR
DEBUG "Setting Pin 1 to Output",CR
OUTPUT 1
DEBUG "Pin 1 set to Output",CR,CR
DEBUG "Sending AT command to modem",CR
'84 = 9600@8N1
SEROUT 1,84,[noparse][[/noparse]"AT &F E0 Q1 &C1 &D0 #CID=1",CR]'&F=FactoryDefault,E0=CmdEchoOff,Q1=ResultReportOff,&C1=DCDFollowCarrier,&D0=AssumeDTR-On,#CID=1=CallerIDtoSerialPort
DEBUG "Modem initalization sent....."
PAUSE 1000
SEROUT 1,84,[noparse][[/noparse]"AT &K0 H1",CR]       'Test line to take modem off-hook for audio clue that the AT command is accepted
DEBUG "Modem Should be off-hook...."  'Test Debug line, remove with above removed
PAUSE 2000
SEROUT 1,84,[noparse][[/noparse]"ATH0",CR]            'Test line to put modem back on-hook
DEBUG "Modem back on hook....",10,10,CR 'Test line to remove with above
DEBUG "Watiting on Data from Modem"
SERIN 1,84,[noparse][[/noparse]phrase]',[noparse][[/noparse]WAIT("OK")]
DEBUG "got 1",CR                                'grab the first character the modem spits out, should be "D"
'DEBUG "Got OK for Caller ID Command",CR
SERIN 1,84,[noparse][[/noparse]command]
DEBUG "got 2",CR                                'grab the second character the modem spits out, Should be "A"

DEBUG phrase,command         'output the first two characters just to make sure it's working



The modem isn't responding to my initialization command or to the command to go off-hook. Both of these commands work properly when send from the computer to the modem. Additionally, the stamp is able to communicate to the computer without any difficulty (I see the text appear in the terminal program that the stamp sends)....but when I connect the stamp to the modem I don't get anything from the modem (not even a peep from the speaker when I tell it to go off-hook).

So I figure I have a communication problem between the stamp and the modem. I checked the wiring, and even tried "reversing" it. The modem shouldn't need the RTS and CTS commands, but I have a breakout box and I jumpered them together. I also tried hooking 8 and 20 together on the 25-pin to the modem (DCD and DTR) even though I have the modem dip-switches set to always assume DTR. None of that seems to have worked.

Has anyone wired a BS2 to a similar modem? If so, would you be willing to share some code with me and a diagram if you have one? If not, how about some friendly advice from folks who get to work with these suckers more often then once in 3 years....

If I can get this project done, I'll be able to get everytion off the Pro. Dev. Board and soldered into a project box....then I'll be able to play more often!

Thanks in advance!

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-11 20:21
    Hello,

    Are you using a line driver, such as a MAX232 to interface to the modem? If not that is most likely your problem as the modem deals with inverted RS-232 signals while the BASIC Stamp in non-inverted TTL level signals.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • WillWhiteWillWhite Posts: 15
    edited 2009-03-11 20:46
    Chris, you are the man! You're right, when I changed from 84 to 16468 I was able to drive the modem off-hook. I fixed my SERIN commands (pin 1 instead of 0) and I was able to collect information from the modem when the caller-id came through. Tomorrow I'll play with it a bit more so I can decipher the input and feed it to the Quadravox module again, but hopefully this was the biggest hurdle!

    Thanks again! I'll use the same thread if I have more troubles so as not to clutter the forum.
Sign In or Register to comment.