Home/Support/Support Forum/Timing issues between XBee S2 and Photon

Timing issues between XBee S2 and Photon

0 votes
I'm trying to set up a remote display application.

Communication between two XBee S2's is working fine, transparent mode (AT), when I test PC to PC. However when interfacing with a Photon microcontroller, even at 9600 or 19200 baud, I am losing characters if I send strings vs individual bytes. I tried adding an extra stop bit with ATNB=3, to no avail.

If I send one byte at a time, I get fully reliable transmission. However my application is fairly timing-critical and I need fairly short latency. Any help / pointers is welcome...
asked Mar 14, 2016 in ZNet 2.5 by ezdiver New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
What is your RO command set to? The default is 3 character times of silence on the UART.

If you need very short timings and do not need Mesh, then you may need to look at using the XBee 802.15.4 modules instead. All mesh protocols are by nature slow as there are rout discoveries that need to occur.
answered Mar 14, 2016 by mvut Veteran of the Digi Community (11,302 points)
I've set RO to zero - hoping to send each byte immediately.

My application is to help a car driver park accurately, so a display update rate of a few Hz is enough.

The timing I'm referring to is the time interval between bytes in the serial link between XBee and Photon. Adding a mark parity bit (effectively equivalent to a 2nd stop bit) wasn't enough to have reliable serial transmission. I'd hate to have to program a delay between each transmitted byte.
Sounds like you need to work on your code for sending/reading the serial buffers on your Photon processor. I would suggest using API mode with API frames and hardware flow control.  That should solve the issue of only being able to receive one byte at a time.
Thanks!

I have eventually  achieved reliable communication @ 4800 baud, with mark parity to simulate an extra stop bit, and with improved error handling in the Photon code.
...