User Manual

XBee® Wi-Fi RF Modules
© 2012 Digi International, Inc. 49
their serial port. Network clients will receive the I/O data packet as described in the
XBee IP Services chapter.
IR can be used with sleep. A module will transmit periodic I/O samples at the IR rate
until the ST timer expires, the SleepRq line is asserted, and the device can resume
sleeping. Even if the IR rate is set longer than the ST defined wake time, at least one I/O
sample will still be sent before the module returns to sleep because it sends one
immediately upon wake up. If it is not desired that a sample is sent every wake cycle,
the IF command can be used to configure how many wake cycles should elapse before
sending I/O samples at the IR rate.
Change Detection Sampling
Modules can be configured to transmit a data sample immediately whenever a
monitored digital I/O pin changes state. The IC command is a bitmask that can be used
to set which digital I/O lines should be monitored for a state change. If one or more bits
in IC is set, an I/O sample will be transmitted as soon as a state change is observed in
one of the monitored digital IO lines. Change detection samples are transmitted to the
IPv4 address specified by DL.
I/O Examples
Example 1: Configure the following I/O settings on the XBee
Configure DIO1/AD1 as a digital input with pull-up resistor enabled
Configure DIO2/AD2 as an analog input
Configure DIO4 as a digital output, driving high.
To configure DIO1/AD1 as an input, issue the ATD1 command with a parameter of 3
("ATD13"). To enable pull-up resistors on the same pin, the PR command should be
issued with bit 3 set (e.g. ATPR8, ATPR1FFF, etc.). The ATD2 command should be issued
with a parameter of 2 to enable the analog input ("ATD22"). Finally, DIO4 can be set as
an output, driving high by issuing the ATD4 command with a parameter value of 5
("ATD45").
After issuing these commands, changes must be applied before the module I/O pins will
be updated to the new states. The AC or CN commands can be issued to apply changes
(e.g. ATAC).
General Purpose Flash Memory
The XBee Wi-Fi RF modules provide 160 4096-byte blocks of flash memory which can be
read and written by the user application. This memory provides a non-volatile data
storage area which can be used for a multitude of purposes. Some common uses of this
data storage include: storing logged sensor data, buffering firmware upgrade data for a
host microcontroller, or storing and retrieving data tables needed for calculations
performed by a host microcontroller. The General Purpose Memory (GPM) is also used
to store a firmware upgrade file for over-the-air firmware upgrades of the XBee module
itself.