PDA

View Full Version : Transmit Acknowledgement



Lightfoot
06-04-2010, 05:09 AM
I have a simple program that sends a byte of data from an XBEE transmitter to a receiver. First the PC sends the letter 'A' to a propeller. Once the prop receives an 'A', the transmitter XBEE sends the letter A to the receiver. Once the receiver receives the 'A', a '#' character is sent back to the transmitter. If the transmitter receives the '#' character in 30ms, a P is sent to the PC, standing for pass. If not, an F, is transmitted back.

I am having a problem where the programs sometimes work and sometimes do not. In other words the '#' char does not always make it back to the transmitter. I have a feeling it is a latency issue. I have tried delays is multiple places, but nothing works. What is going on?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

Lightfoot
06-04-2010, 09:04 AM
OK, I seemed to have axed the problem by adding a while loop to wait for the pound sign. If it does not arrive in one second, the receiver assumes it has lost contact with the transmitter. Why does it work with the while loop but not the other way? It must have been receiving the pound sign all along because if it were another character, my transmitter app will just sit there and hang.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