Shop OBEX P1 Docs P2 Docs Learn Events
Setup for Stamp being an RS232 DTE — Parallax Forums

Setup for Stamp being an RS232 DTE

LewMLewM Posts: 4
edited 2007-04-03 03:43 in BASIC Stamp
I am attempting to use MultiTech CDMA wireless modem as a time base. It works as hoped when connected to a PC - I can read current local time with an AT command. I changed the default baudrate of the modem to 2400, 8, none, and 1.
I have not been able to get it to communicate with a BS2p40. I am using a MAX232A for the RX and TX lines. DTR is held high (5v), RTS is asserted thru the MAX232. I have tried setting the stamp at both inverted and true. The docs on the modem states that it uses the RTS and CTS lines for flow control.
Is there a standard configuration for 5 wire DTE side of serial communication with the stamp? Thanks in advance.

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-04-01 21:52
    You're using a MAX232, so you're not trying to use the 9-pin connector on a BoE/HWB.· I think you should assert the RTS (on one pin) and then SEROUT your AT/data (on another pin) and then take the RTS pin Low once the AT/data has been transmitted.
    Maybe you could attach your program (and diagram/s, if available)·that isn't working so we might critique it?
  • LewMLewM Posts: 4
    edited 2007-04-02 03:54
    At present I am breadboarding on a PDB. The pins in use on the MAX232 are: Stamp side - 9-8,10-7, for RX and TX; 11-14, for RTS. I assume as I am using the MAX232 I would use inverted polarity. So, with the BS2p40 - 2400, 8, none, and inverted the baudrate would be 16780. I lifted the following from Wikipedia: (maybe not the best source)


    "The official RS-232 use of the RTS and CTS lines is asymmetrical. The DTE asserts RTS to indicate a desire to transmit and the DCE asserts CTS in response to grant permission. This allows for half-duplex modems that disable their transmitters when not required, and must transmit a synchronization preamble to the receiver when they are re-enabled. There is no way for the DTE to indicate that it is unable to accept data from the DCE.

    A non-standard symmetrical alternative is far more widely used: CTS indicates permission from the DCE for the DTE to transmit, and RTS indicates permission from the DTE for the DCE to transmit. The "request to transmit" is implicit and continuous.

    3-wire and 5-wire RS-232

    A minimal "3-wire" RS-232 port consisting only of transmit data, receive data, and ground, is commonly used when the full facilities of RS-232 are not required. When only flow control is required, the RTS and CTS lines are added in a 5-wire version."

    This would lead me to believe that in most cases the RTS is always asserted. The code is really basic:
    SEROUT tx, baud, [noparse][[/noparse]"AT+CCLK?"]
    SERIN rx, baud,4500,timed, [noparse][[/noparse]string(5)]

    It times out every time. The status light on the modem indicate the same state as when hooked to the PC with HyperTerm, but the transmit and receive lights never do anything when attached to the stamp. I may wire up a breakout box and see what is happening. Let me know if you think of anything - Thanks!
  • LewMLewM Posts: 4
    edited 2007-04-02 04:04
    I gave the wrong baudrate in the last post. I was looking at the wrong table (should have looked at the code). It should be 17405 for inverted and 1021 for true with the BS2p40. I looked at another project I did a few years ago and there using a MAX232 also I was using 9600, 8, none and true with a 240 (BS2p).
  • stamptrolstamptrol Posts: 1,731
    edited 2007-04-02 16:18
    Its quite likely the modem will be happy if you jumper its RTS and CTS together at the modem end of the cable. I think that's what they're trying to say when they describe "A minimal 3-wire RS-232 port.."

    The usual data transfers from a Stamp won't flood the buffers on the modem.

    The other thing to try if all else fails is to interchange pins 2, 3.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • LewMLewM Posts: 4
    edited 2007-04-03 03:43
    Well, I did away with the handshaking altogether, but still nothing. I did try a BS2, but no luck there either. I have had some communication with the modem maker, but so far other than turning off the flow control they haven't been able to give me anything.
    Can someone confirm exactly what I should be using for the Baudmode with the BS2p and a MAX232? Thanks.
Sign In or Register to comment.