element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Cypress Kits
  • Products
  • Dev Tools
  • Cypress Kits
  • More
  • Cancel
Cypress Kits
Forum PSoC 4 Pioneer Kit Community Project#025 – XBee Direct IO
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Cypress Kits to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 3 replies
  • Subscribers 26 subscribers
  • Views 624 views
  • Users 0 members are here
  • 100projects
Related

PSoC 4 Pioneer Kit Community Project#025 – XBee Direct IO

cy.wbz
cy.wbz over 12 years ago

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:

  • CY8CKit-042
  • Arduino wireless shield board
  • XBee wireless module
  • Sparkfun explorer USB
  • Wire

 

image

 

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.

 

Setup your XBee

 

X-CTU Download

 

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.

 

image

image

 

I hope this example can help you out in your design.

 

Best,

Matt

Attachments:
XbeeDirectIO.cywrk.Archive05.zip
4341.Project Images.zip
  • Sign in to reply
  • Cancel

Top Replies

  • Former Member
    Former Member over 12 years ago in reply to jesusantoniocar +1
    Hello Jesus, To assign your Xbee destination address replace the paramter in the setDestAddr() macro with the lower 32 bit address on the back the Xbee module,. You can find the network address a couple…
  • jesusantoniocar
    jesusantoniocar over 12 years ago in reply to Former Member +1
    Hello Keith. Thanks for your fast response, right now i understand how can i find the address network. Excellent explanation. Best regards, Jesus Antonio.
Parents
  • jesusantoniocar
    jesusantoniocar over 12 years ago

    Hello Matt.

    Thanks for this project, i have a question respect this project, how do you assigned the address in the code, what is the range to select?.

     

     

    /* Insert lower destination address */

        setDestAddr(0x4079B0F6);

        /* Insert custom network address */

        setNetworkAddr(0x7070);

     

    best regards,

     

    Jesus Antonio.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • jesusantoniocar
    jesusantoniocar over 12 years ago

    Hello Matt.

    Thanks for this project, i have a question respect this project, how do you assigned the address in the code, what is the range to select?.

     

     

    /* Insert lower destination address */

        setDestAddr(0x4079B0F6);

        /* Insert custom network address */

        setNetworkAddr(0x7070);

     

    best regards,

     

    Jesus Antonio.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • Former Member
    Former Member over 12 years ago in reply to jesusantoniocar

    Hello Jesus,

     

    To assign your Xbee destination address replace the paramter in the setDestAddr() macro with the lower 32 bit address on the back the Xbee module,.

     

    You can find the network address a couple of ways.

     

    1) Use the X-CTU software to read the network address setting and replace it as the parameter in the setNetworkAddr() macro.

    2) Setup your routers and end points to send a join notification when they attach to a network.  They will send out a packet with their 64 bit unique address, 16 bit network address, along with other information such as there descriptor string.   You can parse this information and save it used the associated macros.

     

    For the example I simply attached the Xbee module to the X-CTU software and wrote down the address information and placed it in code.

     

    Regards,

    Keith

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • jesusantoniocar
    jesusantoniocar over 12 years ago in reply to Former Member

    Hello Keith.

    Thanks for your fast response, right now i understand  how can i find the address network.

    Excellent explanation.

     

     

    Best regards,

     

    Jesus Antonio.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube