Picking the right 802.15.4/ZigBee wireless connection for your embedded design - Embedded.com

Picking the right 802.15.4/ZigBee wireless connection for your embedded design

For the embedded developers looking to add connectivity to theirdesigns, selecting the right solution is critical to success. But it isparticularly important in the case of ZigBee or any other 802.15.4wireless application, where integrating the various hardware andsoftware layers can be daunting, especially for engineers anddevelopers who are not experts in RF communication.

It requires giving careful thought to a number of issues beyond thespecifics of the protocols, such as: 1) What type of network topologybest fits the application; 2) the best 802.15.4 radio frequency for theapplication; 3) the sensitivity of the vendor's 802.15.4 radio; 4) thecompleteness and architecture of the media access controller (MAC); 5)the most appropriate multitasking framework; 5) power consumption; 6)cost; and 7) the quality of support for the application framework andprofiles for the application at hand.

In making decisions regarding these issues, though, it is importantto remember that the ZigBee standard is a superset of the 802.15.4standard (Figure 1 below). In other words, a ZigBee-certifiedapplication must conform to both the ZigBee standard and the 802.15.4standard, while an 802.15.4 application may or may not adhere to theZigBee standard. The distinction is important because the ZigBeestandard continues to evolve and some of the higher-level applicationlayers have not yet been defined.

Figure1 – 802.15.4 hardware/software solution

Choosing the right Network Topology
There are several types of network configurations that can beimplemented under the 802.15.4 and ZigBee umbrella: point-to-multipoint(star) networks, tree networks and mesh networks.

Point-to-multipoint (star) networks are used for lowcost gaming or entertainment center control. They are the simplest toimplement and require the least amount of code for setup and control.They are typically limited in the quantity of nodes and coverage.

Tree networks are used for applications such as accessor industrial control sensing. Since they allow more nodes, they cancover a larger area than point-to-multipoint networks. However, theymay suffer from latency effects that can cause critical node failureand shut the system down. Tree networks also usually need largeramounts of code to implement than multipoint systems.

Mesh networks represent the highest level of802.15.4/ZigBee configuration and require the most network level code.Mesh networks have the ability to “self heal” critical node failures,making them ideal for large building control systems or wide areasensing. But they are by far the most difficult 802.15.4/ZigBeenetworks to design and implement.

It's advisable to choose the simplest network that gets the jobdone. A one-size fits all network solution may seem like it willshorten time- to-market, but it may also be so unwieldy and expensivethat it actually delays time-to-market.

Radio Frequency: 868 MHz or 902 MHz or 2.4 GHz?
The 802.15.4 standard defines three radio frequencies, 868 MHz(available only in the EU), 902 MHz (available in the US) and 2.4 GHz(worldwide availability). The 2.4-GHz radios transmit at a data rate of250 kbps, 902-MHz radios at 40 kbps, and 868-MHz radios at 20 kbps.Sixteen 250-kbps channels are available in the 2.4GHz band versus ten40-kbps channels in the 902Mhz band and a single 20-kbps channel in the868Mhz band. (Table 1, below)


The majority of 802.15.4 radios on the market today operate in the2.4 GHz band. This unlicensed frequency is available all over theworld, so an application that requires worldwide interoperabilityshould definitely use the 2.4 GHz band.

However, 2.4 GHz radios have some disadvantages. For one, the 2.4GHzband is crowded. Bluetooth, WLAN, microwave ovens, and garage dooropeners all also operate in this unlicensed band, increasing thelikelihood of interference. There is virtually no interference in the868/902MHz bands, except for some older cordless phones and keyboardmice. The higher sensitivity (-92 dBm vs. -85 dBm) and the inherentlybetter wall penetration of the 868/902 MHz radios allow them to bespaced further apart, potentially lowering the cost of the network. Atthe same distance, lower bandwidth radios also consume less power than2.4Ghz radios due to their better sensitivity and wall penetration.

On the negative side, the 900 MHz band is not widely available inthe European Union, so it is not practical for applications that needto be interoperable between the U.S. and Europe. However, the relativeemptiness of this band in non-European geographies, combined with lowpower and high sensitivity make 900 MHz radios good candidates forindustrial or other applications that do not need globalinteroperability.

Receiver Sensitivity and Power Output
Receiver sensitivity is the minimum power, in decibels (dBm) at which aradio can reliably receive data. A large (and negative) dBm numberindicates “higher” receiver sensitivity, which allows the radios to bespaced farther apart.

The 802.15.4 standard specifies a minimum receiver sensitivity of-85 dBm for 2.4 GHz radios and -92 dBm for 900 MHz radios. All vendorsof 802.15.4 radios exceed these standards, offering radios withreceiver sensitivities that range between -90 dBm and -100 dBm.

Although 6 dBm may not seem like much, it can have an enormousimpact on the 802.15.4 radio's line-of-sight range. Improving thereceive sensitivity from -94 dBm to -100 dBm effectively doubles theline-of-sight range of the radio. For example, if a radio with -94 dBmreceive sensitivity has a 100 meter range, increasing that sensitivityby just 6 dBm, to ” 100 dBm, extends the range up to 200 meters.

Perhaps more important, higher sensitivity can reduce or eliminatethe need for expensive, power hungry, power amplifiers (PAs), therebyreducing system complexity, cost, and power consumption. For thisreason, engineers should select a radio with the highest possiblereceive sensitivity.

Another important factor that drives the range of a radio istransmit power. The higher the transmit power of a radio, the longerits range. The 802.15.4 standard requires radios to have a minimumoutput power of -3dBm, or 0.5mWatts. Radios on the market today haveoutput power of between 0 dBm (1 mWatt) and 3 dBm (2 mWatts).

