lab 4 zigbee 802 15 4 with picdem z boards
Skip this Video
Download Presentation
Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards

Loading in 2 Seconds...

play fullscreen
1 / 42

Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards - PowerPoint PPT Presentation

  • Uploaded on

Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards. 55:088 Spring 2007. Everyone has heard of 802.11 (Wi-Fi)…. IEEE 802.11 features: Ethernet matching speed Long range(30-90m) Complexity to handle seamless roaming Message forwarding Data throughput of 2-11Mbit/s. …so what is 802.15?.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about ' Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards' - lisandra-bradford

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
everyone has heard of 802 11 wi fi
Everyone has heard of 802.11 (Wi-Fi)…
  • IEEE 802.11 features:
    • Ethernet matching speed
    • Long range(30-90m)
    • Complexity to handle seamless roaming
    • Message forwarding
    • Data throughput of 2-11Mbit/s
so what is 802 15
…so what is 802.15?
  • Specializes in Wireless PAN (Personal Area Network) standards
  • 802.15.1 – a.k.a. Bluetooth(1 Mbps)
  • 802.15.2 - Deals with coexistence of Wireless LAN (802.11) and Wireless PAN
  • 802.15.3 - High-rate WPAN standards (Wireless USB)
  • 802.15.4 – a.k.a ZigBee, low-data rate, low-power networks
what is zigbee about
What is ZigBee about?
  • ZigBee can be found in embedded applications requiring low data rates and low power consumption
  • Fortunately, it is (relatively) low complexity as well
  • Applications include:
    • Embedded sensors
    • Medical devices
    • Smoke and intruder alarms
    • Home automation
    • PC peripherals
zigbee 802 15 4 features
ZigBee/802.15.4 features
  • Transmission range:
    • 10m – 75m
  • Three operating bands:
    • 868 MHz (20kbps) (ch. 0)
    • 915 MHz (40kbps) (ch. 1-10)
    • 2.4 GHz (250kbps) (ch. 11-26) *
  • Three types of networks:
    • Star *
    • Cluster
    • Mesh
channel spacing
Channel Spacing

In the 2.4GHz band, each channel is about 3MHz wide

types of ieee 802 15 4 nodes
Types of IEEE 802.15.4 nodes
  • Full Function Devices (FFDs)
    • Every network needs to have at least one FFD that acts as a Coordinator
    • FFDs are always powered on
    • Maintain the state of the network so that RFDs can save battery power
    • Require more system resources (memory especially) in order to keep track of network state, addresses, routes, messages
types of ieee 802 15 4 nodes1
Types of IEEE 802.15.4 nodes
  • Reduced Function Devices (RFDs)
    • Can only talk with FFDs
    • Spend most of time powered down, will not receive messages when off
    • Wake up occasionally and ask to see if they have a packet(s) waiting for them from their parent node (FFD)
types of zigbee nodes
Types of ZigBee nodes
  • Coordinator
    • This is an FFD
    • Only one per network, is in charge of forming it
  • Router
    • This is an FFD
    • Optional node that extends the range of the network
  • End
    • This is an RFD (usually) that performs monitoring and/or control functions
how does zigbee form networks
How does ZigBee form networks?

Basic Type: Star Networks

how does zigbee form networks1
How does ZigBee form networks?

More Complex: Cluster Network

how does zigbee form networks2
How does ZigBee form networks?

Very Complex: Mesh Networks

what does this have to do with 55 088
What does this have to do with 55:088?
  • Lab 4 will be using 802.15.4 radios to create a wireless serial link between two nodes
  • Each group will be provided with the pair of wireless radios on development boards from Microchip
  • These kits are NOT to be removed from the lab
cc2420 radio ic
CC2420 Radio IC

2.4 GHz RF Transceiver

Connect to microcontrollers via SPI

Comes on a daughter board with the PICDEM Z kit

250 kbps data rate

2.1V – 3.6V

19.7 mA (RX)

17.4 mA (TX)

  • Microcontroller found with the PICDEM Z kits
  • Overall, very similar to the 18F452
  • Biggest difference that will matter to you is that these operate at 3.3V, instead of 5V
  • Use the MPLAB and C18 compiler to write code for the PIC
