Trouble "catching" inbound XBee data with RX in a loop
Falcon
Posts: 191
Hello all,
Working on my project in small steps, I have one XBee sending a byte of DS1307 temperature data to another successfully.
I'm now trying to insert that receiver code into the main project which is a 7-Slot (BS2Px) loop that includes the following steps:
receives13 inbound bytes
processes those bytes into SPRAM
sends all data to an LCD
and, depending on which bytes have changed,
sends updates to a PINK
sends commands to a V-Stamp voice module
I'm unable to receive the temperature data when all Slots are included in the loop.
I do successfully receive the temperature data if I execute the initialization and then go into a loop of just the Slot with the XBee receive code.
I'm sure I'm missing the inbound data from the XBee trabsmitter while the rest of the main unit loop is executing..
Questions: How can I better receive that inbound XBee data?
Should I increase the length of the time-out in the SERIN command?
Is it possible to have the receiver ackknowledge the inbound data before the loop continues to execute?
All suggestions are welcomed.
falcon
Working on my project in small steps, I have one XBee sending a byte of DS1307 temperature data to another successfully.
I'm now trying to insert that receiver code into the main project which is a 7-Slot (BS2Px) loop that includes the following steps:
receives13 inbound bytes
processes those bytes into SPRAM
sends all data to an LCD
and, depending on which bytes have changed,
sends updates to a PINK
sends commands to a V-Stamp voice module
I'm unable to receive the temperature data when all Slots are included in the loop.
I do successfully receive the temperature data if I execute the initialization and then go into a loop of just the Slot with the XBee receive code.
I'm sure I'm missing the inbound data from the XBee trabsmitter while the rest of the main unit loop is executing..
Questions: How can I better receive that inbound XBee data?
Should I increase the length of the time-out in the SERIN command?
Is it possible to have the receiver ackknowledge the inbound data before the loop continues to execute?
All suggestions are welcomed.
falcon
Comments
I may have CTS backwards in that it may be HIGH to stop sending and LOW to allow sending from the xBee. You'll have to check the Stamp and xBee documentation.
I appreciate your response.
Page 11 of the Getting Started with XBee Modules mentions CTS but, if I understand, it applies to the transmitting end.
I have RTS implemented in my code as follows.
Im using the following initialization code which includes the ATD6 1 statement to activate RTS:
The following shows the pin assignments for the XBee :
And this code is in the main loop:
Do you see any glaring mistakes in how this is written?
falcon
Yes.
If I run the initialization code, then create a loop that only contains the XBee receive code, I do receive the temperature data. So I know the actual Receive code works.
When I start including parts of the other 7 Slots, I no longer receive the data. I do have a number of GET and PUT statements . Do they slow down the execution enough to cause a problem?
What is the logic used to determine Timeout, and WAIT modifier time periods?
In the following XBee receiver code, what length of Timeout period should I use for the main SERIN statement, and what length of Timeout period should I use for the SERIN statements within the SELECT-CASE?
Within the 8-Slot main loop I have a hard-wired SERIN from a remote BS2P40 using RTS and the WAIT modifier. How should I set determine the proper length for the Timeout for that SERIN? Could the WAIT modifier here be holding things up too long?
falcon