SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By vijay.amrutkar
#169877
Hello All,

I started to work on lpc2148 with xbee series 2.
On the transmitting side i am using lpc2148 with xbee coordinator in API mode,
and Rx side i am using xbee on Shield in router AT mode.
I want XBee to activate a D3 pin, which could be used to turn on relay on Rx side

API frame format as below code using c program .

#define Delimeter 0x7E

oid Init_UART1(void) //This function setups UART1
{
unsigned int Baud16;
U1LCR = 0x83; // DLAB = 1
Baud16 = (Fpclk / 16) / UART_BPS;
U1DLM = Baud16 / 256;
U1DLL = Baud16 % 256;
U1LCR = 0x03;
}

void main() {

Init_UART1();
LED1_ON();
setRemoteState(0x5);//AD3 config DOUT HIGH
Delay(25);
LED1_OFF();
setRemoteState(0x4);//AD3 config DOUT LOW
Delay(25);

void setRemoteState (char value) {

UART1_Write(Delimeter);//start byte
UART1_Write(0);//high part of length
UART1_Write(0X10);//low part of length
UART1_Write(0X17);//remote AT command
UART1_Write(0X0);//frame id 0 for no reply
UART1_Write(0X0);
UART1_Write(0X0);
UART1_Write(0X0);
UART1_Write(0X0);
UART1_Write(0X0);
UART1_Write(0X0);
UART1_Write(0XFF);// broadcast
UART1_Write(0XFF);// broadcast
UART1_Write(0XFF);
UART1_Write(0XFE);
UART1_Write(0X02);//apply changes immediately on remote
UART1_Write('D');//writing on AD3 pin
UART1_Write('3');
UART1_Write(value);
sum = 0x17 + 0xFF + 0xFF + 0xFF + 0xFE + 0x02 + 'D' + '3' + value;
UART1_Write(0xFF - (0xFF & sum));//checksum

Delay(25);
}
}
i am not able to get any communication or data on my Rx side. D3 pinout volage is still low.
Please guide on this point...

This program is working fine with arduino using Serial.write Function.


Regards,
Vijay
By stevech
#170050
Series 2 XBee's are ZIgbee-only (unlike Series 1).

I suggest you use as an example the Arduino library which supports both Series 1 and 2.
It's much simpler with Series 1.

As a first step, have you connected the microprocessor's UART TX, RX together and proved you can do loop-back?