Shop OBEX P1 Docs P2 Docs Learn Events
Help with BS2 modem connection — Parallax Forums

Help with BS2 modem connection

Tommy30Tommy30 Posts: 7
edited 2005-10-27 17:25 in BASIC Stamp
Hi,

I'm new in using the BS2. What I'm trying to do is to connect an old modem to my bs2 interface board and have the modem send out an SMS to a cellphone. I think·I know how to communicate with the modem, but I'm unsure about the connections that I need to make. I'm using an old US robotics modem. So far I did the following:

- connected pin 5(gnd) from the modem's serial cable to vss
- connected pin 3(tx) from the modem's serial cable to pin 8

I tried to·have the modem dial a number by sending the ATD command to the modem something like this:

serout 5,84,[noparse][[/noparse]"ATD12345"]

Obviously, nothing happened.

I'm not at all sure this is the way to go. ANY help would be appreciated.

I'm sorry for my crappy English.·'cause I'm Dutch, it's not my first language.

Thanx in advance.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-26 21:48
    Tommy,

    ·· Nowhere in your connections did you mention connecting anything to P5 on the BASIC Stamp.· Even if you did, the modem will be looking for RS-232 levels, and the TTL levels from the BASIC Stamp will not work.

    As a side-note, you might have better luck connecting the modem to the DB9 on the Dev Board you're using.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Tommy30Tommy30 Posts: 7
    edited 2005-10-26 22:04
    Cris,

    Ofcourse you're right. I made a typo in my post. The code that I actualy used was:

    serout 8,84,[noparse][[/noparse]"ATD12345"], since i connected my tx lead to pin 8. (At least, that's what i intend to do confused.gif·)

    BTW, i'm actualy using an USB board with my BS2, so there is no DB9 connector on my board as far as I can see.

    Beside that, the end result for this project is to use a stand-alone BS2 with some kind of OEM GSM module. (probably·from Siemens)

    Because I don't have that modem yet, I'm just trying it with an old serial modem.

    Is there anyone who can supply me with some documentation about the physical connection's that I should make?

    Thanks!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-26 22:07
    Okay,

    ·· So now I see two possible problems...First you'll be needing a driver, such as a MAX232 for the RS-232 signal levels.· Second, you will need to connect to the modem's RX line to transmit data to it.· I think you're trying to connect TX to TX, when in fact, generally speaking, TX on one device connects to RX on the other device.· Of course, this all depends on you know which pins are really connected where!· :P



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-10-26 22:08
    You're going to need a MAX232 circuit to talk from your BS2 to the modem -- 0 volts to +5 volts TTL is not going to do it. You CAN use a 22 Kohm resistor to a BS2 pin to the RX line from your modem to recieve data from the modem, though.
  • Tommy30Tommy30 Posts: 7
    edited 2005-10-26 22:10
    I'm sorry for not reading your answer carefully.

    I missed the ttl - RS232 part.

    About that: I'm under the impression that there was only a small diffrence in these signals? I mean, RS232 being about 3.2 volts or something and ttl on 5?

    I also tought that this only beeing an issue when using longer cables? The cable I'm using is only 30cm long.

    I'm probably all wrong about this, but please consider that I'm new on all this.

    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-10-26 22:14
    no RS232 is bipolar (positive and negative), while a swing as low as -3V to 3V is possible it more typical to see -12/+12V.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • Tommy30Tommy30 Posts: 7
    edited 2005-10-26 22:22
    OK, I think I get it.. Please correct me if I'm wrong:

    The modem uses a higher voltage than my bs2 is capable of delivering, so I should use some kind of converter (max232) in order to get this to work. When the modem is 'talking' back to me, the voltage is to high for the BS2, so I can use a resistor to correct this.

    Instead of the max232, isn't it possible to use a transistor in combination with an external power supplie in order to·get a higher voltage to the modem?

    Your comments are greatly appreciated. (or however that may be spelledtongue.gif )

    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-26 22:26
    I mentioned the MAX232 earlier...But yes, you could use transistors.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Tommy30Tommy30 Posts: 7
    edited 2005-10-26 22:35
    Cris,

    You are right. As·I mentioned before, I did not completly read your reply before I answered.

    So, if I am going to·use a transistor to 'boost' the current, is that all there is up to it? I mean, is it only a matter of incorrect current or are there other issues that·I need to be aware of? ··I'm thinking of using a pin to open the base of a transistor (by using·a resistor) ·and·connect·the TR's output to the RX pin of the serial cable.

    This is all just for the prototype of my device. In the final version I'm going to follow your advice and·use the max232. I attached a datasheet for such a chip, could you tell me if·this is what you·have in mind?

    Thanks!!!!
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-10-26 22:40
    not exactly, remember the logic 0 is actually a negative voltage, the transitor would have to be biased between the positive and negative voltage and then you run into problems biasing the transistor properly (a bipolar transistor turns on when the base is 0.7 volts above the emitter for an npn, if the base is at -12V the transistor will always be on since the Vbe will be a minimum 12V.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • Tommy30Tommy30 Posts: 7
    edited 2005-10-26 22:49
    Paul,

    That's kind of hard to understand for me. I think I get it, but I'm not sure.

    I should probably use the max232 then. The one from the attachment any good?

    Bummer for me that I have to wait for 5 days before I can get this chip...

    Are there any scheme's (?) / documentation·available for connecting this chip to my BS2?

    Thanks again.
  • steve_bsteve_b Posts: 1,563
    edited 2005-10-27 02:48
    Some things are capable of reading TTL level rs232 streams.....not always....but sometimes.

    Someone once explained the thresholds to me...but my take was that a logic 0 (typically +12Volts in rs232) can still be read in 0 to 5v levels by the +5 as it's enough over the threshold to trigger.
    The logic 1 (typically -12Volts in rs232) is still read too as it's under the threshold....

    I've found some things can still work....something to try first anyhow.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Tommy30Tommy30 Posts: 7
    edited 2005-10-27 16:16
    Hey everybody!

    Today I received the max232 I ordered. Much to my suprise btw, normaly this takes over 5 days.

    Anybody out there who has a diagram on connecting all this technology?

    Thanks a lot for all the reactions!



    Greetings,



    Tom.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-10-27 17:25
    This will get you started http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv89.pdf

    And if you want to learn more about transistors you can start here http://hyperphysics.phy-astr.gsu.edu/hbase/solids/trans.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
Sign In or Register to comment.