As shown in Table 2 below ,both receiver sensitivity and transmit power will influence theline-of-sight range of a transmitter/receiver pair. The better thereceiver sensitivity and the higher the transmit power, the higher therange. Even in buildings, without line-of-sight connections, thecombination of high transmit power and good receiver sensitivity willimprove the robustness of radio links.


The sum of the absolute value of the receiver sensitivity and outputpower is called the “link budget ” and is related to the range ofoperation. For example, Chipcon's CC2420 2.4 GHz 802.15.4 radio hastransmit power of 0 dBm (1mWatt) and receive sensitivity of -94 dBm,while theĀ  Z-Linkradio hastransmit power of 3 dBm (2 mWatts) and receiver sensitivity of -100dBm. The Chipcon radio's link budget is 94 dBm and the Z-Linkl radiohasa link budget of 103 dBm.

Under the same conditions, if the range of the Chipcon radio were100 meters, the range of the Z-Link radio would be 280 meters.Therefore, a difference in link budget of just 9 dBm increases therange by nearly 3 times. This means that about 1/3 as many nodes wouldbe required to cover the same network area. A hypothetical network thatrequired 1,000 nodes using the radio with the lower link budget wouldonly require 357 radios using the radio with the higher link budget toobtain the same coverage.

At $10 per node, the cost of a $10,000 system falls to $3,570 usingthe radios with the higher link budget. Therefore, the link budget isan extremely important factor to consider when evaluating radios for802.15.4 or ZigBee applications. A higher link budget is better becausethe radios can be spaced farther apart, requiring fewer nodes andreducing system cost.

Media Access Controller (MAC)
The 802.15.4 media access controller (MAC) is the software thatprovides the interface between the network security layer and the802.15.4 radio. How the MAC is implemented can have a substantialeffect on system complexity, performance, power consumption, cost, andthe scalability of system features.

There is a trade-off between the “fullness” of the MAC and systemcost because a complete 802.15.4 MAC can require up to 24 KBytes ofmemory. Vendors take several approaches to keeping the size of the MACas small as possible. Some vendors optimize the MAC code to produce thesmallest memory footprint for the target controller while keeping thefull MAC feature set. Others eliminate features, such as “GuaranteedTime Slot” (GTS), that are deemed not to be critical for their targetapplications.

While this latter approach may reduce costs by allowing the use of amicrocontroller with a smaller flash memory, it can have an adverseimpact on system scalability to next generation applications. Forexample, if an application that has a MAC without GTS evolves to afuture generation that does require GTS, at least the MAC, and possiblythe entire network layer, will have to be redesigned. If it is a ZigBeeapplication, the entire design will have to be re-certified.

It may be preferable to address the code density issue by selectinga C/C++-friendly microcontroller and compiler that provide the mostcompact compiled code. For example, the compiled code for an 802.15.4application that requires 55 KBytes of flash on an 8051-basedmicrocontroller needs only 30 KBytes on an AVR-based MCU. On thecompiler side, IAR compilers are known to compile 802.15.4 code that is20% denser than the same code compiled using GCC's GNU compiler.

Cooperative versus pre-emptive multitasking
The MAC architecture and how it is integrated with the applicationsoftware also can have a significant impact on system performance.Resource scheduling is extremely important because the MAC sub-layermust share processor resources with the network layer (which providesnetwork configuration, manipulation, and message routing), and theapplication layer (which provides the intended function of the device).There are basically two approaches to scheduling: cooperativemultitasking and pre-emptive multitasking.

In cooperative multitasking, every task voluntarily cedes themicrocontroller to the next. This approach results in lower programcode size, because no complicated scheduling algorithm needs to beimplemented. In addition, there is no requirement for context switchingso there is less latency and smaller memories can be used.

The drawback of cooperative multitasking is that there is a lot of”trust” involved. Each process must regularly give processor time toother processes. A poorly designed program or a “hung” task caneffectively bring the system to a halt. Designing a system so that itavoids these pitfalls can be onerous and may result in irregular orinefficient use of system resources.

In pre-emptive multitasking, the scheduler can initiate a contextswitch to satisfy the scheduling policy's priority constraint, thuspre-empting the active task and effectively preventing a “hung” taskfrom halting the system. However, this requires a great deal more codeand introduces latencies into the system. A typical 802.15.4application will not usually need this level of protection and cangenerally go with the smaller code size and lower latency of acooperative multitasking scheme.

In short, cooperative multitasking gives the application designercontrol over scheduling while pre-emptive multitasking gives schedulingcontrol to the operating system and software stack.

IEEE 802.15.4 MAC libraries are available that provide a set ofnon-blocking functions that can be called to pass the IEEE 802.15.4 MAClayer management entity (MLME) primitives to the MAC task. Thesenon-blocking functions return the microcontroller immediately to thenext task, using a cooperative multitasking scheme.

In this approach, the higher layer task calls the lower layer taskperiodically. The higher layer passes back the IEEE 802.15.4 MLMEprimitives using a set of callback functions, which are alsonon-blocking. This ensures that the application has maximum controlover the microcontroller.

In fact, a pre-emptive task scheduler could be added to theseapplications.Another important element in selecting a MAC is to look for one with ahardware abstraction layer that is common to multiple differentcontrollers. This thin layer of the MAC will provide flexibility interms of memory density and peripheral set, as well as facilitatesystem integration.

For example, a controller node will have different peripheral andmemory requirements than an end-node. A MAC with a HAL that seamlesslysupports a wide range of controllers allows the designer to optimizethe balance between cost and feature set for each piece of the 802.15.4network.

Next in Part 2: Power consumptionand cost issues

Chris Bauman is Director of Atmel's BiCMOS Products business unit.Prior to joining the company, he held positions at Texas Instrumentsand Honeywell where he managed several Product Engineering groupssupporting non-volatile memories, ASICs and analog products.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.