PDA

View Full Version : Need help with 2 Basic Stamps Handshaking with Transceivers



ceasar
04-10-2007, 09:08 PM
I’m able to send transmission in one direction using the following code:
·
FOR RX:
·
baud CON 16572·

mainloop:
SERIN· Rx,baud,[ 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,["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.·· http://forums.parallax.com/images/smilies/confused.gif

Mike Green
04-10-2007, 09:19 PM
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.

ceasar
04-10-2007, 09:31 PM
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 Green
04-10-2007, 10:12 PM
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 Hill
04-10-2007, 10:42 PM
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

ceasar
04-10-2007, 11:44 PM
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 Green
04-10-2007, 11:52 PM
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 Hill
04-11-2007, 01:42 AM
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