Zigbee Application Guide

From Flowcode Help
Jump to navigationJump to search

Introduction

These examples demonstrate the use of the Flowcode Zigbee component.

In particular they make use of up to three sets of the EB051 E-blocks Zigbee boards, connected to EB006 E-blocks PICmicro multiprogrammers fitted with a 16F1937 microprocessor.

However, the examples are easily changed in Flowcode to support other microprocessors and platforms.

The Matrix TSL EB421SI6 Easy Zigbee bundle has all the items required for these sample applications and is an ideal introduction to Zigbee technology.


Setting up the project hardware

Connect the E-Blocks as indicated in the table below.

The Zigbee, LCD and Switch E-Blocks all need to be powered via wire connections to the +V on their respective EB006 upstream processor board.


Hardware Setup (Node 1 - Coordinator)
EB006 PICmicro multiprogrammer
Port A
Port B EB005 E-blocks LCD board
Port C EB051C E-blocks Zigbee board
Port D


Hardware Setup (Node 2 - End Node)
EB006 PICmicro multiprogrammer
Port A
Port B
Port C EB051R E-blocks Zigbee board
Port D EB007 E-blocks switch board


Hardware Setup (Node 3 - End Node)
EB006 PICmicro multiprogrammer
Port A
Port B EB004 E-blocks LED board
Port C EB051R E-blocks Zigbee board
Port D


Example 1: Simple two node connection example

FC6 Icon.png Simple Two Node Connection Example (Node 1) FC6 Icon.png Simple Two Node Connection Example (Node 2)

Example 1 is a simple 2 node system. The Coordinator node 1 starts up the network and then checks to see if node 2 is available. Once node 2 has been detected any incoming data from node 2 is displayed on the LCD display. The data on node 2 is specified by pressing a switch on the switch E-Block connected to Port D.


Example 2: Three node data transfer example

FC6 Icon.png Three Node Data Transfer Example (Node 1) FC6 Icon.png Three Node Data Transfer Example (Node 2) FC6 Icon.png Three Node Data Transfer Example (Node 3)

In example 2 we will connect all 3 of the multiprogrammer boards to the Zigbee network. The Coordinator node will start up the network and then check that all nodes are present. Once all of the nodes have been successfully discovered the program then sends out a 0 which triggers the end nodes to start their main functionality. That is to send the switch data from node 2 to the LED board on node 3.


Example 3: Node sleep example

FC6 Icon.png Node Sleep Example (Node 1) FC6 Icon.png Node Sleep Example (Node 2) FC6 Icon.png Node Sleep Example (Node 3)

In example 3 we will repeat the functionality shown in example 2 but now we will allow end node 3 to go to sleep to save power. This functionality is useful for devices that are battery powered or require high power efficiency. When a node is asleep its parent node stores the data for it. The Zigbee protocol states that either the coordinator or router devices are capable of storing data for end points which are asleep. Once the endpoint needs to wakes up it uses the node wake macro to wake up the Zigbee module and then the data is automatically streamed to the end device from the parent node. This is therefore another reason why Zigbee is not useful for high data throughput but very useful for control applications.