I am using 64 XBee modules (XB24-Z7UIT-004) as sensors and I am trying to synchronize all the modules to execute a command all at the same time. What happens is that it takes about 500ms to send the command in unicast, from module 1 to module 64 and they all execute the command the moment they receive it. Is there any way to synchronize all the modules to execute the Command at the same time without the 500ms difference? I cannot send Broadcast messages because it floods and slows my network and it kind of "jams" the incoming commands. I am sending fast unicast messages.

I am using PIC18 to interface the XBee modules in API mode.


  • \$\begingroup\$ Why do broadcast messages slow the network? You should only need to send a single broadcast message? Are you running code on the XBee or just using the API to read pins? \$\endgroup\$ Jun 23, 2015 at 12:31
  • \$\begingroup\$ I use the XBee module in API mode, which means I need to build and transmit the API Frame via UART. By experience, transmitting multiple messages using Broadcast, slows the network and it also causes loose of information. \$\endgroup\$ Jun 23, 2015 at 13:30
  • \$\begingroup\$ Oh so it is the responses to the broadcast message that is flooding the network? \$\endgroup\$ Jun 24, 2015 at 7:10
  • 1
    \$\begingroup\$ Could a simple solution add a timestamp parameter into the command. Then the PIC18 that recieves it can wait sychronise a counter with the timestamp. All PICs would do this then execute the command at a set inteval. \$\endgroup\$ Jun 24, 2015 at 7:12

1 Answer 1


That is the solution, something like timestamp. Since I need to send unicast messages to all the modules and since I know all the MAC addresses in order, from MAC 1 to MAC 64, what I do is add a byte to my message with the delay so the PIC18 can wait until it executes the command. So 1 transmission takes around 10ms, 64 transmissions take 640ms. Knowing this the MAC 1 receives 640ms of delay MAC 32 receives 320ms delay and MAC 64 receives 0ms delay. By doing this I can have a kind synchronization. The only problem are the hops, because if I have many hops the delay wont be 10ms, but that is not a problem to me.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.