Enable Digital Input Pin in Xbee
In this post we will go through the process of remotely configuring the XBee end device I/O pin as digital input from XBee coordinator using Digi X-CTU software. The I/O pin we are considering in our case is DIO4(pin no 11) on the end device.
Hardware/Software environment settings
- One XBee node configured as Zigbee Coordinator API (Firmware version: 21A7)
- One XBee node configured as Zigbee End Device API(Firmware version: 29A7)
- Digi X-CTU application software (Version: 18.104.22.168)
The approach followed here, to configure remote end device from coordinator is by passing AT commands in API mode. While working with API firmware version, we need to check Enable API in the PC Settings tab of the X-CTU.
In XBee we have the API frame type 0x17, called Remote AT Command Request frame, available to ease our job in setting the pin as digital input.
API Frame to Enable a DIO Pin as Digital Input
|Delimiter||Length of payload||Frame Type||Frame ID||64 bit address of destination|
|16 bit network address of destination||Command options||AT command||Command parameter||Checksum|
Length of payload: Calculated by the number bytes between Frame Type and Command parameter. In the above, there are 16 bytes(HEX equivalent 10) between Frame Type and Command parameter.
Frame Type: 0x17 for Remote AT Command Request frame.
Frame ID: 0x01 for ACK.
64 bit address of the destination: Assigned by the manufacturer.
16 bit address of the destination: Assigned by the coordinator while forming network.
Command Options: 0x02 for update.
AT Command: D4(0x4434).
Command Parameters: 0x03 for digital input.
In X-CTU, go to Terminal Tab and select Assemble Packet. This will pop up send packet window. Select display as HEX. Enter the API frame that you would like to transfer to the remote end device here and click on send data.
The text in blue is the API frame passed out from the coordinator to the remote end device. The text in red is the response received from the remote end device by the coordinator. The API response frame type is 0x97, called Remote Command Response.
|Delimiter||Length of payload||Frame Type||Frame ID||64 bit address of source|
|16 bit network address of source||AT command||Command status||Checksum|
Length of payload: Calculated by the number bytes between Frame Type and Command parameter. In the above, there are 15 bytes(HEX equivalent 0x0F) between Frame Type and Command status.
Frame Type: 0x97 for Remote Command Response frame.
Frame ID: 0x01 .
64 bit address of the source: Address of the remote radio returning this response.
16 bit address of the source: Network address of the remote radio.
AT Command: D4(0x4434).
Command Status: 0x0o for OK.
Checksum: Calculated by adding all bytes after length(exclude delimiter and length) and then keeping only the lowest 8 bits of the result. Next subtract the result from 0xFF to obtain checksum.