8/2/2019 941ZIG
1/84
2005 Microchip Technology Incorporated. All Rights Reserved. Slide 1
941 ZIG
ZigBee Protocol Hands-on
8/2/2019 941ZIG
2/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 2
Class Objectives
Provide high level familiarity with ZigBee
protocol.
Experiment with the Microchip ZigBee stackwith hands on experience.
Understand current status and future plansfor the ZigBee stack.
8/2/2019 941ZIG
3/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 3
Agenda
What is ZigBee Protocol?
ZigBee Fundamentals
Exercise 1 ZigBee Devices
ZigBee Networking
Communication over ZigBee Network
Exercise 2
Dynamic Networking Exercise 3
Hardware
Designing with ZigBee Protocol
8/2/2019 941ZIG
4/84 2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 4
What is ZigBee Protocol?:
ZigBee Alliance
The ZigBee Alliance is an association ofcompanies working together to enable
reliable, cost-effective, low-power, wirelessly
networked, monitoring and control productsbased on an open global standard.
8/2/2019 941ZIG
5/84 2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 5
What is ZigBee Protocol?:
ZigBee Focus Simplicity
Reliability Low cost
Low power
Interoperability
8/2/2019 941ZIG
6/84 2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 6
What is ZigBee Protocol?
Standard wireless network stack
Based on IEEE 802.15.4
Defined by ZigBee Alliance
Simple, flexible data transfer
Low cost (< $10, 14-28KB)
Low power (low duty cycle)
Short range network ~100m outside, line-of-site
~30m inside
8/2/2019 941ZIG
7/84 2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 7
What is ZigBee Protocol?:ZigBee Target Applications
ZigBee
Monitors Sensors Control, automation
Security Lighting HVAC
Access, closures
Remote monitors Remote meter reading
Monitors Diagnostics
RF Remotes
Portable gaming PC Peripherals
Security Lighting Appliance control, HVAC Access, closures
8/2/2019 941ZIG
8/84 2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 8
What is ZigBee Protocol?
10,000
1,000
100
10
1
1 10 100 1,000 10,000 100,000
CellularTechnologiesGSM, GPRS
CellularTechnologiesGSM, GPRS
WLAN TechnologiesIEEE802.11
WLAN TechnologiesIEEE802.11
Data Rate (kbps)
Range(meters)
ZigBeeIEEE 802.15.4
BluetoothBluetooth
ProprietaryProprietary
8/2/2019 941ZIG
9/84 2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 9
Agenda
What is ZigBee Protocol?
ZigBee Fundamentals
Exercise 1 ZigBee Devices
ZigBee Networking
Communication over ZigBee Network
Exercise 2
Dynamic Networking Exercise 3
Hardware
Designing with ZigBee Protocol
8/2/2019 941ZIG
10/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 10
ZigBee Fundamentals:
ZigBee Terminology Attribute
A single data value
A switch value (on/off)
A temperature value
A percentage The units and data type are predefined
Attribute OnOff
ON
8/2/2019 941ZIG
11/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 11
ZigBee Fundamentals:
ZigBee Terminology Cluster
A group of one or more attributes
An attribute is in only one cluster
All attributes within the cluster must be
supported
Cluster OnOffCluster
Attribute OnOff
ON
8/2/2019 941ZIG
12/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 12
ZigBee Fundamentals:
ZigBee Terminology Device Description
Description of a device that is part of a largertarget application
Contains one or more clusters
Specifies if the clusters are inputs or outputsDevice - Switch
Output Cluster OnOffCluster
Attribute OnOff
ON
8/2/2019 941ZIG
13/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 13
ZigBee Fundamentals:
ZigBee Terminology Device Profile
A collection of device descriptions for a targetapplication
Device - Light
Input Cluster OnOffCluster
Attribute OnOff
ON
Device - Switch
Output Cluster OnOffCluster
Attribute OnOff
ON
Profile Lighting Control
8/2/2019 941ZIG
14/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 14
ZigBee Fundamentals:
Terminology Quiz What is it?
Attribute
Cluster
DeviceDescription
Profile
Dimmer Switch
Initial Switch Configurations
On/Off
Light Brightness
Home Control, Lighting Complete System Status
Current Draw
Occupancy Sensor
Building Automation
8/2/2019 941ZIG
15/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 15
ZigBee Fundamentals:
ZigBee Terminology Endpoint
User-defined group of clusters, as required forimplementation of a device description
Allows implementation flexibility
Device - Switch
Endpoint EP7 (users choice)
Output Cluster OnOffCluster
Attribute OnOff
ON
Device - Light
Endpoint EP12 (users choice)
Input Cluster OnOffCluster
Attribute OnOff
ON
8/2/2019 941ZIG
16/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 16
ZigBee Fundamentals:
ZigBee Terminology Node
A group of ZigBee devices sharing a singleradio
Node
RFTransceiver
Device - Switch
Endpoint EP7 (users choice)
Output Cluster OnOffCluster
Attribute OnOff
ON
8/2/2019 941ZIG
17/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 17
ZigBee Fundamentals:
Terminology Quiz 2Device
Endpoint
Output Cluster
Input Cluster
Output Cluster
Endpoint
Device
Endpoint
Output Cluster
Input Cluster
Output Cluster
Endpoint
Node
RFTransceiver
Endpoint
Attribute
Attribute
Attribute
Attribute
Attribute
Attribute
Attribute
Attribute
Attribute
8/2/2019 941ZIG
18/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 18
ZigBee Fundamentals:ZigBee Architecture (Why Have Endpoints?)
MAC (IEEE 802.15.4)
SSP SecurityServiceProvider
PHY (IEEE 802.15.4) 2.4 GHz 868/915 MHz
Routing
Management
NWK Security
Management
NWK - Network Layer
MCPS-SAP MLME-SAP
...
APS SecurityManagement
APS MessageManagement
Application Support Sublayer (APS)
Security Mgmt.
NWK Mgmt.
Device Mgmt.
Binding Mgmt.
ZDO ZigBee Device Objects
...
APSME-SAP
Endpoint 0
APSDE-SAP
Endpoint Multiplexing
NLDE-SAP NLME-SAP
SSPInterface
PD-SAP PLME-SAP
ZDOMgmt.Plane
APSME-S
AP
NLM
E-SAP
NWK
Management
APS SecurityManagement
Application (APL) Layer
IEEE 802.15.4defined Layers
ZigBeeTM Alliancedefined Layers
ZigBeeTM Alliancedefined Profilesand/or user definedprofiles andapplication code
Layerfunction
Layerinterface
Application Framework (AFG)
ApplicationObject
Endpoint
240
ApplicationObject
Endpoint 1
Your Code Here
ZD
Op
ublicinterface
8/2/2019 941ZIG
19/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 19
ZigBee Fundamentals:
ZigBee Based Lighting ControlZigBee Alliance has defined a Home Control,Lighting profile.
In this profile, they define the following devices:
Switch Remote Control
Switching Load Controller
Dimmer Remote Control
Dimming Load ControllerOccupancy Sensor
Light Sensor Monochromatic
8/2/2019 941ZIG
20/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 20
ZigBee Fundamentals:
Home Control, Lighting The Profile defines the cluster OnOffSRC Attribute OnOff
Defined values are On=0xFF, Off=0x00, orToggle=0xF0.
For the Switch Remote Control (i.e. a switch),
ZigBee defines one mandatory output cluster OnOffSRC
For the Switching Load Controller (i.e. a light),
ZigBee defines one mandatory input cluster OnOffSRC
8/2/2019 941ZIG
21/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 21
ZigBee Fundamentals:
ZigBee Based Lighting Control
OnOff = On
OnOff = Off
OnOff = On
OnOff = Off
OnOffSRC.OnOff = Off
8/2/2019 941ZIG
22/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 22
EP9 EP5
ZigBee Fundamentals:Application Concept
EP1 EP2 EP3 EP4
Lamp Radio
Switch Radio
How do you link the correct switches and lights?
8/2/2019 941ZIG
23/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 23
EP9 EP5
ZigBee Fundamentals:Binding
EP1 EP2 EP3 EP4
Coordinator
or Router
8/2/2019 941ZIG
24/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 24
EP9 EP5
ZigBee Fundamentals:Binding
EP1 EP2 EP3 EP4
Binding Table
Coordinatoror Router
EP3, EP4EP5
EP1, EP2EP9
DestSrc
End_Device_Bind_req
Bind_req
8/2/2019 941ZIG
25/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 25
Agenda
What is ZigBee Protocol?
Foundation of ZigBee Fundamentals
Exercise 1 ZigBee Devices
ZigBee Networking
Communication over ZigBee Network Exercise 2
Dynamic Networking
Exercise 3
Hardware
Designing with ZigBee Protocol
8/2/2019 941ZIG
26/84
2005 Microchip Technology Incorporated. All Rights Reserved. Slide 26
Exercise 1
Bind your S2 switch to yourneighbors D1 LED usingEnd_Device_Bind_req
8/2/2019 941ZIG
27/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 27
Exercise 1 :Using End_Device_Bind_req
1. Agree who will be the light(s) and who will be the switch.2. Open the corresponding project and set your MAC address
in zigbee.def
3. If you are the switch, program and run your application.Make sure you start a network.
4. If you are a light, program your application. After theswitch starts the network, run your application. Make sure
you join the network and get a short address.5. When a switch and a light are ready, each press RB5
within 5 seconds of each other.6. If binding is successful, the switch can control the lights
RA1 LED with its RB4 switch.7. Repeat steps 4-7 for any other lights. Note how the switch
controls all of the lights with one button press.8. Look at how the SendEndDeviceBindReq function is set
up to send the End Device Bind request.
8/2/2019 941ZIG
28/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 28
Agenda
What is ZigBee Protocol?
ZigBee Fundamentals
Exercise 1 ZigBee Devices
ZigBee Networking
Communication over ZigBee Network Exercise 2
Dynamic Networking
Exercise 3
Hardware
Designing with ZigBee Protocol
8/2/2019 941ZIG
29/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 29
ZigBee Devices:
IEEE 802.15.4 Devices The IEEE specification defines two types of
wireless devices
Full Function Devices
Reduced Function Devices
8/2/2019 941ZIG
30/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 30
ZigBee Devices:Full Function Device
Supports majority, if not all, of the ZigBee
services Capable of peer-to-peer connection
Can allow other devices to join the network
Usually mains powered
Transceiver needs to be always on
Requires relatively large amount of programand data memory
8/2/2019 941ZIG
31/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 31
ZigBee Devices:Reduced Function Device
Supports limited ZigBee services Must join the network through an FFD May communicate only via the FFD it joined to
Can be battery powered Low duty cycle
Can keep transceiver off when idle
Requires less program and data memory
8/2/2019 941ZIG
32/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 32
ZigBee Devices
The ZigBee Specification defines three typesof devices
ZigBee Coordinator
ZigBee Router
ZigBee End Device
8/2/2019 941ZIG
33/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 33
ZigBee Devices:ZigBee Coordinator
Always a Full Function Device
Supports all ZigBee services Includes binding and routing
Capable of peer-to-peer connection Forms the network
Accepts/Rejects new network members
Mains powered
Transceiver is always on
8/2/2019 941ZIG
34/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 34
ZigBee Devices:ZigBee Router
Always a Full Function Device
Extends physical reach of the network byallowing other nodes to join the networkthrough it
Supports all ZigBee services Includes binding and routing
Capable of peer-to-peer connection
Mains powered
Transceiver is always on
Zi B D i
8/2/2019 941ZIG
35/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 35
ZigBee Devices:ZigBee End Device
Usually a Reduced Function Device
Can be a Full Function Device Supports some ZigBee services
Does not include binding and routing
Can communicate only with its parent node
Can be battery powered
Transceiver can be off when idle
8/2/2019 941ZIG
36/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 36
Agenda
What is ZigBee Protocol?
ZigBee Fundamentals
Exercise 1 ZigBee Devices
ZigBee Networking
Communication over ZigBee Network Exercise 2
Dynamic Networking
Exercise 3
Hardware
Designing with ZigBee Protocol
ZigBee Networking:
8/2/2019 941ZIG
37/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 37
ZigBee Networking:
Star Network
Reduced Function Device (RFD)Full Function Device (FFD)ZigBee Coordinator (FFD)
ZigBee Router (FFD)
Rx must always be on so
typically mains powered
typically battery powered
Zi B N t ki
8/2/2019 941ZIG
38/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 38
ZigBee Networking:Star Network
Reduced Function Device (RFD)Full Function Device (FFD)ZigBee Coordinator (FFD)
ZigBee Router (FFD)
ZigBee Networking
8/2/2019 941ZIG
39/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 39
ZigBee Networking:Tree (Cluster) Network
Reduced Function Device (RFD)Full Function Device (FFD)ZigBee Coordinator (FFD)
ZigBee Router (FFD)
Rx must always be on so
typically mains powered
typically battery powered
ZigBee Networking:
8/2/2019 941ZIG
40/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 40
ZigBee Networking:Tree (Cluster) Network
Reduced Function Device (RFD)Full Function Device (FFD)ZigBee Coordinator (FFD)
ZigBee Router (FFD)
ZigBee Networking:
8/2/2019 941ZIG
41/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 41
ZigBee Networking:Mesh (Peer-to-Peer) Network
Reduced Function Device (RFD)Full Function Device (FFD)ZigBee Coordinator (FFD)
ZigBee Router (FFD)
Rx must always be on so
typically mains powered
typically battery powered
ZigBee Networking:
8/2/2019 941ZIG
42/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 42
ZigBee Networking:Mesh (Peer-to-Peer) Network
Reduced Function Device (RFD)Full Function Device (FFD)ZigBee Coordinator (FFD)
ZigBee Router (FFD)
ZigBee Networking:
8/2/2019 941ZIG
43/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 43
ZigBee Networking:Mesh (Peer-to-Peer) Network
Reduced Function Device (RFD)Full Function Device (FFD)ZigBee Coordinator (FFD)
ZigBee Router (FFD)
8/2/2019 941ZIG
44/84
Q i
8/2/2019 941ZIG
45/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 45
Quiz
What is an attribute?
What is a cluster?
What is an endpoint?
How do FFDs and RFDs differ?
When would you chose an RFD over anFFD?
I want to develop a wireless controller for avideo game system. What topology wouldyou chose?
A d
8/2/2019 941ZIG
46/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 46
Agenda
What is ZigBee Protocol?
ZigBee Fundamentals
Exercise 1 ZigBee Devices
ZigBee Networking
Communication over ZigBee Network Exercise 2
Dynamic Networking
Exercise 3
Hardware
Designing with ZigBee Protocol
Communication over ZigBee Network:
8/2/2019 941ZIG
47/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 47
Communication over ZigBee Network:Addressing Devices
Broadcast
Address 0xFFFF Everyone in radio distance receives the packet.
Packet gets retransmitted until everyone gets
the packet or it times out Unicast
Uses the 16-bit address of the destination Only that devices radio will get the packet (all
others will filter the packet out)
C i ti Zi B N t k
8/2/2019 941ZIG
48/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 48
Communication over ZigBee Network
Key-Value Pair (KVP)
Key Cluster/Attribute
Value Data value of the attribute
KVP Commands
Set set an attribute Get get an attribute
Event an event has occurred
Message (MSG)
Free format data transfer
Communication over ZigBee Network:
8/2/2019 941ZIG
49/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 49
Communication over ZigBee Network:Key-Value Pair Frame Format
Cluster: OnOffSRCAttribute: OnOff
Command: SETValue: Off
Communication over ZigBee Network:
8/2/2019 941ZIG
50/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 50
Communication over ZigBee Network:Message Frame Format
Supports straight binary data transfer
Proprietary data transfer
Data size limited by IEEE frame size andZigBee overhead
Cluster: MSG_ClusterValues: [multiple]
Agenda
8/2/2019 941ZIG
51/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 51
Agenda
What is ZigBee Protocol?
ZigBee Fundamentals
Exercise 1 ZigBee Devices
ZigBee Networking
Communication over ZigBee Network Exercise 2
Dynamic Networking
Exercise 3
Hardware
Designing with ZigBee Protocol
8/2/2019 941ZIG
52/84
2005 Microchip Technology Incorporated. All Rights Reserved. Slide 52
Exercise 2
Constructing and Sending KVP
Frames
Exercise 2
8/2/2019 941ZIG
53/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 53
Exercise 2
Notes Change your MAC address in zigbee.def
Examine the profile definition filezMASTERS05Profile.h in the Stackdirectory
Send a KVP message to the coordinator A message will appear on the main screen
Bonus What other functions are available in the
profile?
Agenda
8/2/2019 941ZIG
54/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 54
Agenda
What is ZigBee Protocol? ZigBee Fundamentals
Exercise 1 ZigBee Devices
ZigBee Networking
Communication over ZigBee Network Exercise 2
Dynamic Networking
Exercise 3
Hardware
Designing with ZigBee Protocol
Dynamic networking
8/2/2019 941ZIG
55/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 55
Dynamic networking
What we know The different types of nodes available.
What the different network topologies look likeand what they are good for.
How to send messages to other devices on the
network What is left?
How does a device join a network?
How do we determine who is out there on thenetwork to talk to?
What happens when a node in the network fails?
Dynamic Networking:J i i N t k
8/2/2019 941ZIG
56/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 56
Joining a Network
Send a Beacon request
ZigBee Routers and ZigBee Coordinators in the
area that support joining will respond Pick one to join to and send that device an
association request
ZigBee Router or ZigBee Coordinator respondswith an association response
If the response is Denied, try to connect to adifferent network or keep polling the samenetwork to wait for an opening.
Dynamic Networking:R j i i
8/2/2019 941ZIG
57/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 57
Rejoining
Send out orphan request
If your former parent is still out there and hears you,
then they will respond with a coordinator realignment Bindings will be retained
If orphan request goes unanswered you can either
Continue searching for the same parent Give up and join the network as if you were a new node
Will get a new 16-bit network address
Bindings will need to be recreated
Dynamic Networking:Q i th N t k
8/2/2019 941ZIG
58/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 58
Querying the Network
ZigBee Device Profile
Built-in ZigBee Functions
Interface through Endpoint 0
Service Discovery
Allows us to find out what the other devices do Device Discovery
Allows us to locate other devices on thenetwork
Dynamic Networking:Descriptors
8/2/2019 941ZIG
59/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 59
Descriptors
Node Descriptor
Type of Node and capabilities
Node Power Descriptor
Node Power Characteristics
Simple Descriptor Describe the applications endpoints
Dynamic Networking:Node Descriptor
8/2/2019 941ZIG
60/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 60
Node Descriptor
Mandatory, one per node
Identifies device type
ZigBee Coordinator, ZigBee Router,End Device
Frequency band of operation
Security capabilities
Power Source
If the receiver is on when Idle Buffer size
I am:
An end device
2.4 GHz
Level 6 security
Battery powered
My Rx is off whenI am Idle
My buffer is 128bytes
Dynamic Networking:Node Power Descriptor
8/2/2019 941ZIG
61/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 61
Node Power Descriptor
Mandatory, one per node
Describes power capabilities in detail
How the is receiver switched on
Permanently, Periodically, or When stimulated
Available power sources
Current power source Current charge status
Dynamic Networking:Simple Descriptor
8/2/2019 941ZIG
62/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 62
Simple Descriptor Mandatory for each endpoint
Describes the endpoint
Endpoint number Application Profile ID, from the ZigBee Alliance
Application Device ID, from the ZigBee Alliance
Application Device Version, from the ZigBee Alliance Application Flags
Endpoint Input Cluster Count
Endpoint Input Cluster List Endpoint Output Cluster Count
Endpoint Output Cluster List
I have:
An endpoint 8
EP8 has one
output cluster ofOnOffSRC
8/2/2019 941ZIG
63/84
Dynamic Networking:Service Discovery
8/2/2019 941ZIG
64/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 64
Service Discovery
Match_Desc_req
Requests a check of all active Endpoints to see if onematches a given Profile ID
Match can optionally require a match of input or outputclusters
Match_Desc_req:
HCL profile, Out-Cluster ofOnOffSRC
My Endpoint 3
matches
My Endpoints 5and 23 match
Now I know of 3 switches that
I can decide to bind to!!
No Endpointsmatch; noresponse
Dynamic Networking:Device Discovery
8/2/2019 941ZIG
65/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 65
Device Discovery
NWK_Addr_req
Broadcast inquiry for a Devices 16-bit network addressbased on its 64-bit IEEE address
Response can optionally also include the 16-bitaddresses of all of the nodes that are associated to thatnode.
NWK_Addr_req I am looking for IEEE:
00-46-00-A1-00-23-44-31
Thats me. My Networkaddress is 0x9241
Dynamic Networking:Device Discovery
8/2/2019 941ZIG
66/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 66
Device Discovery
IEEE_Addr_req
Unicast inquiry for a Devices 64-bit IEEE addressbased on its 16-bit network address
Response can optionally also include the 16-bitaddresses of all of the nodes that are associated tothat node.
D CA
BA: 0x9136
B: 0x9134
C: 0x9443D: 0x0000
B: 0xAA23???
Dynamic Networking:Device Discovery
8/2/2019 941ZIG
67/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 67
Device Discovery
IEEE_Addr_req
Unicast inquiry for a Devices 64-bit IEEE addressbased on its 16-bit network address
Response can optionally also include the 16-bitaddresses of all of the nodes that are associated tothat node.
D CA
B
A: 0x9136
B: 0x9134
C: 0x9443D: 0x0000
B: 0xAA23IEEE_Addr_req: 0x9134,What is your IEEE address?
I am IEEE: 00-46-00-A1-00-23-44-31
Thats me.My Networkaddress is0xAA23
NWK_Addr_req
I am looking for IEEE:
00-46-00-A1-00-23-44-31
Agenda
8/2/2019 941ZIG
68/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 68
What is ZigBee Protocol? ZigBee Fundamentals
Exercise 1
ZigBee Devices
ZigBee Networking
Communication over ZigBee Network Exercise 2
Dynamic Networking
Exercise 3 Hardware
Designing with ZigBee Protocol
8/2/2019 941ZIG
69/84
2005 Microchip Technology Incorporated. All Rights Reserved. Slide 69
Exercise 3 - An Introductionto Peer-to-Peer
Use Device Discovery services tosend LED messages directly to
your partner
Exercise 3
8/2/2019 941ZIG
70/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 70
In zigbee.def set Your MAC address
Receiver always on InMasters05Lab3.c, construct the Device
Discovery message
Use the 64-bit address of your partners node
Press RB5 to get your partners 16-bit
network address Press RB4 to control your partners LED
Agenda
8/2/2019 941ZIG
71/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 71
What is ZigBee Protocol? ZigBee Fundamentals
Exercise 1
ZigBee Devices
ZigBee Networking
Communication over ZigBee Network Exercise 2
Dynamic Networking
Exercise 3 Hardware
Designing with ZigBee Protocol
Hardware:Typical ZigBee Hardware
8/2/2019 941ZIG
72/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 72
yp g
SPIRF
XCVR
ANTENNA
Trace,Monopole etc.
Microchip
PICmicro
MCU
Hardware:Block Diagram
8/2/2019 941ZIG
73/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 73
APLAPL
Tx chainTx chain
Rx chainRx chain
Bias/VCOBias/VCO
SiliconSiliconZigBee
Stack
ZigBee
StackApplicationApplication
SecuritySecurity
NWKAPS
NWKNWK
APSAPSMAC
(Firmware)
MAC
MAC
(Firmw
are)
(Firmw
are)
MAC
(Hardware)
MAC
(Hardw
are)
Logic
Logic
Application
Microchip Device802.15.4 Transceiver
g
Hardware:IEEE 802.15.4
8/2/2019 941ZIG
74/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 74
LR-WPAN Low Rate Wireless Personal Area Network
Reliable data transfer
Fully acknowledged protocol
64-bit long/16-bit short addresses, 16-bit Personal AreaNetwork (PAN) ID
BAND COVERAGE DATA RATE # OF CHANNEL(S)
2.4 GHz ISM Worldwide 250 kbps 16
868 MHz Europe 20 kbps 1
915 MHz ISM Americas 40 kbps 10
Agenda
8/2/2019 941ZIG
75/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 75
What is ZigBee Protocol? ZigBee Fundamentals
Exercise 1
ZigBee Devices
ZigBee Networking
Communication over ZigBee Network Exercise 2
Dynamic Networking
Exercise 3 Hardware
Designing with ZigBee Protocol
Designing with ZigBee Protocol:IEEE 802.15.4 MAC Address
8/2/2019 941ZIG
76/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 76
Extended Address: 64-bit
Short Address: 16-bit
To reduce message length overhead IEEE Extended Unique Identifier - EUI-64TM
64-bit globally unique identification value
Upper 32-bit assigned by IEEE as your OrganizationallyUnique Identifier (OUI)
Lower 32-bit assigned by organization (~4 billion
devices on one EUI) $1650 one time fee for OUI
May use your Ethernet OUI
Designing with ZigBee Protocol:State of ZigBee
8/2/2019 941ZIG
77/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 77
Version 1.0 of ZigBee Standards Complete
Downloadable by ZigBee Alliance members andadopters
Fee to become a ZigBee adopter is $3500/yr
www.zigbee.org/en/join
600+ pages
Most sections have errata
Version 1.1 spec coming?
IEEE 802.15.4 spec available online http://standards.ieee.org/getieee802/download/802.15.4-2003.pdf
600+ pages
Designing with ZigBee Protocol
8/2/2019 941ZIG
78/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 78
Purchase an IEEE OUI https://standards.ieee.org/regauth/oui/forms/OUI-form.shtml
Determine radio based on data rate andgeographical market needs
Select suitable Microchip MCU
Modify stack provided with AN965 for yourapplication
Do all RF compliance certifications
Do ZigBee interoperability compliancecertification
Designing with ZigBee Protocol:Microchip ZigBee Stack
8/2/2019 941ZIG
79/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 79
Based on v1.0 of ZigBee Specifications
Freely available as Microchip Application
Note AN965 Must accept Electronic License Agreement
Out-of-box support for MCC18
Support for 2.4 GHz radio
Support for RFDs and FFDs (ZigBee
Coordinators, ZigBee Routers, and FFDs asend devices)
www.microchip.com/zigbee
Designing with ZigBee Protocol:Microchip ZigBee Stack
8/2/2019 941ZIG
80/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 80
Modular design
Cooperative Multitasking Architecture
Application Independent
RTOS Independent
Supports PIC18 microcontrollers
Standard Microchip technical support
Updates for enhancements, improvements,and fixes
Designing with ZigBee Protocol:Microchip ZigBee Stack Future Releases
8/2/2019 941ZIG
81/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 81
Support for 915/868 MHz radio
Security support
Support for other MCU families (PIC24,dsPICdigital signal controllers)
HI-TECH support
Summary
8/2/2019 941ZIG
82/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 82
Provide high level familiarity with ZigBeeprotocol RFDs, FFDs, Network Topologies, Bindings,
Attributes, Clusters, Profiles, Descriptors, Radiofrequencies, Endpoints, Devices, ZigBeeCoordinators, ZigBee Routers, ...
Experiment with the Microchip ZigBee stack Compiling and using the Microchip ZigBee
stack Creating a network Creating bindings
Understand current status and future plansfor the ZigBee stack
References
8/2/2019 941ZIG
83/84
2005 Microchip Technology Incorporated. All Rights Reserved. Class Slide 83
IEEE 802.15.4-2003 http://standards.ieee.org/getieee802/download/802.15.4-2003.pdf
ZigBee v1.0 specification AN965 - ZigBee application note available at
www.microchip.com/zigbee
8/2/2019 941ZIG
84/84
Recommended