Xbee and MSP430 Interface

Hello there,

I am trying to interface Xbee DOUT (AP = 2) with MSP430F2272 RX. I use some of the example code from TI which is to use the USCI_A0_RX interrupt. I have these settings:

WDTCTL = WDTPW + WDTHOLD; // Stop WDT

BCSCTL1 = CALBC1_1MHZ; // Set DCO

DCOCTL = CALDCO_1MHZ;

P3SEL = 0x30; // P3.4,5 = USCI_A0 TXD/RXD

UCA0CTL1 |= UCSSEL_2; // SMCLK

UCA0BR0 = 104; // 1MHz 9600

UCA0BR1 = 0; // 1MHz 9600

UCA0MCTL = UCBRS0; // Modulation UCBRSx = 1

UCA0CTL1 &= ~UCSWRST; // Initialize USCI state machine

IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt

And the ISR is set up as such:

#pragma vector=USCIAB0RX_VECTOR

__interrupt void USCI0RX_ISR(void)

{

apiframe[j++] = UCA0RXBUF;

if ((j == 0 && UCA0RXBUF == 0x7E) || j > 0) {

data[j++] = apiframe[j++];

if (j == 11){

dh = apiframe[j];

}

if (j == 12) {

dl = apiframe[j];

}

if (j > sizeof apiframe - 1) {

j = 0;

}

}

}

The API frame is 14 bytes long (hex): 7E 00 0A 83 00 01 24 00 01 20 00 02 5D D7

However, when I use CCS to debug and view UCA0RXBUF I get nothing remotely close to the API Frame. I am trying to parse the packet and get data dh and dl (some processing and math will be done in a function to output to LCD). In debug dh should be 02 and dl = 5D (byte 11 and 12 of frame).

I also tried doing some simple code to make sure interrupt was firing. The API frame was 7E 00 0A 83 00 01 2F 00 01 00 10 00 10 2B. I had a Endpoint Xbee sample D04 which I set to Digital High and the Coordinator would output the RXed frame onto DOUT which is connected to MSP430 RX. When I use CCS to debug I get apiframe = {00, 00, 36, 00, 00, 36, …}. Whether I have the Coordinator setup to AP = 1 or 2, I get the same which is not right. I also tried polling the register (with the interrupt disables) in the main(), and I get the same for apiframe.

Please your help is truly appreciated. My graduation depends on this :confused: