www.agelectronica.com
XBee Series 2 ZigBee OEM RF Modules v1.x2x [2007.07.019]
8.0.2. AT Command Programming Examples
Refer to the 'X‐CTU' sec‐
tion of the Develop‐
ment Guide [Appendix
B] for more information
regarding the X‐CTU
configuration software.
8.0.3. API Programming Examples
www.agelectronica.com
Setup
The programming examples in this section require the installation of MaxStream's X-CTU Soft-
ware and a serial connection to a PC. (MaxStream stocks RS-232 and USB boards to facilitate
interfacing with a PC.)
1.
Install MaxStream's X-CTU Software to a PC by double-clicking the "setup_X-CTU.exe" file.
(The file is located on the MaxStream CD and under the 'Software' section of the following
web page: www.maxstream.net/support/downloads.php)
2.
Mount the RF module to an interface board, then connect the module assembly to a PC.
3.
Launch the X-CTU Software and select the 'PC Settings' tab. Verify the baud and parity set-
tings of the Com Port match those of the RF module.
NOTE: Failure to enter AT Command Mode is most commonly due to baud rate mismatch.
Ensure the 'Baud' setting on the 'PC Settings' tab matches the interface data rate of the RF mod-
ule. By default, the BD parameter = 3 (which corresponds to 9600 bps).
Sample Configuration: Modify RF Module Destination Address
Example: Utilize the X-CTU "Terminal" tab to change the RF module's DL (Destination Address
Low) parameter and save the new address to non-volatile memory.
After establishing a serial connection between the RF module and a PC [refer to the 'Setup' sec-
tion above], select the "Terminal" tab of the X-CTU Software and enter the following command
lines ('CR' stands for carriage return):
Method 1 (One line per command)
Send AT Command
+++
ATDL <Enter>
ATDL1A0D <Enter>
ATWR <Enter>
ATCN <Enter>
Method 2 (Multiple commands on one line)
Send AT Command
+++
ATDL <Enter>
ATDL1A0D,WR,CN <Enter>
Sample Configuration: Restore RF Module Defaults
Example: Utilize the X-CTU "Modem Configuration" tab to restore default parameter values.
After establishing a connection between the module and a PC [refer to the 'Setup' section
above], select the "Modem Configuration" tab of the X-CTU Software.
1.
Select the 'Read' button.
2.
Select the 'Restore' button.
API Configuration Using the X-CTU
The programming examples in this section require the installation of MaxStream's X-CTU soware
and a serial connection to a PC. See "Setup" example in the AT Command Programming Exam-
ples in Section 8.0.2.
1.
Launch the X-CTU Software and select the 'PC Settings' tab. Verify the baud and parity set-
tings of the Com Port match those of the RF module.
2.
To communicate with a module that has API firmware, check the "Enable API" box.
3.
If escaping is enabled (AP=2, non-default setting), select the "Use escape characters" box
to enable escaping.
4.
Select the 'Modem Configuration' tab.
5.
The 'Read', 'Write', and 'Restore' buttons can be used to read module parameters, write new
settings, or restore defaults.
© 2007 Digi International, Inc.
System Response
OK <CR> (Enter into Command Mode)
{current value} <CR> (Read Destination Address Low)
OK <CR> (Modify Destination Address Low)
OK <CR> (Write to non-volatile memory)
OK <CR> (Exit Command Mode)
System Response
OK <CR> (Enter into Command Mode)
{current value} <CR> (Read Destination Address Low)
OK<CR> OK<CR> OK<CR>
www.agelectronica.com
Chapter 8 ‐ Examples
57
www.agelectronica.com