---
title: XBee RF Transparent and API Mode Demo
description: "[Spin 2 Beginner Series Part 7: XBee Series 3 Objects with JonnyMac](https://www.youtube.com/embed/muYP6l2jRlc?feature=oembed) ##### Description This Quick Byte includes three spin2 code archives and objects for using Digi XBee Modules in transparent or API packet modes of wireless communication between two…"
url: "https://obex.parallax.com/docs/quick-bytes/propeller-2/xbee-rf-transparent-and-api-mode-demo/"
updated: "2026-09-27"
category: Propeller 2
---

# XBee RF Transparent and API Mode Demo

[Spin 2 Beginner Series Part 7:  XBee Series 3 Objects with JonnyMac](https://www.youtube.com/embed/muYP6l2jRlc?feature=oembed)

##### Description

This Quick Byte includes three spin2 code archives and objects for using Digi XBee Modules in transparent or API packet modes of wireless communication between two Propeller 2 (P2) microcontrollers. Because the P2 may send and receive to itself, the example uses only one P2 Edge Module.  

1. For **01_xbee_transparent – Archive.zip** we configure two XBee Series 3 Modules (802.15.4 XBee modules are fine too) with X-CTU for point-to-point communication in transparent mode (as a serial line over radio frequencies). 
2. The **02_xbee_at_reader – Archive.zip **is a short example to configure an XBee module for API mode and read the configuration settings back for display in Parallax Serial Terminal.
3. The **03_xbee_remote_node – Archive.zip**shows how X-CTU software can send base station commands in API mode to a XBee module configured with a specific address. The archive includes an XML file with properly formatted commands. 

Since this is a fairly long Quick Byte, you may wish to scroll to the bottom and review the parts used and download the source code before getting started. The entire Quick Byte and all three code archives are supported by the video presentation from Jon McPhalen, linked above. The video is a necessary companion if you wish to fully understand the capabilities of the example code. 

**TRANSPARENT MODE DEMO (01_xbee_transparent – Archive.zip)**

**Step 1: Configure the XBee Series 3 Modules for Transparent Mode Using X-CTU**

First, [download and install X-CTU](https://www.digi.com/resources/documentation/digidocs/90001526/tasks/t_download_and_install_xctu.htm) from Digi. Connect your XBee Series 3 Module into a XBee USB Adapter Board and open X-CTU.

Choose the “Discover radio devices” button and select the COM port where the XBee USB Adapter is connected. Then click “Next” to set the port parameters. 

![](/qbi/XBee RF Transparent And API Mode Demo - Parallax_files/XBee-discover.jpg)

The default port parameters of 8 Data Bits, No Parity, 1 Stop Bit and No Flow Control are common. If you have previously configured the XBee Module to a particular baud rate, select that baud rate to discover the module again. 

Click “Finish” to add the discovered XBee module. 

![](/qbi/XBee RF Transparent And API Mode Demo - Parallax_files/XBee-discover-baud.jpg)

Choose “Add selected devices” to add the discovered XBee Module to X-CTU. 

![](/qbi/XBee RF Transparent And API Mode Demo - Parallax_files/XBee-add-modules.jpg)

For this example, configure the XB3-24 as a Digi XBee 3 802.15.4 TH with the newest firmware and select “Update” to configure the firmware. The XBee Series 3 may be configured as a number of different prior models.  

![](/qbi/XBee RF Transparent And API Mode Demo - Parallax_files/XBee-firmware-update.jpg)

Next, we’ll clear any prior settings. Select “Default” and the module’s default settings will be applied. 

![](/qbi/XBee RF Transparent And API Mode Demo - Parallax_files/XBee-default-firmware.jpg)

Set the **CH Channel** to “F” and ID Network PAN ID to “CAFE”. 

![](/qbi/XBee RF Transparent And API Mode Demo - Parallax_files/XBee-channel-ID.jpg)

Set the **BD UART Baud Rate** to 57600.

![](/qbi/XBee RF Transparent And API Mode Demo - Parallax_files/XBee-baud.jpg)

For the first module, set the address as follows:

**MY 16-bit Source Address** to 0
**DH Destination Address High** to 0
**DL Destination Address Low** to 1

Click “Write” to fully configure the first XBee Series 3 Module. 

![](/qbi/XBee RF Transparent And API Mode Demo - Parallax_files/XBee-address.jpg)

For the second module, follow all of the steps defined above but set the address as follows:

**MY 16-bit Source Address** to 1
**DH Destination Address High** to 0
**DL Destination Address Low** to 0

![](/qbi/XBee RF Transparent And API Mode Demo - Parallax_files/XBee-address-2nd.jpg)

Click “Write” to fully configure the second XBee Series 3 Module. 

**Step 2: Install the Two XBee Series 3 Modules on a Propeller 2 Edge Breadboard**

The source code defines the P2 I/O pins that are connected to the XBee. The I/O pins are defined as constants from the perspective of the P2. The XBee’s DOUT connects to the P2’s XB_RX1, and the XBee’s DIN connects to the P2’s XB_TX1. 

The 01_xbee_transparent.spin2 source code makes this quite clear (but we point it out since it’s a common stumbling block):

```spin2
con { app io pins }

  XB_RX1   = 33  { I }           ' connect to XBee DOUT
  XB_TX1   = 32  { O }           ' connect to XBee DIN

  XB_RX0   =  9  { I }           ' connect to XBee DOUT
  XB_TX0   =  8  { O }           ' connect to XBee DIN
```

![](/qbi/XBee RF Transparent And API Mode Demo - Parallax_files/XBee-pairs.jpg)

**Step 3: Run the 01_xbee_transparent.spin2 Source Code**

Then, open Parallax Serial Terminal and you will see the following as the two XBee modules communicate.

![](/qbi/XBee RF Transparent And API Mode Demo - Parallax_files/XBee-communication.jpg)

This example code may be used for point-to-point communication between XBee modules. The code archive includes a modifed version of the full duplex serial object epecifically for XBees.  

**API MODE READER DEMO (02_xbee_at_reader – Archive.zip)**

The API packet mode is configured with X-CTU and read back with the 02_xbee_at_reader.spin2 program.

**Step 1: Configure the XBee Series 3 Modules for API Mode Using X-CTU**

The process is similar to what is described above for transparent mode, except you will make two changes to the current configuration:

1. Set the **BD Baud Rate** to 57,600
2. Change the **AP API Enable** to API Mode Without Escapes (1)
3. “Write” the updated settings to a module and return the XBee module to the P2 Edge Breadboard.

**Step 2: Run the 02_xbee_at_reader.spin2 Source Code**

Run the code example and open Parallax Serial Terminal. You may now observe the API mode settings.

![](/qbi/XBee RF Transparent And API Mode Demo - Parallax_files/XBee-API-reader.jpg)

**XBEE API REMOTE NODE DEMO (03_xbee_remote_node – Archive.zip)**

In this example, X-CTU is used to assemble an API packet to send to the XBee. Refer to the video to run this example.  

##### Parts Used

- [P2 Edge Module](https://www.parallax.com/product/p2-edge-module/)
- [P2 Edge Breadboard](https://www.parallax.com/product/p2-edge-module-breadboard/)
- [(1) XBee USB Adapter Board (#32400)](https://www.parallax.com/product/xbee-usb-adapter-board/)
- [(2) XBee XB3-24Z8PT-J Antenna (Low Current) Modules (#32421)](https://www.parallax.com/product/xbee-xb3-24z8pt-j-series-3-module-pcb-antenna-low-current/)
- [(2) XBee SIP Adapter (#32402)](https://www.parallax.com/product/xbee-sip-adapter/)

##### Source Code

- [01_xbee_transparent - Archive.zip](/qbi/downloads/01_xbee_transparent-Archive-Date-2022.05.22-Time-12.20.zip)
- [02_xbee_at_reader - Archive.zip](/qbi/downloads/02_xbee_at_reader-Archive-Date-2022.05.22-Time-12.21.zip)
- [03_xbee_remote_node - Archive.zip](/qbi/downloads/03_xbee_remote_node-Archive-Date-2022.05.22-Time-12.21.zip)

##### Programming Language

- [Spin 2](https://docs.google.com/document/d/16qVkmA6Co5fUNKJHF6pBfGfDupuRwDtf-wyieh_fbqw/)
- [PASM2](https://docs.google.com/spreadsheets/d/1_vJk-Ad569UMwgXTKTdfJkHYHpc1rZwxB-DcIiAZNdk/)

##### Tools and Operating System

- [Propeller Tool for Windows](https://www.parallax.com/package/propeller-tool-software-for-windows-spin-assembly-2/)
- [FlexProp for Windows, Mac and Linux](https://www.patreon.com/totalspectrum)

##### Additional Resources

- [Propeller 2 Spin Documentation](https://docs.google.com/document/d/16qVkmA6Co5fUNKJHF6pBfGfDupuRwDtf-wyieh_fbqw/edit)
- [Propeller 2 Live Forum: Spin2 Beginner Series with JonnyMac - XBee Objects (YouTube Video)](https://youtu.be/muYP6l2jRlc)

##### Document Author

- Ken Gracey

##### Source Code Author

- Jon McPhalen
