How to get xbees to recieve and transmit at the same time

Ok, since you are using a PIC (I used the 16F873 on my Bot) read and study the Microchip App Note AN774. This has the Interrupt driven, ring buffer UART code I used (also download the example code). It is in assembler but it is not hard to understand and port to C.

Which C compiler are you using? CCS or MikroC?

I do not use those, I use an older HiTech C for 16F and 18F PICs.

But looking through your code I do not see any UART initialization so I don’t see how the UART could be working.

For help with the code check into a forum for the compiler you are using (or maybe someone here know this compiler).

And Again… Get the PIC’s serial (UART) connected to your PC before even thinking about connecting the XBees. You really want and to the issues with the PIC code worked out bee having to deal with any XBee setup and issues.

Since you have the Sparkfun USB dongle the PIC’s UART pins can directly connect to get the serial between the PIC and PC working.