Advanced application features I/O line passing
XBee® SX 868 RF Module User Guide
73
I/O line passing
You can configure XBee SX 868 RF Modules to perform analog and digital line passing. When a device
receives an RF I/O sample data packet, you can set up the receiving device to update any enabled
outputs (PWM and DIO) based on the data it receives.
Digital I/O lines are mapped in pairs; pins configured as digital input on the transmitting device affect
the corresponding digital output pin on the receiving device. For example: DI5 (pin 25) can only
update DO5 (pin 25).
For Analog Line Passing, the XBee SX 868 RF Module has two PWM output pins that simulate the
voltage measured by the ADC lines AD0 and AD1. For example, when configured as an ADC, AD0 (pin
33) updates PWM0 (pin 7); AD1 (pin 32) updates PWM1 (pin 8).
The default setup is for outputs to not be updated. Instead, a device sends I/O sample data out the
serial interface if the device is configured for API mode (AP = 1 or 2). You can use the IU command to
disable sample data output.
To enable updating the outputs, set the IA (I/O Input Address) parameter with the address of the
device that has the appropriate inputs enabled. This effectively binds the outputs to a particular
device’s input. This does not affect the ability of the device to receive I/O line data from other devices
- only its ability to update enabled outputs. Set the IA parameter to 0xFFFF (broadcast address) to set
up the device to accept I/O data for output changes from any device on the network.
For line passing to function, the device configured with inputs must generate sample data.
When outputs are changed from their non-active state, the device can be setup to return the output
level to its non-active state. The timers are set using the Tn (Dn Output Timer) and PT (PWM Output
Timeout) commands. The timers are reset every time the device receives a valid I/O sample packet
with a matching IA address. You can adjust the IC (Change Detect) and IR (Sample Rate) parameters
on the transmitting device to keep the outputs set to their active output if the system needs more
time than the timers can handle.
Configuration example
As an example for a simple digital and analog link, you could set a pair of RF devices as follows:
Command Description Device A Device B
SH Serial Number High 0x0013A200 0x0013A200
SL Serial Number Low 0x12345678 0xABCDABCD
DH Destination High 0x0013A200 0x00000000
DL Destination Low 0xABCDABCD 0x0000FFFF (broadcast)
IA I/O Input Address 0x0013A200ABCDABCD 0x0013A20012345678
IR Sample Rate 0x7D0 (2 seconds) 0 (disabled)
IC DIO Change Detect 0 (disabled) 0x1000 (DIO3 only)
D1 DIO1/AD1 2 : ADC input N/A
P1 DIO11/PWM1 N/A 2: PWM1 output
PT PWM Output Timeout N/A 0x1E (3 seconds)