Rssi Pwm; I/O Examples; Pwm1 - Digi XBEE PRO S2C Manual

Zigbee rf modules
Table of Contents

Advertisement

®
®
XBee
/XBee‐PRO
 ZB RF Modules 

RSSI PWM

The XBee module features an RSSI/PWM pin (pin 7) 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
With a total of 2400 counts, this yields an ON time of (1124 / 2400) = 46.8%
Example 3: Configure the RSSI/PWM pin to operate for 2 seconds after each received RF
packet.
First, ensure the RSSI/PWM functionality is enabled by reading the P0 (P-zero) command. It should be set
to 1 (default).
To configure the duration of the RSSI/PWM output, set the RP command. To achieve a 2 second PWM
output, set RP to 0x14 (20 decimal, or 2 seconds) and apply changes (AC command).
After applying changes, all received RF data packets should set the RSSI timer for 2 seconds.

PWM1

When P1 is configured for peripheral operation by setting the value to 1, it outputs a 50% duty cycle PWM with a
clock rate of 32,787 Hz, which is a period of 30.5 s. The main purpose of the PWM output is to provide a clock for
the PLUS processor, although it may also be used for other purposes.
*When this feature is enabled, the RSSI PWM output is automatically disabled, even if it is configured.
© 2014 Digi International Inc.
     110

Advertisement

Table of Contents
loading

This manual is also suitable for:

Xbee s2cXbee s2cth

Table of Contents