lab 4 zigbee & 802.15.4 with picdem z boards 55:088 spring 2006
Post on 05-Jan-2016
236 Views
Preview:
TRANSCRIPT
Lab 4Lab 4ZigBee & 802.15.4 with ZigBee & 802.15.4 with
PICDEM Z BoardsPICDEM Z Boards55:08855:088
Spring 2006Spring 2006
Everyone has heard of Everyone has heard of 802.11…802.11…
IEEE 802.11 features:Ethernet matching speed, Long range(30-90m)Complexity to handle seamless
roamingMessage forwardingData throughput of 2-11Mbit/s
……what about 802.15?what about 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 ZigBee802.15.4 – a.k.a ZigBee
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 automation Home automation
How does ZigBee form How does ZigBee form networks?networks? Basic Type: Star NetworksBasic Type: Star Networks
How does ZigBee form How does ZigBee form networks?networks? More Complex: Cluster NetworkMore Complex: Cluster Network
How does ZigBee form How does ZigBee form networks?networks?
Very Complex: Mesh NetworksVery Complex: Mesh Networks
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
PICDEM Z BoardsPICDEM Z Boards
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)
18LF462018LF4620
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
Use the MPLAB and C18 Use the MPLAB and C18 compiler to write code for the compiler to write code for the PICPIC
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)
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
PICDEM Z with LCDPICDEM Z with LCD
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…
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”
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.31MPLAB v 7.31 C18 CompilerC18 Compiler Microchip ZigBee stack v 3.3Microchip ZigBee stack v 3.3
Look at example files:Look at example files: C:\MpZBee\Source\HCLight\C:\MpZBee\Source\HCLight\ C:\MpZBee\Source\HCRouter\C:\MpZBee\Source\HCRouter\ C:\MpZBee\Source\HCSwitchC\C:\MpZBee\Source\HCSwitchC\
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”
Zigbee.defZigbee.def
This file should be one of the first This file should be one of the first files you createfiles you create
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 to operate onFrequencies to operate on Power modePower mode Node addressNode address As well as many others…As well as many others…
Callback functionsCallback functions
In the application code that you will In the application code that you will be writing/modifying there are a few be writing/modifying there are a few required functionsrequired functions
These callback functions are named These callback functions are named because the stack calls back to the because the stack calls back to the application to gather more dataapplication to gather more data
Definitions and examples can be Definitions and examples can be found in AN965 and documentation found in AN965 and documentation on the current version of the stackon the current version of the stack
Callback function exampleCallback function example
In a coordinator node, we may In a coordinator node, we may wish to determine weather it is wish to determine weather it is okay to accept another node okay to accept another node trying to associate with the trying to associate with the network…network…
BOOL AppOkayToAcceptThisNode(LONG_ADDR *longAddr)BOOL AppOkayToAcceptThisNode(LONG_ADDR *longAddr){{
if (first three bytes of its MAC address match the coordinator)if (first three bytes of its MAC address match the coordinator)return TRUE;return TRUE;
elseelsereturn FALSE;return FALSE;
}}
top related