Digi International Inc XBEEPRO2 Manuel D’Utilisation

Page de 155
XBee®/XBee‐PRO® ZB RF Modules 
© 2011 Digi International, Inc.
     97
The reading in the sample frame represents voltage inputs of 1143.75 and 342.1875mV for AD0 and AD1 
respectively.
Queried Sampling
The IS command can be sent to a device locally, or to a remote device using the API remote command frame 
(see chapter 8 for details). When the IS command is sent, the receiving device samples all enabled digital IO 
and analog input channels and returns an IO sample. If IS is sent locally, the IO sample is sent out the UART. If 
the IS command was received as a remote command, the IO sample is sent over-the-air to the device that sent 
the IS command.
If the IS command is issued in AT firmware, the module returns a carriage return-delimited list containing the 
above-listed fields. The API firmware returns an AT command response packet with the IO data included in the 
command data portion of the response frame.
The following table shows an example of the fields in an IS response.
Periodic IO Sampling
Periodic sampling allows an XBee/XBee-PRO module to take an IO sample and transmit it to a remote device at 
a periodic rate. The periodic sample rate is set by the IR command. If IR is set to 0, periodic sampling is 
disabled. For all other values of IR, data will be sampled after IR milliseconds have elapsed and transmitted to a 
remote device. The DH and DL commands determine the destination address of the IO samples. DH and DL can 
be set to 0 to transmit to the coordinator, or to the 64-bit address of the remote device (SH and SL). Only 
devices running API firmware can send IO data samples out their UART. Devices running AT firmware will 
discard received IO data samples.
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 IO pin changes 
state. The IC command is a bitmask that can be used to set which digital IO lines should be monitored for a 
state change. If one or more bits in IC is set, an IO 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 6) 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, 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).
Example
Sample AT Response
0x01
[1 sample set]
0x0C0C
[Digital Inputs: DIO 2, 3, 10, 11 low]
0x03
[Analog Inputs: A/D 0, 1]
0x0408
[Digital input states: DIO 3, 10 high, DIO 2, 11 low]
0x03D0
[Analog input ADIO 0= 0x3D0]
0x0124
[Analog input ADIO 1=0x120]