I/O Examples; General Purpose Flash Memory; Accessing General Purpose Flash Memory - Digi XBee Manual

Wi-fi rf module
Hide thumbs Also See for XBee:
Table of Contents

Advertisement

XBee® Wi-Fi RF Modules

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

General Purpose Flash Memory

(e.g. ATAC).
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.

Accessing General Purpose Flash Memory

The GPM of a target node can be accessed from the XBee serial port or from a non-XBee
network client.
Serial port access is done by sending explicit API frames to the MEMORY_ACCESS cluster
ID (0x23) on the DIGI_DEVICE endpoint (0xE6) of the target node. (Explicit API frames
have frame identifier 0x11 and are described in the API Operation section.)
Access from a non-XBee network client is done by sending UDP frames to the target
node on port 0x0BEE. The payload begins with an application header followed by the
GPM header described below. (Refer to the Network Client section of the XBee
Application Service section to learn how to format the application header.)
The following header is used to generate a GPM command. It should be used whether
using serial port access or network client access. For network client access, an
application header needs to precede the GPM header. To keep things simple, this
section is written from the perspective of serial port access, without the application
header. Do not forget to precede each frame with an application header if using a
network client for GPM access.
© 2013 Digi International, Inc.
56

Advertisement

Table of Contents
loading

Table of Contents