I/O support
Periodic I/O sampling
Digi XBee® 3 802.15.4 RF Module User Guide
99
n
To disable periodic sampling, set
IR
to
0
.
n
For all other
IR
values, the device samples data when
IR
milliseconds elapse and transmits the
sampled data to the destination address.
The
and
commands determine the
destination address of the I/O samples. You must configure at least one pin as a
or
on the sending node to generate sample data.
Destination
If the receiving device is operating in
the
is emitted out of the
serial port. Devices that are in
discard the I/O data samples they receive
unless you enable line passing.
I/O sampling upon wake
By default, a device that is configured for sleep (
SM
>
0
) that has at least one digital I/O or ADC
enabled transmits an I/O sample upon wake regardless of how
IR
is configured. Sampling upon wake
can be disabled by clearing bit 1 of the
SO
. For more information about setting sleep modes, see
.
Multiple samples per packet
specifies how many I/O samples can be transmitted in a single OTA packet. Any
single-byte value (0 - 0xFF) is accepted for input. However, the value is adjusted downward based on
how many I/O samples can fit into a maximum size packet; see
. A query of
IT
after
changes are applied tells how many I/O samples will actually be gathered.
Since
must be
0
or
3
to send I/O samples, the maximum payload in the best of
conditions (short source address, short destination address, and no encryption) is 114 bytes. Seven of
those bytes are used by the command header and the I/O header, leaving 107 bytes for I/O samples.
The minimum I/O sample is 2 bytes. Therefore the maximum possible usable value for
IT
is 53 (or
0x35
).
Only legacy I/O frames allow for gathering multiple samples. If you set
AO
to
0
or
1
, then
IT
is not
applicable and only one sample can be gathered per frame.
Example: Remote AT command in API mode
A device is configured with the following settings:
n
D0
and
D1
are set to ADC (
2
)
n
D3
is configured as a digital input (
3
)
n
AO
is set to
2
, so legacy frames are generated
n
IT
is configured to
3
, so that three samples are gathered per transmission
On the destination node, the following frame is emitted:
7E 00 1A 83 12 34 26 02 03 06 04 00 04 01 28 03 12 00 00 01 58 02 FE 00 04 01 2A 03 A0 94