220 likes | 246 Views
Lab 4 ZigBee & 802.15.4 with PICDEM Z Boards. 55:088 Spring 2006. Everyone has heard of 802.11…. IEEE 802.11 features: Ethernet matching speed, Long range(30-90m) Complexity to handle seamless roaming Message forwarding Data throughput of 2-11Mbit/s. …what about 802.15?.
E N D
Lab 4ZigBee & 802.15.4 with PICDEM Z Boards 55:088 Spring 2006
Everyone has heard of 802.11… • IEEE 802.11 features: • Ethernet matching speed, • Long range(30-90m) • Complexity to handle seamless roaming • Message forwarding • Data throughput of 2-11Mbit/s
…what about 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
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
How does ZigBee form networks? Basic Type: Star Networks
How does ZigBee form networks? More Complex: Cluster Network
How does ZigBee form networks? Very Complex: Mesh Networks
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 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)
18LF4620 • Microcontroller found with the PICDEM Z kits • Overall, very similar to the 18F452 • Use the MPLAB and C18 compiler to write code for the PIC
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 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 • Use whatever language you wish to create the GUI…
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”
Tools that you will use… In order to utilize the stack: MPLAB v 7.31 C18 Compiler Microchip ZigBee stack v 3.3 Look at example files: C:\MpZBee\Source\HCLight\ C:\MpZBee\Source\HCRouter\ C:\MpZBee\Source\HCSwitchC\ 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”
Zigbee.def • This file should be one of the first files you create • It selects many key parameters that will define how a particular node will operate: • Specify Coordinator, Router, or End Device • Frequencies to operate on • Power mode • Node address • As well as many others…
Callback functions • In the application code that you will be writing/modifying there are a few required functions • These callback functions are named because the stack calls back to the application to gather more data • Definitions and examples can be found in AN965 and documentation on the current version of the stack
Callback function example • In a coordinator node, we may wish to determine weather it is okay to accept another node trying to associate with the network… • BOOL AppOkayToAcceptThisNode(LONG_ADDR *longAddr) { if (first three bytes of its MAC address match the coordinator) return TRUE; else return FALSE; }