Setting IO whit AT command

XBee projects like the adapter, xBee tutorials, tweetawatt/wattcher, etc. from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
geir102
 
Posts: 60
Joined: Sat Mar 29, 2008 3:01 pm

Setting IO whit AT command

Post by geir102 »

Hi!

Is it possible to set the IO line on a remote device. (Like in the relay video.) Using a AT command.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Setting IO whit AT command

Post by adafruit »

probably. the datasheet has all the AT commands...but we find it easier to use X-CTU
http://www.ladyada.net/make/xbee/ref.html

attie
 
Posts: 3
Joined: Mon Nov 02, 2009 6:53 pm

Re: Setting IO whit AT command

Post by attie »

It certainly is possible to set the io pins of a remote device using an AT command.

Unfortunately though your local device needs to be in API mode, and you need to construct a packet in order to do so.

I have a copy of the manual here:
http://attie.co.uk/file/XBee-Manual-Cx.pdf

Page 40 has the D* commands on it. To set the output 0 to high, you send D05 (Dee Zero Five). And to low you send D04.
This will have effect on the local device, so you need to send a Remote AT Request...

Skip to pages 56 (where it details API packets) and 59 where it details the packet structure of a remote AT request.

-----

Alternatively you could use IO passing - so that D0 on the local device acts as an input, and D0 on the remote device mirrors this.

For this you will need to setup the IO settings on both devices. Here I am using 16-bit addressing because It means I can tell you all the settings you will need. I would recommend that once it is working, you change over to 64-bit addressing by settings MY to FFFF on both devices, and changing IA, DH and DL appropriately.
Remote:
MY: 1001
D0: 4 (output, defaulting to low)
IA: 1002 (allow I/O data only from device 1002)

Local:
MY: 1002
D0: 3 (input)
DH: 0
DL: 1001
IR: 64 (1 sample ever 100ms)
IT: 1 (1 sample before transmit)
IC: FF (detect any I/O change)

Now (unless youve changed the config) D0 will float high due to the internal pull-up resistor, and the remote D0 should follow.
If you then tie it to ground, the remote D0 should also follow!

I hope this helps!

FlyingSaucrDude
 
Posts: 10
Joined: Thu Dec 17, 2009 12:00 am

Re: Setting IO whit AT command

Post by FlyingSaucrDude »

Hi Attie,

Have you verified that the configuration you gave works? I tried it out with two of my Xbees, and I couldn't seem to get it to work...

Would it be possible for you to upload the complete config for each Xbee so I can make sure I don't have some other parameter wrong?

Thanks so much!

FlyingSaucrDude
 
Posts: 10
Joined: Thu Dec 17, 2009 12:00 am

Re: Setting IO whit AT command

Post by FlyingSaucrDude »

If anybody ever comes back to this, I answered my own question -- basically my settings in terms of the Xbee addresses (and destination addresses) were all wrong -- so make sure you set those up correctly before you try to do anything! :D

Locked
Please be positive and constructive with your questions and comments.

Return to “XBee products (discontinued)”