pic18F252 & XBEE

Hi, i trie to configure the xbee, but i can’t receive the code confirmation “ok” :

here’s the code :

void sendcmd(){

char plus = ‘+’;

DelayMs(240);

putcUSART(plus);

DelayMs(200);

putcUSART(plus);

DelayMs(200);

putcUSART(plus);

DelayMs(940);

}

and after that :

while ( !DataRdyUSART() );

but i get nothing …

help plz !

You need to wait 1 second, then send 3 pluses with no delay between them. You don’t need to wait after last plus, you may start polling for incoming character immediately. During this 1 second guard time Xbee has to be idle, i.e., not having data transfer in either direction on USART or RF.

hi, thanks, now i can receive the Ok after the +++ .

but i don’t know why i can’t receive OK after an atch D by example :cry:

not every command gives OK response. If it returns a value, you will see only this value, no OK at the end.