Entering XBee command mode with AVR failed

Hi,

I tried to enter the command mode of an XBee Module (firmware XB24-B)

Baudrate 19200, Xtal 10MHz.

I send “+++” via the uart but i don’t get any response.

If I try it with a terminal program it works.

Uart send function:

uint8_t Uart_Putc(uint8_t uSend)
{
 while (!(UCSRA & (1<<UDRE))); 					// warten bis Senden moeglich                   
 
 UDR = uSend;                  					// schreibt das Zeichen x auf die Schnittstelle 
}

the main:

int main (void)
{
	status = 0;
	int Schleife;
	Schleife = 0;
	DDRB = 0xff;
	PORTB = 0xff;
	Uart_Init();

	_delay_ms(1000);	
	while(1)
	{
		if(status!=2)
		{
			PORTB &= (~(1<<PB0));
			strcpy(response,"~ID=00;");
			Uart_Puts("+++");
			_delay_ms(1000);
			Uart_Gets(buffer,20);......

Can you help me?

You’re interfacing with the XBee at 19,200 baud? You did change the interface rate on the XBee, then, right? It defaults to 9600 (BD = 3), and if you’re sending AT commands from the microprocessor at 19,200 you need to change that setting to BD = 4.

i have also changed the settings on the xbee module.

in the attachment i have uploaded the profile from x-ctu.

The +++ must be preceded by a guard time, say, 2 seconds (a config param).

So there may have been garbage on the serial link just prior to the +++.

(assuming that your problem isn’t in the microprocessor or wiring).