User Manual

Table Of Contents
XBee®/XBeePRO®ZBRFModules
©2011DigiInternational,Inc. 97
RSSI (in dBm) is converted to PWM counts using the following equation:
PWM counts = (41 * RSSI_Unsigned) - 5928
IO Examples
Example 1: Configure the following IO 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.