Shop OBEX P1 Docs P2 Docs Learn Events
RS232 and Transceiver(27988) communication program — Parallax Forums

RS232 and Transceiver(27988) communication program

DiabloDiablo Posts: 11
edited 2005-10-27 22:49 in BASIC Stamp
I have one BS2, two Transceiver(27988) and one man-made RS232 adapter board.· I connect the BS2 to the first transceiver at the·TX side. and the second transceiver connect to RS232 adapter board.·Both at serial mode (+5v).·The·RX side interface program use HyperTerminal, 9600, N, 1, Hardware flow control.··RX·side power·up from a regulated power supply with its·own ground.

At TX side, pin15--->TXD(27988) And pin14<---RXD(27988).··
At RX side, TXD(27988)--->TX(RS232 adapter board) And·RXD(27988)<---(RS232 borad).

I have the following code:

At TX side,

serData·· VAR·· Byte(5)
pin15···· CON·· 15

HIGH 15
SEROUT pin15, 84, 1000, [noparse][[/noparse]"Hello", CR]
SEROUT pin15, 16468, 1000, [noparse][[/noparse]"Num = ", DEC 100]
SEROUT pin15, 84, [noparse][[/noparse]STR serData]
When I run the program,· I don't see any characters or type in characters in the HyperTerminal.· I don't know what is the problem.· Is it the handshaking problem or different protocol?


If I run the following program at TX side:

·serStr· VAR···· Byte(25)······················· ' Make a 25-byte array
·pin14···· CON·· 14

Main:
· serStr(25) = 0··································· ' Put 0 in last byte
· SERIN 14, 16468, [noparse][[/noparse]STR serStr\25]·······' Get 25-byte string
· DEBUG STR serStr······························ ' Display the string
· END

When run this program, I typed something at the HyperTerminal, some strange characters display at the Debug Terminal.

It looks like work at receive side, not work at transmit side.·

I want to know does anyone work on RS232 before and give me some hint.

Thanks

Comments

  • steve_bsteve_b Posts: 1,563
    edited 2005-10-27 02:42
    What's this man-made rs232 adaptor board?
    Are you using something similar to a MAX232 converter chip (converts TTL to rs232 levels)??

    If you are, then you have to be aware of the need to invert logic one one of your stamps.

    I'm not quite understanding your Rx Side. Is there supposed to be a stamp there?
    You sorta show the transceiver (both Tx and Rx) connecting to the rs232 board.....really kinda need to know how this board is wired!

    What's the output of the transceiver? Is it proper rs232 levels? or a TTL level version?
    Lets assume your transceiver outputs a TTL level....well, if your next step is to ingest in to a stamp then you don't need any rs232 converters....so your SERIN command would use the BAUDMODE value for a TRUE 9600 8,N,1 (sorry, I'm on my MAC...no stamp stuff on this).

    Now, if the transceiver was outputting rs232 you can ingest this directly in to the stamp too (if the voltages are more than 5V use a 220ohm resistor in series with your input pin....and if it's TTL or otherwise, you'll have to be sure your BAUDMODE value is for an INVERTED 9600 8,N,1.

    To be honest....it's really hard to help unless you tell us more about your 'rs232 man-made adaptor board'....that's just too generic a term to give you what you need and not for me to type lines and lines of 'IFs' and 'Whats'!! haha

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

    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."
  • DiabloDiablo Posts: 11
    edited 2005-10-27 06:27
    yes, the man-made rs232 adaptor board with MAX232 converter chip. It is hook up with serial cable to the serial port(COM1) of pc.

    The RX side without stamp only the transceiver(27988) and adapter board which is connected to pc serial port.
    Pin 9 of MAX232 connect to TXD of transceiver and Pin 10 of MAX232 connect to RXD of transceiver.
    Pin 7 of MAX232 connect to pin 2 of serial port, pin 8 of MAX232 connect to pin 3 of serial port.

    The output of the RX is RS232 levels.

    I only have one BS2 at TX side. I want to know that can I send message at tx side to rx side only with one BS2. If so how to do that.

    Before I tried to hook up only two RS232 adapter boards with transceivers at both ends(switch mode), I don't have any problem communicate to each other. After connect the BS2 to transceiver at TX, no matter what code I tried I still can't send message to RX.

    I think there is something relate to baud mode setting.
  • steve_bsteve_b Posts: 1,563
    edited 2005-10-27 22:49
    I'm having trouble understanding what you're doing (my own fault....long day at work!).

    What's the signal flow?? BS2 to Max232?? to????
    I'm assuming you're going BS2 to Max232 to Transceiver(TxD) ---<through air>--- Transceiver(RxD) to Max232 to PC serial port??

    You having to enlighten me with your set up....IF you have a circuit drawing, that' would be the best for me (I'm totally in graphical mode right now, I've read your post 10times and am afraid I'm too tired to make sense of it!! haha).

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

    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."
Sign In or Register to comment.