Change Detection Sampling; Rssi Pwm; I/O Examples - Digi XBee ZigBee S2D User Manual

Table of Contents

Advertisement

RSSI PWM

A sleeping end device will transmit periodic IO samples at the IR rate until the ST timer expires and the device can
resume sleeping.

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 64-bit address specified by
DH and DL.
RSSI PWM
The XBee module features an RSSI/PWM pin (pin 7/SMT, pin 6/TH) that, if enabled, will adjust the PWM output to
indicate the signal strength of the last received packet. The P0 (P-zero) command is used to enable the RSSI pulse
width modulation (PWM) output on the pin. If P0 is set to 1 (and P1 is not set to 1), the RSSI/PWM pin will output a
pulse width modulated signal where the frequency is adjusted based on the received signal strength of the last
packet. Otherwise, for all other P0 settings, the pin can be used for general purpose IO.
When a data packet is received, if P0 is set to enable the RSSI/PWM feature, the RSSI PWM output is adjusted
based on the RSSI of the last packet. The RSSI/PWM output will be enabled for a time based on the RP command.
Each time an RF packet is received, the RSSI/PWM output is adjusted based on the RSSI of the new packet, and
the RSSI timer is reset. If the RSSI timer expires, the RSSI/PWM pin is driven low. RP is measured in 100ms units
and defaults to a value of 40 (4 seconds).
The RSSI PWM runs at 12MHz and has 2400 total counts (200us period).
RSSI (in dBm) is converted to PWM counts using the following equation:
PWM counts = (41 * RSSI_Unsigned) - 5928

I/O examples

Example 1: configure the following I/O settings on the XBee
Configure AD1/DIO1 as a digital input with pullup resistor enabled
Configure AD2/DIO2 as an analog input
Configure DIO4 as a digital output, driving high.
To configure AD1/DIO1 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 IO pins will be updated to the new
states. The AC or CN commands can be issued to apply changes (e.g. ATAC).
Example 2: calculate the PWM counts for a packet received with an RSSI of -84dBm
RSSI = -84 = 0xAC = 172 decimal (unsigned)
PWM counts = (41 * 172) - 5928
PWM counts = 1124
XBee/XBee-PRO ZigBee RF Modules User Guide
128

Advertisement

Table of Contents
loading

This manual is also suitable for:

Xbee-pro zigbee s2cXbee zigbee s2cXbee s2d smtXbee-pro s2c smt

Table of Contents