lab 4 zigbee & 802.15.4 with picdem z boards 55:088 fall 2006
TRANSCRIPT
![Page 1: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/1.jpg)
Lab 4Lab 4ZigBee & 802.15.4 with ZigBee & 802.15.4 with
PICDEM Z BoardsPICDEM Z Boards55:08855:088
Fall 2006Fall 2006
![Page 2: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/2.jpg)
Everyone has heard of 802.11 Everyone has heard of 802.11 (Wi-Fi)…(Wi-Fi)…
IEEE 802.11 features:Ethernet matching speed, Long range(30-90m)Complexity to handle seamless
roamingMessage forwardingData throughput of 2-11Mbit/s
![Page 3: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/3.jpg)
……so what is 802.15?so what is 802.15?
Specializes in Wireless PAN Specializes in Wireless PAN (Personal Area Network) standards (Personal Area Network) standards
802.15.1 – a.k.a. Bluetooth(1 Mbps)802.15.1 – a.k.a. Bluetooth(1 Mbps) 802.15.2 - Deals with coexistence of 802.15.2 - Deals with coexistence of
Wireless LAN (802.11) and Wireless Wireless LAN (802.11) and Wireless PANPAN
802.15.3 - High-rate WPAN 802.15.3 - High-rate WPAN standards (Wireless USB)standards (Wireless USB)
802.15.4 – a.k.a ZigBee, low-data 802.15.4 – a.k.a ZigBee, low-data rate, low-power networksrate, low-power networks
![Page 4: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/4.jpg)
![Page 5: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/5.jpg)
What is ZigBee about?What is ZigBee about?
ZigBee can be found in embedded ZigBee can be found in embedded applications requiring low data rates applications requiring low data rates and low power consumptionand low power consumption
Fortunately, it is (relatively) low Fortunately, it is (relatively) low complexity as wellcomplexity as well
Applications include:Applications include: Embedded sensorsEmbedded sensors Medical devicesMedical devices Smoke and intruder alarmsSmoke and intruder alarms Home automationHome automation PC peripheralsPC peripherals
![Page 6: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/6.jpg)
ZigBee/802.15.4 featuresZigBee/802.15.4 features Transmission range:Transmission range:
10m – 75m10m – 75m Three operating bands:Three operating bands:
868 MHz (20kbps) (ch. 0)868 MHz (20kbps) (ch. 0) 915 MHz (40kbps)915 MHz (40kbps) (ch. 1-10) (ch. 1-10) 2.4 GHz (250kbps) (ch. 11-26) *2.4 GHz (250kbps) (ch. 11-26) *
Three types of networks:Three types of networks: Star *Star * ClusterCluster MeshMesh
![Page 7: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/7.jpg)
Channel SpacingChannel Spacing
In the 2.4GHz band, each channel is about 3MHz wide
![Page 8: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/8.jpg)
Types of IEEE 802.15.4 nodesTypes of IEEE 802.15.4 nodes
Full Function Devices (FFDs)Full Function Devices (FFDs) Every network needs to have at Every network needs to have at
least one FFD that acts as a least one FFD that acts as a CoordinatorCoordinator
FFDs are always powered onFFDs are always powered on Maintain the state of the network Maintain the state of the network
so that RFDs can save battery so that RFDs can save battery powerpower
Require more system resources Require more system resources (memory especially) in order to (memory especially) in order to keep track of network state, keep track of network state, addresses, routes, messagesaddresses, routes, messages
![Page 9: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/9.jpg)
Types of IEEE 802.15.4 nodesTypes of IEEE 802.15.4 nodes
Reduced Function Devices Reduced Function Devices (RFDs)(RFDs) Can only talk with FFDsCan only talk with FFDs Spend most of time powered Spend most of time powered
down, will not receive messages down, will not receive messages when offwhen off
Wake up occasionally and ask to Wake up occasionally and ask to see if they have a packet(s) see if they have a packet(s) waiting for them from their parent waiting for them from their parent node (FFD)node (FFD)
![Page 10: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/10.jpg)
Types of ZigBee nodesTypes of ZigBee nodes
CoordinatorCoordinator This is an FFDThis is an FFD Only one per network, is in charge of Only one per network, is in charge of
forming itforming it RouterRouter
This is an FFDThis is an FFD Optional node that extends the range of Optional node that extends the range of
the networkthe network EndEnd
This is an RFD (usually) the performs This is an RFD (usually) the performs monitoring and/or control functionsmonitoring and/or control functions
![Page 11: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/11.jpg)
How does ZigBee form How does ZigBee form networks?networks? Basic Type: Star NetworksBasic Type: Star Networks
![Page 12: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/12.jpg)
How does ZigBee form How does ZigBee form networks?networks? More Complex: Cluster NetworkMore Complex: Cluster Network
![Page 13: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/13.jpg)
How does ZigBee form How does ZigBee form networks?networks?
Very Complex: Mesh NetworksVery Complex: Mesh Networks
![Page 14: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/14.jpg)
What does this have to do What does this have to do with 55:088?with 55:088? Lab 4 will be using 802.15.4 Lab 4 will be using 802.15.4
radios to create a wireless serial radios to create a wireless serial link between two nodeslink between two nodes
Each group will be provided with Each group will be provided with the pair of wireless radios on the pair of wireless radios on development boards from development boards from MicrochipMicrochip
These kits are NOT to be These kits are NOT to be removed from the labremoved from the lab
![Page 15: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/15.jpg)
PICDEM Z BoardsPICDEM Z Boards
![Page 16: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/16.jpg)
CC2420 Radio ICCC2420 Radio IC
2.4 GHz RF Transceiver2.4 GHz RF Transceiver Connect to microcontrollers via Connect to microcontrollers via
SPISPI Comes on a daughter board with Comes on a daughter board with
the PICDEM Z kitthe PICDEM Z kit 250 kbps data rate250 kbps data rate 2.1V – 3.6V2.1V – 3.6V 19.7 mA (RX)19.7 mA (RX) 17.4 mA (TX)17.4 mA (TX)
![Page 17: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/17.jpg)
18LF462018LF4620
![Page 18: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/18.jpg)
18LF462018LF4620 Microcontroller found with the Microcontroller found with the
PICDEM Z kitsPICDEM Z kits Overall, very similar to the Overall, very similar to the
18F45218F452 Biggest difference that will Biggest difference that will
matter to you is that these matter to you is that these operate at 3.3V, instead of 5Voperate at 3.3V, instead of 5V
Use the MPLAB and C18 Use the MPLAB and C18 compiler to write code for the compiler to write code for the PICPIC
![Page 19: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/19.jpg)
18LF4620 on the PICDEMZ18LF4620 on the PICDEMZ
Pin 1 = Reset ButtonPin 1 = Reset Button Pin 2-3 = LEDsPin 2-3 = LEDs Pin 11-12 = PowerPin 11-12 = Power Pin 13-14 = 4 MHz XTLPin 13-14 = 4 MHz XTL Pin 15-18 = CC2420Pin 15-18 = CC2420 Pin 23-24 = CC2420Pin 23-24 = CC2420 Pin 25-26 = USARTPin 25-26 = USART Pin 31-32 = PowerPin 31-32 = Power Pin 33-36 = CC2420Pin 33-36 = CC2420 Pin 37-38 = Interrupt ButtonsPin 37-38 = Interrupt Buttons Pin 39-40 = ICD 2Pin 39-40 = ICD 2
![Page 20: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/20.jpg)
Lab 4 OverviewLab 4 Overview
A text-input GUI on a computer will A text-input GUI on a computer will connect via RS-232 to one of the connect via RS-232 to one of the PICDEM Z boards (we’ll call this the PICDEM Z boards (we’ll call this the Base Station)Base Station)
The other PICDEM Z board will be The other PICDEM Z board will be connected to a Liquid Crystal Display connected to a Liquid Crystal Display (LCD) that will display the text (LCD) that will display the text messages from the base station messages from the base station (we’ll call this the Remote Station)(we’ll call this the Remote Station)
![Page 21: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/21.jpg)
Lab 4 OverviewLab 4 Overview
The remote station will have a The remote station will have a couple of “switches” which will couple of “switches” which will either indicate an “on” or “off” either indicate an “on” or “off” statestate
The switch states need to be The switch states need to be sent back to the base station sent back to the base station and displayed on the base and displayed on the base station GUIstation GUI
![Page 22: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/22.jpg)
Example LayoutExample Layout
![Page 23: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/23.jpg)
PICDEM Z with LCDPICDEM Z with LCD
![Page 24: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/24.jpg)
GUI Layout on Base StationGUI Layout on Base Station
Use whatever language you Use whatever language you wish to create the GUI…wish to create the GUI…
![Page 25: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/25.jpg)
Tools that you will use…Tools that you will use… Microchip has developed code Microchip has developed code
that makes interfacing with the that makes interfacing with the 802.15.4 radios vastly easier802.15.4 radios vastly easier
This is called the “stack”This is called the “stack”
IEEE 802.15.4
ZigBee
Template &
Your Code
![Page 26: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/26.jpg)
Tools that you will use…Tools that you will use… In order to utilize the stack:In order to utilize the stack:
MPLAB v 7.41MPLAB v 7.41 C18 CompilerC18 Compiler Microchip ZigBee stack v 3.5Microchip ZigBee stack v 3.5 ZENA Stack Configuration ToolZENA Stack Configuration Tool
Look at example files:Look at example files: C:\MpZBee\DemoCoordinator\C:\MpZBee\DemoCoordinator\ C:\MpZBee\DemoRFD\C:\MpZBee\DemoRFD\
Do NOT alter files in the Stack Do NOT alter files in the Stack directory as this could cause the directory as this could cause the computer (or worse, the TA) to computer (or worse, the TA) to explodeexplode ““Look, but don’t touch”Look, but don’t touch”
![Page 27: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/27.jpg)
ZENAZENAFound in the MpZBee directory
![Page 28: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/28.jpg)
ZENAZENA
![Page 29: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/29.jpg)
ZENAZENA
![Page 30: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/30.jpg)
Profiles and EndpointsProfiles and Endpoints
You will need to select a profile or You will need to select a profile or create your own to detail how create your own to detail how components interface with one components interface with one anotheranother
A functional block of code that A functional block of code that supports a component is called an supports a component is called an endpointendpoint
For the lab, best option is to use the For the lab, best option is to use the zHCLighting.h profile provided with zHCLighting.h profile provided with the stack and make a few changesthe stack and make a few changes
![Page 31: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/31.jpg)
Zigbee.defZigbee.def
Created by ZENACreated by ZENA It selects many key parameters that It selects many key parameters that
will define how a particular node will will define how a particular node will operate:operate: Specify Coordinator, Router, or End Specify Coordinator, Router, or End
DeviceDevice Frequencies (channels) to operate onFrequencies (channels) to operate on Power modePower mode Node addressNode address As well as many other network factors…As well as many other network factors…
![Page 32: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/32.jpg)
zLink.lkrzLink.lkr
Created by ZENACreated by ZENA Allocates RAM and ROMAllocates RAM and ROM Reserves space on the PIC for Reserves space on the PIC for
the stack (differs for RFD and the stack (differs for RFD and FFD)FFD)
Reserves space on the PIC for Reserves space on the PIC for received messages and received messages and messages to be sentmessages to be sent
Don’t modify what ZENA Don’t modify what ZENA generatedgenerated
![Page 33: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/33.jpg)
myZigBee.cmyZigBee.c
Defines ZigBee network Defines ZigBee network parametersparameters
ZigBee Device Object EndpointZigBee Device Object Endpoint References Zigbee.def to fill out References Zigbee.def to fill out
some of the parameterssome of the parameters Suggestion: Compare to the Suggestion: Compare to the
myZigBee.c files found in the myZigBee.c files found in the demo programs to help demo programs to help understand how endpoints workunderstand how endpoints work
![Page 34: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/34.jpg)
How is a message formatted?How is a message formatted?
![Page 35: Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Fall 2006](https://reader036.vdocuments.net/reader036/viewer/2022062516/56649e525503460f94b47fe3/html5/thumbnails/35.jpg)