hello
goto this site
www.thesiliconhorizon.com/store
there is an xbee framework on it..
it has all the source code you need to automatically set the baudrate without a programmer etc...
it is very good firmware.
it is for pic 18 devices with USB however can be ported to others.
Added after 2 minutes:
all xbee's come 9600 by default..
if you dont have a programmer (digi's interface board)
then you have to use the AT command set to enter command mode.
then you can send the following command
ATBD newbaudrate in hex.
so its like this.
***wait 1 second with nothing sent to module***
+++
***wait 1 second with nothing sent to module
<OK received>
ATBD newbaudrate in hex<cr>
ATWR<cr> (write changes)
ATCN (exit command mode)
you didnt say if it was series 2 or 1.
the above is for series 1.
with series 2 it is slightly different commands...
look in the manual for them.
Added after 2 minutes:
if you are using a series 2 module, then you need 2 different firmwares , and thus youll need the DIGI interface board to switch the firmwares....(as zigbbe has coodrinator and other firmware)...
now series 1 , you only have 1 firmware so you dont need the DIGI programmer, just the PIC software to do everything in AT commands...
doing packets on a pic is very time consuming and takes up more space etc..
i suggest doing the AT commands.
Added after 2 minutes:
oh and dont use the pic 18 library USART send and receive string commands...
that sends a null also!!
if you get the framework above, it has working functions in it.