18lf4620 on the picdemz
18LF4620 on the PICDEMZ
  • Pin 1 = Reset Button
  • Pin 2-3 = LEDs
  • Pin 11-12 = Power
  • Pin 13-14 = 4 MHz XTL
  • Pin 15-18 = CC2420
  • Pin 23-24 = CC2420
  • Pin 25-26 = USART
  • Pin 31-32 = Power
  • Pin 33-36 = CC2420
  • Pin 37-38 = Interrupt Buttons
  • Pin 39-40 = ICD 2
profiles and endpoints
Profiles and Endpoints
  • You will need to select a profile or create your own to detail how components interface with one another
  • A functional block of code that supports a component is called an endpoint
  • For the lab, best option is to look at the Demo Coordinator and RFD code to see how endpoints are used (profile: zHCLighting.h)
  • The ZigBee Device Object is found on every ZigBee device and reserves the endpoint 0
  • Endpoint number 1 – 240 are available for the developer to use as they see fit
  • Endpoints act as a sub-address to allow individual components on a node to be accessed

Here, flipping Switch 2 will send a message to the other node. How does the other node know that the message is for Lamp 4?


Assign Switch 1 to endpoint 3

Assign Switch 2 to endpoint 21

Assign Lamp 4 to endpoint 39

  • If a node knows the network address of the destination it wishes to send to, this is called direct messaging
  • For large networks, a table of known addresses could become very large
  • Instead of every node knowing the address of all participating network nodes, the ZigBee coordinator could be left in charge of that task
  • A node could become “bound” to another node through a table on the coordinator
  • When a message is sent to another node it goes through the coordinator to match the destination from the table
  • This is called indirect messaging
lab 4 overview
Lab 4 Overview
  • A text-input GUI on a computer will connect via RS-232 to one of the PICDEM Z boards (we’ll call this the Base Station)
  • The other PICDEM Z board will be connected to a Liquid Crystal Display (LCD) that will display the text messages from the base station (we’ll call this the Remote Station)
lab 4 overview1
Lab 4 Overview
  • The remote station will have a couple of “switches” which will either indicate an “on” or “off” state
  • The switch states need to be sent back to the base station and displayed on the base station GUI
gui layout on base station
GUI Layout on Base Station
  • Use whatever language you wish to create the GUI…
tools that you will use
Tools that you will use…

Microchip has developed code that makes interfacing with the 802.15.4 radios vastly easier

This is called the “stack”

Template &

Your Code


IEEE 802.15.4

tools that you will use1
Tools that you will use…

In order to utilize the stack:

MPLAB v 7.41

C18 Compiler

Microchip ZigBee stack v 3.5

ZENA Stack Configuration Tool

Look at example files:



Do NOT alter files in the Stack directory as this could cause the computer (or worse, the TA) to explode

“Look, but don’t touch”


Found in the MpZBee directory

zigbee def
  • Created by ZENA
  • It selects many key parameters that will define how a particular node will operate:
    • Specify Coordinator, Router, or End Device
    • Frequencies (channels) to operate on
    • Power mode
    • Node address
    • As well as many other network factors…
zlink lkr
  • Created by ZENA
  • Allocates RAM and ROM
  • Reserves space on the PIC for the stack (differs for RFD and FFD)
  • Reserves space on the PIC for received messages and messages to be sent
  • Don’t modify what ZENA generated
myzigbee c
  • Defines ZigBee Endpoints and the inputs and outputs
  • ZigBee Device Object Endpoint
  • References Zigbee.def to fill out some of the parameters
  • Suggestion: Compare to the myZigBee.c files found in the demo programs to help understand the format
key points about tx and rx
Key points about TX and RX
  • TX: Fill bytes into TxBuffer one byte at a time using:
    • TxBuffer[TxData++] = a;
    • Then set
      • currentPrimitive = APSDE_DATA_request;
  • RX: Retrieve one byte at a time using:
    • b = APLGet();
  • The LCD can run off of the 3.3V from the PICDEM Z boards
  • Contrast is much better if the LCD is powered by 5V from the regulators used in lab