xbee programming with pic16?

Hi Everyone,

I have configured two xbee’s in API mode. It is fine when i connected to usb. But when i connected one xbee with USB. and another one is connected with PIC16F18345 on PCB(UART).

In transparent both are working fine. Communication is also fine.

But when i am using API mode it is not working. Xbee is not responding.

Main code:

unsigned char Hexa[22] = {0x7E, 0x00, 0x11, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x68, 0x68 ,0x68 ,0xBB};

printf("reset
");
wakeup_xbee();
while(true)
{
__delay_ms(1000);
send_data(0 , Hexa);
}

In Send data:

nsigned int n=0;
str[21] = ‘\0’;
if(!count)
{
EUSART_Write_string(str);
}

while(count–)
{
//printf(“%x”,xch);
sprintf(arr , "
x=%.2f y=%.2f z=%.2f
" ,angle_x , angle_y, angle_z);
EUSART_Write_string(arr);

}

It is printing only 7E continuously. Do you have any idea what could be the reason.

Thanks in advance.

Regards,

Ram.