
Analog and digital I/O lines
PWM1
XBee/XBee-PRO® S2C ZigBee® RF Module
149
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 D1 command with a parameter of 3 (“ATD13”). To enable
pull-up resistors on the same pin, issues the
PR
command with bit 3 set (for example, PR8, PR1FFF,
and so on).
Issue the
D2
command with a parameter of 2 to enable the analog input (“D22”). Finally, set DIO4 as
an output, driving high by issuing the
D4
command with a parameter value of 5 (“D45”).
After issuing these commands, apply the changes before the module I/O pins update to the new
states. Issue the
AC
or
CN
commands to apply changes (for example, AC).
Example 2: Calculate the PWM counts for a packet received with an RSSI of -84
dBm
n
RSSI = -84 = 0xAC = 172 decimal (unsigned)
n
PWM counts = (41 * 172) - 5928
n
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, make sure 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 using the
AC
command.
After applying changes, all received RF data packets set the RSSI timer for 2 seconds.
PWM1
When you configure
P1
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 PWM output provides a clock for
the PLUS processor, although it may also be used for other purposes.
When you enable this feature, the RSSI PWM output is automatically disabled, even if it is configured.
Содержание XBee
Страница 1: ...XBee XBee PRO S2C ZigBee RF Module User Guide ...
Страница 259: ...AT commands Execution commands XBee XBee PRO S2C ZigBee RF Module 259 Parameter range N A Default N A ...
Страница 289: ...Regulatory information ANATEL Brazil XBee XBee PRO S2C ZigBee RF Module 289 ...
Страница 290: ...Regulatory information ANATEL Brazil XBee XBee PRO S2C ZigBee RF Module 290 ...
Страница 303: ...Load ZigBee firmware on 802 15 4 devices Background 304 Load ZB firmware 305 XBee XBee PRO S2C ZigBee RF Module 303 ...