Shop OBEX P1 Docs P2 Docs Learn Events
Serial problems with RS-1 — Parallax Forums

Serial problems with RS-1

bobhillierbobhillier Posts: 27
edited 2004-09-13 13:53 in BASIC Stamp
I have a RS-1 wired to my BS2p. I am using the basic serial code example from Nuts'n'Volts #89.·This example has the Stamp connected to the PC. The PC sends a command to the Stamp to receive or transmit some data. Its very simple straight forward·stuff using hardware flow-control.

...except it dosen't work for me.· sad.gif

My stamp·reports receiving the initial code from the PC once in about 20 attempts. Once it receives the basic command it seldom receives any subsequent data. (once in 30 times its does.) ·Its almost like the hardware flow control is not working. I know the basic wiring is correct because sometimes it partially works.

I have an LED wired to the CTS line (as shown in the Nuts'n'Volts #89 article). I can make the LED blink by using the Toggle 500 command in a loop. I receive data using the following command
· SERIN RX\CTS, Baud, 250, Do_Task, [noparse][[/noparse]cmd]
where Baud is 240.

This is supposed to make CTS low for 250 time intervals. A BS2p time interval is .4 milliseconds. This command should wait for 100 milliseconds. I should see the CTS line blink. I do not see the CTS line blink.??? (even if I set the CTS timeout to much larger numbers.)

I've read the Help file. I'm not sure·I undertand the hardware flow control with RS-1. It doesn't seem to be working. This is very frustrating.

Does anyone have insights why the CTS line is not being driven low and why I can only receive one in 20 attempts? Does anyone have·suggestions how I go about to debug this? I'm drawing a blank.

(I wish this was as easy as 1-wire device communication. That was easy to get working.·smile.gif )

Bob



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
······ Bob, Ottawa
W75 54 17·· N45 18 30
·········· G16 #27

Comments

  • AlWilliamsAWCAlWilliamsAWC Posts: 135
    edited 2004-09-13 13:53
    I would try to reduce this to the smallest possible elements.

    1) I'd disconnect the PC and hook the RS-I's TX and RX together and the RTS and CTS together. Then I'd write a little program that set the outputs and looked to see that the inputs changed in sync. If this works, that mostly proves the Stamp I/O pins are OK and the RS-I is OK.

    2) Make sure the cable you are using has all the pins connected.

    3) Same experiment on the PC side. Short the TX and RX and the RTS and CTS. Can you send data to yourself?

    4) On the PC side, are you ignoring DSR? You should be.

    Hope that helps.

    Al Williams
    AWC
    http://www.awce.com
Sign In or Register to comment.