PDA

View Full Version : [Question(s)] XBee Packetization timeout



timothyahong
06-13-2011, 09:37 AM
Hello,

I am trying to send a bunch of bytes through the XBee module from a PIC32. The Xbee is connected to the UART1 line and I have an array of characters called "DataPacket" and I am sending them in the following manner:

for(i=0;i<length+4;i++) WriteUART1(DataPacket[i]);

However I am only receiving the first 5 bytes in DataPacket. I initially though it was a timeout problem but I set the packetization timeout to 0xFF and there was no change.

I also tried writing it the format
WriteUART1(DataPacket[0]);
WriteUART1(DataPacket[1]);
WriteUART1(DataPacket[2]);
WriteUART1(DataPacket[3]);
WriteUART1(DataPacket[4]);
WriteUART1(DataPacket[5]);
WriteUART1(DataPacket[6]);
WriteUART1(DataPacket[7]);
WriteUART1(DataPacket[8]);
But that produced the same results.

Any help appreciated.

timothyahong
06-13-2011, 09:45 AM
Solved,
I needed to add a slight pause between each WriteUART1 command. After adding a 1ms pause it seems to work fine.