full duplex with xbee series1 modules

I have 2 Sparkfun usb explorer modules both with Xbee series1 units on them… They are setup in transparency mode…

Im using 2 C# programs to talk to each other… I can send from one and recieve on the other just fine but when I enable each program to send and recieve I get trashed data… Is there any way for these modules to be able to send and receive at the same time?

The “recieving” part of the programs is done in a thread, when I try to send from another thread, the “receiving” part is getting the trashed data…

At what Baud rate?

RF modules are half duplex on the RF link, only one can transmit at a time. But this is taken care of with the XBee 802.15.4 firmware to allow data to be received and sent from/to the XBee’s UART in full-duplex.

Are you using RTS/CTS Flow control on the XBees? It may be that you are over-running the XBee’s data buffer.

tgreaves:
I have 2 Sparkfun usb explorer modules both with Xbee series1 units on them… They are setup in transparency mode…

Im using 2 C# programs to talk to each other… I can send from one and recieve on the other just fine but when I enable each program to send and recieve I get trashed data… Is there any way for these modules to be able to send and receive at the same time?

The “recieving” part of the programs is done in a thread, when I try to send from another thread, the “receiving” part is getting the trashed data…

to add to the prior post... The RF modems are half duplex. But they will buffer data in each direction and appear to be bi-directional though not true real time full duplex. It's fast half duplex, if you will.

But you must implement some sort of flow control to prevent sending more data to an XBee than the transmission capacity. Flow control has to be done on any communications device because the capacity is limited.

You can implement flow control by

Hardware: wiring up CTS from the XBee properly to the CTS on the PC as RS232 voltages, and enabling hardware flow control on the PC’s serial port. Or the equivalent if the XBee is talking to other than a PC.

Software: Here, YOU implement some sort of protocol such as send then wait for ACK or some such. Or simply send, delay, send and hope.,

Baud rate is 57,600…

As far as I know im not using any flow control at all, should I enable this on the hardware?

Since im using the usb explorer modules, would I enable the flow control using the x-ctu software or on the pc’s serial port configuration?

Also do I need to code for this in my program, meaning do I need to check the pins to make sure its ok to send/receive?

tgreaves:
Also do I need to code for this in my program, meaning do I need to check the pins to make sure its ok to send/receive?

If you use hardware CTS properly, on both ends, then on the PC end your program should get blocked if the transmit buffer fills due to to CTS slowing the transfers. On the from-XBee - the microprocessor or device sending data to the XBee must do the same.

If you aren’t sure about these conditions, then either slow way down to, say, 4800 baud, or implement some sort of messaging in your program on each end of the link. Depends on what’s connected to the XBee.

stevech:
If you use hardware CTS properly, on both ends, then on the PC end your program should get blocked if the transmit buffer fills due to to CTS slowing the transfers. On the from-XBee - the microprocessor or device sending data to the XBee must do the same.

If you aren’t sure about these conditions, then either slow way down to, say, 4800 baud, or implement some sort of messaging in your program on each end of the link. Depends on what’s connected to the XBee.

Well slowing down the data rate is out of the question… I would rather dumb down the programs to just single direction rather than slow the data rate…

Im not sure if the sparkfun usb explorer modules will do what it needs for the xbee modules in regaurds to this, anyone from sparkfun want to comment?

what attaches to the XBee? A microprocessor?

You can implement software flow control if you cannot do hardware flow control with CTS.