Binary Command Programming Exercise

It is often necessary to configure an RF module at a much faster rate than AT commands will allow. In such cases the XStream, XTend, and XSC RF modules offer a Binary Command Mode option. This article is an exercise on how to use Binary Command Mode. In this example we will send binary commands to set parameters using Digi's X-CTU software. Using the X-CTU's terminal tab is not the normal way binary command mode would be used, but it can be used to illustrate the necessary step-by-step process and allows for the testing of that process. 

This example will use binary commands to set the Destination Address, DT parameter, to 2005. Parameter values are always sent as two bytes with the least significant byte sent first (little Endian.) Please refer to the Command Reference section of your product manual for a listing of binary commands. For the modules to recognize a binary command, the RT (DI2 Configuration) parameter must be set to 1. If binary programming is not enabled (RT ? 1), the modem will not recognize that the CMD pin is asserted and therefore will not recognize the binary data as commands.
  1. Connect an XStream, XTend, or XSC RF module to an RS232 interface board and connect to a PC running X-CTU.
  2. Under the Terminal tab, enter into command mode by keying the command characters "+++", while observing the appropriate guard times. The terminal will respond with a red OK once the radio has correctly entered command mode.
  3. Key ATRT1 to enable binary programming.
  4. Key ATCN to exit command mode.
  5. Under the Terminal Tab on X-CTU, assert the CMD pin (driven high) by un-checking the RTS box, entering into Binary Command Mode.
  6. Click "Show Hex" button.
  7. Click "Assemble Packet" button and select the HEX option.
  8. Key 00 05 20 and click "Send". The first byte "00" represents the DT parameter (refer to Command Reference table in manual). The second and third bytes "05 20" represent the parameter value we wish to assign to the DT parameter (DT = 2005).
  9. Recheck the RTS box, and the module will now accept transmitted data as raw data once again, instead of binary commands.
To verify the DT parameter has been set, enter normally into ASCII command mode by keying the command string +++, observing the appropriate guard times. After the red OK is displayed, type ATDT . Your terminal will display a red 2005. Alternatively, commands can be queried for their current value by performing an OR operation (bit-wise) with the command value and the value 0x80 (hexadecimal). This should be done with CMD asserted. When the binary query command is sent (with no parameter values), the current value of the parameter is sent back through the DO pin. For example, try the above example again, but this time, replacing Step #8 with the following:
  • Key 80 and click "Send." 80 represents 00 (DT parameter) ORed with 80. The module will responds with "05 20", the current value of the DT parameter.
Last updated: Aug 08, 2017

Recently Viewed

No recently viewed articles

Did you find this article helpful?