XBEE GPIO Network Configuration Help!

I am using Series 1 XBees, modem type XB24, function set: XBEE 802.15.4 and version 10EC. At the moment, the coordinator is receiving API packets every 20ms, however, no matter how I press the buttons connected to End Device 1, the incoming API packets stay the same. So I am not sure where the problem is. Are my configuration settings off? Did I miss something? Did I miss connect the button?

Please advise. Any help is much appreciated!

http://4.bp.blogspot.com/-FEekTaYDyCI/U … twork2.png

The button connection looks good. You can verify by measuring the AD0 pin with a Voltmeter, should be 3.3V when button not pushed & 0V when button pushed.

Is the correct End Device address in the received API packets?

Is the correct address of the coordinator set in the End Devices? ATDH should be 32 bits.

Is the IOC enabled in the End Devices (ATIC)? This sends the input pin data when it changes.

Are the Pins that the button connected to set as Inputs? Yes it is (ATD0 = 3)

You could try a slower ‘sample rate’ (ATIR) so not to ‘flood’ the coordinator. In fact, with IOC enabled there doesn’t need to be any sampling since the data will be sent on detection of a button press/release.

Baud rate is 115k but seems you are not having issues as other have had.

the setup of the XBee S1 for virtual wire is a bit complicated if you’ve not done it previously.

If all you have is a push button, you could config it to use a digital I/O pin rather than an A/D. Simpler.

I’d suggest, at first, not using 115200 baud because the S1’s don’t match 115200 to better than 1.5%. It’s because the 8MHz crystal in the XBee isn’t a multiple of that baud rate and there’s no fractional divider.

Thank you so much guys for taking the time to look at my issue.

stevech:
you could config it to use a digital I/O pin rather than an A/D. Simpler.

I thought ATD03 will set D0 as Input, does that satisfy?

waltr:
Is the correct address of the coordinator set in the End Devices? ATDH should be 32 bits.

I thought it must be 64 bit? I previously had ATDH 13A200 and now I have ATDH0013A200. Not sure what the 32 bit address would be.

waltr:
Is the IOC enabled in the End Devices (ATIC)?

Per your suggestion, instead of ATIR14, I will use ATIC1, which should watch changes in pins D0-D1 correct?

I am now using baud rate 9600 per both of your suggestions. The following is the code I am using for the coordinator which is connected to an arduino:

#include <XBee.h>

XBee xbee = XBee();

void setup() 
{
  Serial.begin(9600);
  xbee.setSerial(Serial);
}

void loop() 
{
  xbee.readPacket();
  if (xbee.getResponse().isAvailable()) 
  {
    if (xbee.getResponse().getApiId() == RX_16_RESPONSE || xbee.getResponse().getApiId() == RX_64_RESPONSE) 
    {
      if (xbee.getResponse().getApiId() == RX_16_RESPONSE)
      { 
        Serial.println("Got 16bit packet!"); 
      } 
      else 
      { 
        Serial.println("Got 64bit packet!");
      }
    } 
    else 
    {
      Serial.println("Not expecting this packet.");   
    }
  } 
  else if (xbee.getResponse().isError()) 
  {
    Serial.print("Error reading packet.  Error code: ");  
    Serial.println(xbee.getResponse().getErrorCode());
  } 
}

The above code keeps returning “Not expecting this packet.”

What do you guys suggest?

The 64 bit Address is on the tag that is on the XBee module. This is split into two 32 bit values as SH and SL, the high and low orders. This should be matched by a remote XBee in its DH and DL registers.

Good on the 9600Baud just to ensure no problems.

I would have the Coordinator connected to a Com port on your PC. Then use X-CTU or a Python program to receive and view data packets. API packets can be a little tricky to understand at first. But by studing the packet contents and comparing to the XBeee Document they can be decoded and understood.