Hello!
Today we will add another XBee example for our Pioneer Kit. We are expanding on example #024. Please refer to that example for details on XBee modules and the X-CTU software. We will be using the following hardware in our design:
In this project we have two separate boards communicating using the XBee wireless modules. The first board is the Sparkfun Explorer USB board. In this example we will be using this board to read in values on two pins, one analog signal and one digital signal. This data will be reported to the Pioneer kit and up to the PC through hyperterminal.
The second board will be the Pioneer board using the Arduino wireless shield board with an XBee wireless module attached. In this example the Pioneer kit will be using the XBee module to listen for the data from the Explorer board and display that data to the PC through a Hyperterminal software.
Forum Post Attachments:
At the bottom of this post we are including the following items:
- Example Project Zip File
- Zip File of Images
- Project Schematic
- Component Configurations
Components Used:
The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:
- Two UARTs
- XBee_UART
- PC_COM_UART
- tinyprintf
The components are configured by right clicking on the component in your Top Design schematic view and selecting Configure. Please enable the following selections in the Configuration windows for the listed components above.
Firmware Description:
The main.c firmware is included in the example project. Please review the commented sections for more details.
As in example #024 we showed the user how to configure the XBee modules to create a wireless network. In that example we set the modules up in a AT network. In this example we will configure the modules in an API network. We will also enable GPIO and Analog features available on the XBee wireless boards.
For more information on the XBee modules and the X-CTU software please see the following links and reference our example #024.
In this example you will connect the wireless module on the Explorer board as a “Router API” and the module on the Arduino shield as a “Coordinator API”. This orientation is opposite the example in #024. This orientation will allow us to use the tinyprintf component discussed in example #023 when communicating to the hyperterminal program on the PC.
Coordinator Settings:
PAND ID: 1777 (Any address from 0 to FFFF works, must match router)
Destination Address High: 0013A200
Destination Address Low: (Unique address printed below the 0013A200 on the Router module).
Once the information has been entered into the system, click the Write Button in the X-CTU GUI to configure the module.
Router Settings:
PAND ID: 1777 (Any address from 0 to FFFF works, must match router)
Destination Address High: 0013A200
Destination Address Low: (Unique address printed below the 0013A200 on the Coordinator module).
JV - Channel Verification: (JV - Enable)
D1 – AD1/DIO1 Configuration: (D1 2 - ADC)
D2 – AD2/DIO2 Configuration: (D2 3 - Digital Input)
IR – IO Sampling Rate: (IR - 3E8) HEX 3E8 == 1000 milliseconds report rate
Once the information has been entered into the system, click the Write Button in the X-CTU GUI to configure the module.
Hardware Connections:
This project requires the user to connect their Pioneer board to the Arduino Shield board and insert the XBee wireless module into the shield board.
The user must also connect their XBee wireless module to the Sparkfun Explorer board.
Both the explorer board and the Pioneer kits will be connected to the PC.
Enable the PSoC 4 UART connections to the PSoC 5LP.
PSoC 4 P4[1] -> P5LP P12[6]
PSoC 4 P4[0] -> P5LP P12[7]
Test Your Project:
Once you have configured the wireless modules, programmed your PSoC 4, and connect through the COM port to the Pioneer Board, you will see the hyperterminal software updating the values every second.
Then take a wire and flip over the Sparkfun Explorer Board.
Short the GND and DIO1 vias. You will see the hyperterminal update it’s corresponding display.
Take the same wire and short the GND to DIO2 you will see the reported value go to 0.
Next take the same wire and short the 5V via to DIO2, you will see the displayed value go to ~1000.
I hope this example can help you out in your design.
Best,
Matt


