Shop OBEX P1 Docs P2 Docs Learn Events
Need help with 2 Basic Stamps Handshaking with Transceivers — Parallax Forums

Need help with 2 Basic Stamps Handshaking with Transceivers

ceasarceasar Posts: 9
edited 2007-04-10 18:42 in BASIC Stamp
I’m able to send transmission in one direction using the following code:
·
FOR RX:
·
baud CON 16572·

mainloop:
SERIN· Rx,baud,[noparse][[/noparse] zoom]
DEBUG CR,DEC zoom
IF (zoom = 119) THEN
GOSUB buzz
ENDIF
GOTO mainloop
·
buzz:
HIGH 1
PAUSE 600
LOW 1
RETURN

·
Code TX:
again:
SEROUT Tx,baud,[noparse][[/noparse]"w"]·· ' "w"=119GOTO again
·
The problem is I can t send an acknowledgement back. I think its my code. The Transceiver has an RTS pin which is an input to the transceiver. It is a logic 0 when host is ready to send/receive data. Also it has a CTS pin which is a output and is a logic 0 when its clear to send.
Does anybody have any ideas on how to accomplish this? This is for my senior project and I only have two weeks left. Please help.·· confused.gif

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-10 14:19
    What have you tried so far? If you haven't tried anything else yet, what is your plan so far? It's not our place to do your project for you, but we can help clear up misunderstandings and misconceptions and make suggestions.
  • ceasarceasar Posts: 9
    edited 2007-04-10 14:31
    I have tried using these CTS and RTS pins. I think the problem is synchronizing the modules as to when to receive and when to transmit. Attached is my code I think this will better explain my problem
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-10 15:12
    1) You have some problems with the use of GOSUB/RETURN vs GOTO. The send routine is ok, but you do a GOSUB to receive, then usually don't do a RETURN, but use GOTO to go back to the main loop. This doesn't work the way you think. A GOSUB normally should always have a RETURN and a subroutine should not exit with a GOTO. It's better in your short program to not use a GOTO, but just put the receive routine where it's needed. This won't account for your problem though.

    2) I'm not clear about the actual use of RTS and CTS for your transceivers. What kind are they? Usually RTS is a signal from the controller that the controller wants to transmit and, when not transmitting, the unit is always receiving. CTS is a signal from the transceiver that it's ok to transmit. That's not how you're using them. You seem to be using RTS as a "turn on the transceiver" signal.
  • Ray HillRay Hill Posts: 10
    edited 2007-04-10 15:42
    Ceasar,

    Could you post a simple schematic that shows how you have your controllers connected? Which pin to which pin, and any components you might be using, like resitors, etc.

    Ray
  • ceasarceasar Posts: 9
    edited 2007-04-10 16:44
    Mike
    ·
    I think you’re correct. The RTS is an input to the transceiver. Take low when host is ready to send or receive data from the module. Logic 0 is request to send. Also CTS is an output from the transceiver. Logic 0 is clear to send, taken high when the module is busy. So I might be using them wrong. Are there any recommendations on how I could change my code?
    ·
    Ceasar

    Ray

    I attached one of the modules



    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-10 16:52
    I'm afraid I don't have any way to use the file you attached. Try printing to a PDF file and attach that.

    RTS is not normally used to signal "transceiver turn on". It is used to "turn transmitter on". Without more information on your transceiver, I don't have any particular suggestions.

    If RTS is used to turn on the transmitter, it has to be false (logic 1) to receive. There's probably another signal from the transceiver used to indicate that valid received data is present (carrier detect). Ideally, you should look for that before doing the SERIN.
  • Ray HillRay Hill Posts: 10
    edited 2007-04-10 18:42
    Ceaser,

    I was willing to download Proteus Lite so i could view your file, but proteus seems to have some website problems with download. So, I can't see your file either.

    Also the interconnectivity will be important to see.

    Ray
Sign In or Register to comment.