Post on 12-Apr-2017
transcript
The Application of Low-Power Wireless
Networks to Wide-Area Distributed
Audio Systems
A dissertation submitted to The University of Manchester for
the degree of Master of Science in the Faculty of Engineering
and Physical Sciences
2009
Flavio Felici
School of Electrical and Electronic Engineering
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 1
List of Contents
List of Figures .................................................................................................................... 3
List of Tables ..................................................................................................................... 5
Abstract ............................................................................................................................. 5
Declaration ........................................................................................................................ 6
Copyright Statement .......................................................................................................... 6
Acknowledgment ............................................................................................................... 7
Chapter 1 ........................................................................................................................... 8
Introduction ....................................................................................................................... 8
1.1 Sound Masking Overview and Project Aim .............................................................. 8
1.2 Structure of Dissertation ......................................................................................... 12
1.3 Achievements ......................................................................................................... 13
Chapter 2 ......................................................................................................................... 14
Technical Requirements of a Typical Sound Masking System .......................................... 14
2.1 Frequency of Operation .......................................................................................... 14
2.2 Range and Network layout ..................................................................................... 15
2.3 Data Rate ............................................................................................................... 16
2.4 Wireless Coexistence ............................................................................................. 17
Chapter 3 ......................................................................................................................... 18
Review of Communication in the ISM Band .................................................................... 18
3.1 Wireless Transmission in the Unlicensed Band....................................................... 18
3.2 ISM Band selection ................................................................................................ 20
3.2.1 The 2.4 and 5.8 GHz ISM Bands ..................................................................... 20
3.3 Comparison between wireless standards in the 2.4GHz ISM band .......................... 21
3.3.2 IEEE 802.15.1 – The Bluetooth Standard......................................................... 23
3.3.3 IEEE 802.15.4-2006 – The ZigBee Standard ................................................... 24
3.3.4 Texas Instruments SimpliciTI .......................................................................... 24
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 2
3.4 2.4 GHz ISM Band Survey .................................................................................... 26
3.5 Custom Built Protocol ............................................................................................ 27
3.6 Additional Requirements for FHSS systems in the 2.4 GHz ISM band ................... 27
Chapter 4 ......................................................................................................................... 29
System Design ................................................................................................................. 29
4.1 High Level Design ................................................................................................. 29
4.2 Hardware Component Selection ............................................................................. 31
4.2.1. Microcontroller ............................................................................................... 31
4.2.2 Transceiver ...................................................................................................... 33
4.3 Hardware Assembly and Testing ............................................................................ 35
4.4 Software Design ..................................................................................................... 44
4.4.1 Software Environment ..................................................................................... 44
4.4.2 SPI Interface and Transceiver Configuration.................................................... 46
Chapter 5 ......................................................................................................................... 52
Development of a FHSS MAC Layer Protocol ................................................................. 52
5.1 Basic Functions ...................................................................................................... 52
5.2 Output Functions .................................................................................................... 61
5.3 Configuring the Transceiver ................................................................................... 63
5.4 Fixed Frequency Transmission ............................................................................... 68
5.5 Frequency Hopping System .................................................................................... 71
5.6 Adaptive Frequency Hopping System ..................................................................... 75
5.7 Variable Base Adaptive Frequency Hopping System .............................................. 77
5.8 Network Setup ....................................................................................................... 80
5.9 Variable Base Adaptive Fast Frequency Hopping System ....................................... 81
Chapter 6 ......................................................................................................................... 85
System Testing and Performance ..................................................................................... 85
6.1 Range Test ............................................................................................................. 85
6.2 Variable Base Adaptive FHSS System Test ............................................................ 87
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 3
Chapter 7 ......................................................................................................................... 94
Conclusions and Further Work ......................................................................................... 94
References ....................................................................................................................... 96
Appendix A ................................................................................................................... 102
Source Code .................................................................................................................. 102
SPIc ........................................................................................................................... 102
Fast Hopping RF.c ..................................................................................................... 111
Appendix B.................................................................................................................... 120
Feasibility Study ............................................................................................................ 120
Appendix C.................................................................................................................... 144
Datasheets Front Sheets ................................................................................................. 144
List of Figures
Figure 1.1 Sound Masking System installed under the office ceiling tile1............................8
Figure 1.2 Wireless transmission system applied to a network node....................................9
Figure 1.3 Frequency Hopping terminology4 ......................................................................11
FIGURE 2.1:NETWORK SETUP6..............................................................................................14
Figure 2.2: Traffic patterns in a typical sound masking system7.........................................15
Figure 2.2: Traffic patterns in a typical sound masking system7 ........................................16
Figure 3.1: Wi-Fi Channels in the 2.4 GHz ISM band29
......................................................23
Figure 3.2: Spectrum Survey of the 2.4 GHz ISM Band.....................................................27
Figure 4.1 Wireless board and its main components...........................................................31
Figure 4.2 PIC32MX360F512L main features42
.................................................................34
Figure 4.3 Overview of External Components....................................................................37
Figure 4.4 Microchip Explorer 16 Development Board47
...................................................38
Figure 4.5 Quasar CC2500 module48
...................................................................................39
Figure 4.6 Texas Instruments 2.4 GHz Inverted F Antenna78
..............................................40
Figure 4.7 Pictail connector pinout49
....................................................................................41
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 4
Figure 4.8 Quasar CC2500 module pinout50
.......................................................................43
Figure 4.9 (left) Soldering the glued female connector ......................................................44
Figure 4.10 (right) Plugging the CC2500 module in the glued female connector.............44
Figure 4.11 The breadboard inserted into the Pictail connector .........................................44
Figure 4.12 PIC32 Starter Kit52
(bottom view)....................................................................45
Figure 4.13 I/O Expansion Board with the Pictail connector53
...........................................................45
Figure 4.14 All the hardware assembled and tested, ready to be programmed..................46
Figure 4.15 4-Wire SPI Interface55
......................................................................................48
Figure 4.16 CC2500 Address Header56
...............................................................................48
Figure 4.17 Single Byte Access: register writing (top) and reading (bottom)57
............... 49
Figure 4.18 SPI Clock Phase and Polarity55
.........................................................................49
Figure 4.19 Configuration registers overview59
...................................................................50
Figure 4.20 Complete Radio Control State Diagram60
.........................................................52
Figure 5.1 Command Strobes list61
......................................................................................56
Figure 5.2 SPI Module Block Diagram68
.............................................................................60
Figure 5.3 Read and Write SPI operation sampled with a logic analyzer...........................62
Figure 5.4 State transition timing70
......................................................................................63
Figure 5.5 Hyperterminal screenshot while calling different output functions..................66
Figure 5.6 Packet Size options71
..........................................................................................68
Figure 5.7 Packet Format72
..................................................................................................69
Figure 5.8 PATABLE Schematic view75
.............................................................................74
Figure 5.9 Available output power levels75
..........................................................................74
Figure 5.10 Variable Base Adaptive Frequency Hopping System program flow...............82
Figure 5.11 Variable Base Adaptive Frequency Hopping System program flow...............87
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 5
List of Tables
Table 3.1 Unlicensed Bands in the UK21
.............................................................................20
Table 3.2: Network protocols characteristics40
....................................................................26
Table 4.1Product comparison guide for the 2.4 GHz ISM band44
.......................................36
Table 4.2 PIN connection list...............................................................................................43
Table 6.1 Test Results....................................................................................................... ...88
Table 6.2 Test Results..........................................................................................................89
Table 6.3 Test Results....................................................................................................... ...90
Table 6.4 Test Results..........................................................................................................91
Table 6.5 Test Results....................................................................................................... ...92
Table 6.6 Test Results..........................................................................................................93
Table 6.7 Test Results....................................................................................................... ...94
Abstract
The 2.4-2.4835 GHz ISM band has become very popular for home, office, and industrial
wireless systems. This band is shared by a vast variety of different applications and
protocols, making coexistence and interference a key issue.
The purpose of this paper is to design and develop a low-cost wireless MAC layer capable
of operating in the 2.4 GHz ISM band, coexisting with other common wireless standards.
To avoid interference and not to collide with other wireless transmissions, the Frequency
Hopping Spread Spectrum technique is used in this custom built network protocol.
The developed wireless protocol is especially designed to interconnect a network of nodes,
which are part of a sound masking system.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 6
At the end of the project period a FHSS system was developed, able to avoid interference
and coexist with the major wireless standards in the 2.4 GHz ISM band. This paper shows
the key challenges and all the steps involved in developing such system.
Declaration
The writer declares that no portion of the work referred to in the dissertation has been
submitted in support of an application for another degree or qualification of this or any
other university or other institute of learning.
Copyright Statement
Copyright in text of this dissertation rests with the author. Copies (by any process) either in
full, or of extracts, may be made only in accordance with instructions given by the author.
Details may be obtained from the appropriate Graduate Office. This page must form part of
any such copies made. Further copies (by any process) of copies made in accordance with
such instructions may not be made without the permission (in writing) of the author.
The ownership of any intellectual property rights which may be described in this
dissertation is vested in the University of Manchester, subject to any prior agreement to the
contrary, and may not be made available for use by third parties without the written
permission of the University, which will prescribe the terms and conditions of any such
agreement.
Further information on the conditions under which disclosures and exploitation may take
place is available from the Head of the School of Electrical and Electronic Engineering.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 7
Acknowledgment
I would like to thank Mr. R. Green for giving me the opportunity to take part in this
project; his highly competent teaching skills have made these past few months a very steep
learning curve, introducing me to the aspects involved in developing a wireless system.
I also take this opportunity to thank Dr. R. Brassington for his technical advices during
project development and Anand for sharing his practical experience with me.
I am indebted to my family for always being there and for giving me emotional and
financial support.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 8
Chapter 1
Introduction
1.1 Sound Masking Overview and Project Aim
Sound masking is the process of artificially creating a sound in order to smother an
unwanted noise. This technique, especially effective in enclosed spaces, is achieved by
arranging a network of sensors and loudspeakers that constantly survey the environment
for any unwanted sound. If a noise source is detected, the network of loudspeakers
dynamically emit a smothering sound wave that covers up the noise, reducing the noise
impact on the people nearby.
If for example an intermittent noise is present in a room, the occupants of that room will
constantly perceive that noise and will repeatedly be disturbed. If instead a sound masking
system is installed in that same room, the system sensors will detect the noise source and
compensate it by constantly emitting (from its loudspeakers array) an especially
engineered sound wave, effectively reducing the noise awareness by the room occupants.
Such a system increases people‟s concentration and attentiveness by reducing noise
consciousness and distractions from the nearby environment.
For this reason, sound masking technology is often used in places like open plan offices or
meeting halls, since fitting an enclosed space with this kind of system improves
productivity and efficiency. Furthermore, the system loudspeakers can be used to broadcast
messages in the area or can be used for paging. Most of the time these systems installed
above the ceiling tile, making them invisible to the people beneath them.
Figure 1.1 shows a typical sound masking system installed in a working environment.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 9
Figure 1.1 Sound Masking System installed under the office ceiling tile1
Sound masking is not to be confused with active noise control: in fact, sound masking
systems reduce noise awareness by covering pre-existing noises up with special sound
patterns, while active noise control systems tend to cancel noises by re emitting the noise
sound wave with an opposite phase, ideally deleting the original noise. The latter technique
is more effective in reducing noise perception when the noise pattern is unique and both
the noise source and the listener are in a constant and known position- for example, active
noise control is an effective way to remove the rotor noise from a helicopter pilot‟s
headphones. Consequently to improve productivity, concentration and speech privacy in
work and public environments sound masking systems represent the best choice and are
widely used.
Embedded System Projects2 is an audio systems company based in Manchester, England. It
develops and produces a range of products focused on acoustics and digital signal
processing. The company also produces a sound masking system which consists of a
network of digital signal processing boards each coupled with a sound sensor and a
loudspeaker, all forming an independent network node.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 10
In order to achieve a coherent and effective sound masking effect each network node has
to be connected and be able to communicate with the rest of the network. This ensures that
the information about the environment is shared among all the network nodes and enables
the digital signal processing boards to generate an efficient smothering sound, where and
when needed.
The company present-day sound masking system implements a wired connection between
the network nodes. This ensures a safe and reliable connection, however such a wired link
makes the system installation costs even higher than the system itself and limits the
flexibility of arranging the nodes where most needed. In fact, to ensure the best system
performances, each node has to be strategically placed in the room -this is not always
possible if a wired connection is used, especially if the installation takes place in historical
buildings. Moreover, the average system requires several dozens of nodes, each few meters
apart and the wire connecting all of them can become very expensive and time consuming.
As a result, the aim of this project is to develop a board that can be attached to existing
sound masking systems, adding wireless communication capability. Each signal processing
board will be connected with a wireless board, forming a wireless network. Consequently,
adding a wireless device to each node will eliminate the need for expensive and bulky
wired connection.
Using a wireless link to connect each network node will improve the overall sound
masking performance, allowing a more flexible and more efficient, node positioning; and
above all, it will greatly reduce
installation costs.
Such a wireless transmission system is
meant to provide the same link quality
and reliability offered by the wire
connection, ensuring a constant linkage
between all the system units.
To accomplish the drastic installation cost
reduction, the wireless system has to
operate within a frequency range where no
license is required to transmit; To achieve this, it will have to operate within a license free
Figure 1.2 Wireless transmission system applied to a
network node
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 11
frequency range -therefore coexist and not interfere with a wide variety of different devices
and protocols that crowd the license free spectrum.
One of the main challenges of this project is to develop a low cost transmission system
able to establish a wireless link using frequencies shared by a vast number of popular
standards such as local area networks, cordless phones, personal area networks, alarm
systems and so on.
To achieve this result, a special communication technique called Frequency Hopping
Spread Spectrum3 (also known as FHSS) is used. This method, initially developed for
military applications, allows wireless communication even in presence of strong
electromagnetic interference and avoids jammed frequencies.
In particular, with this technique the sender transmits information over a particular
frequency for a certain amount of time, then hops to another carrier and start transmitting
on that frequency until it hops to another one, and so on. The time spent transmitting on
each frequency is called dwell time, while the time that lapses between hops is called blank
time. The shorter the dwell time is, the faster the hopping rate will be; and the shorter the
blank time, the more efficient the system is, as less time is spent without data transmission.
Often the carrier frequency pattern used is pseudo-random, which makes very hard for an
unauthorized person to intercept data, as the frequency of transmission is unknown.
However, one of the main challenges for a FHSS system is synchronization: in fact, to
ensure constant communication between sender and receiver, both must be tuned in the
same frequency at the exact same time –which is particularly hard when the frequency
pattern used by the transmitter is random.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 12
Figure 1.3 Frequency Hopping terminology4
Such a method, even if developed by the military to avoid data interception, is ideal for
civilian application where the need to coexist with other wireless standards in the area
rises. As matter of fact, as FHSS can constantly use different carrier frequencies, it avoids
busy channels, thus permitting a reliable wireless link even in those electromagnetically
crowded bands.
1.2 Structure of Dissertation
This paper is divided into chapters that reflect the project development timeline. Firstly, in
chapter 2, the project technical requirements dictated by the requesting company are listed.
These requirements impose specific choices for both the hardware component selection
and software structure. Chapter 3 analyzes what is probably the main property of a wireless
system: the frequency of operation. Various aspects, including the need of a license free
transmission and antenna dimensions, determine the frequency choice. This choice, in its
turn, has consequent repercussions in all the project development.
Such aspects are discussed in chapter 4, where the whole system in analyzed in its main
functionalities, from a system high-level point of view. Chapter 4 also focuses on the
hardware components that make up the transmission system, with some aspects of the
hardware testing that was involved after the hardware assembly.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 13
Moreover, this chapter exposes the high-level software design, explaining what the
software main tasks will be.
A more detailed explanation of the software implementation is given in chapter 5, in which
all the steps involved in building the system software are analyzed in deep.
In fact, given the complexity of the project, to achieve the requested aim and requirements
the main task was divided in subsequent phases. Each phase represent a key step toward
the main task accomplishment.
The developed system is tested over chapter 6, where all different system parameters are
discussed to achieve better performances.
Lastly, chapter 7 discusses the conclusions and gives propositions for further work on the
whole system.
1.3 Achievements
The results achieved during the development of this project are:
Peer to peer FHSS link with error detection system
Scan of signal strength in the entire 2.4 GHz ISM spectrum
Adaptive FHSS transmission system with network addresses
These results comply with the system requirements given at the start of the project.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 14
Chapter 2
Technical Requirements of a Typical Sound
Masking System
Key aspects for every wireless transmission system are frequency of operation, range,
throughput and link reliability. Embedded System Projects has produced a list of
requirements that the transmission system has to fulfil in order to make the sound masking
system work efficiently and reducing both production and installation costs.
2.1 Frequency of Operation
The wireless transmission system must be able to operate within an unlicensed spectrum
common in the UK, Europe, USA and Japan. In addition, the transmission system must use
transmission power, a modulation scheme and a data rate compatible with the above-
mentioned country regulations. In these countries, many companies are interested in
increasing efficiency and production in offices and work environments, hence those
nations represent the main market for sound masking technology.
Operating within an unlicensed spectrum increases flexibility and reduces costs because
transmitting in those frequencies does not require obtaining a license. However, such
frequencies tend to get always more and more electromagnetically crowded making
interference a major issue.
A requirement such as this deeply affects the hardware components selection, especially
the transceiver choice. As a matter of fact, it is the transceiver that will synthesize the
operation frequency, regulate the output power and apply a modulation scheme on the
carrier.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 15
2.2 Range and Network layout
The range for each network node must be adequate for effectively reaching every element
of the sub network that node is in. In fact, the whole sound masking network will be
divided into smaller sub networks, each positioned in an environment with particular
acoustic properties. The system works if every element in each sub network is able to
communicate with all the rest of the nodes making up that sub network. In addition, a
„master node‟, which is shared by two or more sub networks, grants communication
between different sub networks. In a typical sound masking system, each sub network is
formed by around 50 nodes5; each about 10 meters apart. Figure 2.1 shows a typical
network layout.
The requirements imposed for the communication range also have an effect on the
hardware components selection. As a matter of fact, both the transmission power and the
antenna type must comply with those requirements.
Figure 2.1: Network Setup6
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 16
2.3 Data Rate
To ensure an effective and successful sound masking action the nodes in each sub network
need to be in constant communication, but not necessarily using a real time protocol. In
actual fact, each node transmits data at predetermined intervals to its neighbouring nodes,
sharing information about the environment noise pattern and level. This communication is
vital for the whole system to work properly and therefore has to be error proof.
For this reason, the transmission system must be able to detect when a transmission error
has occurred, in order not to share and process incorrect data. This implies that the
transceiver which is chosen for the wireless system has to be able to perform an error
detection technique.
Since the communication is not on real time if a faulty packet is received, the transmission
can either be repeated until the data is successfully received or either delayed until the
channel is good for data transmission. Such choices are to be taken when implementing the
upper layer of the communication protocol and will be made by the company, depending
on the required system performances.
However, it is fundamental that the hardware components in the wireless transmission
system are able to detect a faulty packet reception when it occurs.
The average traffic pattern of data shared between nodes in an typical system is shown on
figure 2.2.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 17
Figure 2.2: Traffic patterns in a typical sound masking system7
2.4 Wireless Coexistence
Another requirement is the coexistence between the sound masking transmission system
and other wireless standards that might be present in the same operational area.
In the places where sound masking technology is installed it is often easy to find other
wireless protocols –such as IEEE 802.118 (also known as Wi-Fi) or IEEE 802.15.1
9 (also
known as Bluetooth) or other short range devices like cordless phones, wireless security
cameras, pagers, alarm systems and wireless temperature sensors, to name a few. Such
systems nowadays are very common in working environments or public places, and all of
them use an unlicensed frequency range to operate.
Consequently, it is very likely to find a fully engaged unlicensed spectrum, making
coexistence and interference a major issue.
The requirement for the sound masking transmission system to be able to successfully
operate without jamming or interfering with other systems that could be transmitting in the
same range of frequencies at the same time is particularly demanding and represents the
main challenge for the project.
The sound masking wireless transmission system property to coexist with other wireless
standards present in the area is vital and represent a key feature for the system; in fact, if
this requirement is not completely fulfilled the whole product would be useless and
unsuccessful in the market.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 18
Chapter 3
Review of Communication in the ISM Band
3.1 Wireless Transmission in the Unlicensed Band
As discussed in the previous section the transmission system has to operate within an
unlicensed frequency range common to various countries; the International
Telecommunication Union10
is a worldwide organization which defines frequencies
allocation and wireless standards for every part of the globe. In particular, the ITU has
divided the world into three main regions: Region1 includes Europe, Africa, the Middle
East, the former Soviet Union area and Mongolia; Region2 comprises the Americas,
Greenland and some eastern Pacific Islands; while Region3 covers most of non former
Soviet Union countries in Asia, Iran and most of Oceania11
.
ITU determines common regulations used as a guideline for each region .Such regulations
are then adjusted by each singular country to suit their own needs, maintaining the basic
properties defined by the international organization.
The ITU regulations for each frequency range contain, among other things, information on
the purpose of the transmission, the maximum transmission power, modulation scheme and
license required.
In addition other standardization bodies that regulate the use of radio equipment for more
specific areas, for instance in Europe the standards are set by The European Conference of
Postal and Telecommunications Administrations12
(also known as CEPT) and also by the
European Telecommunications Standards Institute13
(or ETSI). While in the United States
the governing body concerning wireless systems is the Federal Communications
Commission14
(or FCC). In Japan instead, there is the Association of Radio Industries and
Business15
(or ARIB).
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 19
Such bodies regulate the requirements to a higher-level in respect to the general guidelines
given by the ITU. To be noted that in the case of the European Union the final regulations
are set by each country governing body: in the UK by the Office of Communications16
(or
Ofcom), in Germany by the Federal Network Agency for Electricity, Gas,
Telecommunications, Post and Railway17
, in Italy by the Ministero delle Communicationi18
and in France by the Ministere de l'Econonie des Finances et des L'Industrie19
, to name a
few. However, most of the frequency allocations and regulations tend to be very similar
throughout Europe, especially for those bands used by the public.
Some specific frequency ranges, allocated in different positions of the spectrum, are called
Industrial, Scientific and Medical band or ISM20
. In these ranges, one could operate a
wireless system without obtaining a license first.
Each nation could make use of some, all, or even more ISM bands than what assigned as a
guideline from the ITU. For instance table 3.1 shows all the ISM bands available in the
UK, the ranges and purposes are defined by the Ofcom; nevertheless, those bands are
common for most of the countries laying in the ITU Region1.
Generic Frequency Band
Application
9 kHz to 30 MHz Short Range Inductive Applications 27 MHz Telemetry, Telecomm and Model Control 40 MHz Telemetry, Telecomm and Model Control 49 MHz General Purpose Low Power Devices
173 MHz Alarms, Telemetry, Telecomm and Medical Applications 405 MHz Ultra Low Power Medical Implants Devices 418 MHz General Purpose Telemetry and Telecomm and Applications 458 MHz Alarms, Telemetry, Telecomm and Medical Applications 864 MHz Cordless Audio Applications 868 MHz Alarms, Telemetry and Telecomm and Applications
2400 MHz General Purpose Short Range Applications, including CCTV and RFID. Also used for WLANs including Bluetooth Applications.
5.8 GHz Hyper LANs, General Purpose Short Range Applications, including Road Traffic and Transport Telematics
10.5 GHz Movement Detection 24 GHz Movement Detection 63 GHz 2nd Phase Road Traffic and Transport Telematics 76 GHz Vehicle Radar Systems
Table 3.1 Unlicensed Bands in the UK21
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 20
Although transmissions in those frequencies don‟t require one to obtain a license first,
unlicensed band does not mean unregulated –maximum transmission power, modulation
scheme, channel spacing and duty cycle rules are still imposed for system working in those
ranges. Often in these regulations when referring to power, all the measurements are done
using the Effective Isotropic Radiated Power parameter (also known as EIRP); this is by
definition the transmitted power radiating equally in all direction in the form of a spherical
wave. Therefore, a wireless system has to be approved by the respective governing body of
each country where it is going to be used before it could be sold in the public marked. The
regulations set for operating within an ISM band have safety reasons and regulate
transmissions between different protocols. In fact, those bands tend always to be busier,
with various types of protocols and modulations used at the same time; therefore
coexistence has to be kept.
3.2 ISM Band selection
To choose what ISM band is most suitable for this application different parameters have to
be taken into account: antenna dimension, components availability, path loss, scattering
and band usage status are among them. As the transmission system will be installed indoor
(often above the ceiling tile) and as the standard isotropic antenna length is related with the
frequency wavelength, ISM bands in the megahertz order and below are discarded (those
would require antennae several meters long). Another factor is path loss, in this case the
lowest the carrier frequency the lower atmosphere attenuation is encountered; however, the
relatively short distances between nodes make this parameter minor. Instead, the scattering
produced by the electromagnetic waves being reflected by objects increases with the
frequency, offering to the receiver a better multipath reception at higher frequencies -
particularly in small indoor environments where many objects could reflect the incident
wave. Given these considerations, the most suitable ISM bands for this kind of
transmission system are the 2.4 and 5.8 GHz, both offering small antenna dimension and
good scattering.
3.2.1 The 2.4 and 5.8 GHz ISM Bands
Both the 2.4 and 5.8 GHz ISM bands are very common worldwide and both offer good
physical characteristics in terms of scattering and multipath reception, short antenna
dimensions and certainly a high data rate. Yet, nowadays the 2.4 GHz band is more
popular as it is widely used by protocols such as IEEE 802.118, IEEE 802.15.1
9 and IEEE
802.15.4-20061122
(also popularly known as Zigbee) to name a few. This means that this
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 21
frequency range is already likely to be electromagnetically crowded in actual public places
and working environments (even microwave ovens share this very same band).
On the other hand, this entails that manufacturing companies around the world have
already produced quite a large variety of components specially designed to work in this
frequency range. On the contrary, the 5 GHz ISM band is, at the moment this paper is
written, far less used for public products such as wireless local area networks or
communication devices. Consequently, this band is to be expected having far less data
traffic, hence interference. In contrast, as it is fairly new ISM band the choice of
components produced by manufacturers is fairly limited, which makes hard to find
hardware components that fulfil the system requirements.
There are also differences in the two bands in terms of maximum transmission power –for
example in Europe the European Conference of Postal and Telecommunications
Administrations has set the maximum EIRP power to 10mW for short-range devices23
.
Instead, in the 5.150-5.350 GHz ISM range (also called Band A, for indoor use only) the
maximum EIRP limit is set to 200mW with a power density of 10 mW/MHz24
; while in the
5.470-5.725 GHz ISM range (also called Band B, indoor and outdoor use allowed) the
maximum EIRP power is set to 1W with a power density of 50mW/MHz24
. This
difference in the maximum allowed EIRP output power in those two bands is due to the
fact that the path loss increases with the frequency, meaning that to achieve the same range
a 5GHz system would require higher output power.
Given the above considerations and the project technical requirements, the advantage of
having a wider choice in the transceiver selection makes the 2.4 GHz ISM band the
frequency range of choice for this project. This band in fact, even if more
electromagnetically crowded than the 5.4GHz ISM band, offers a vast variety of hardware
components that can accomplish in full the system performance required.
3.3 Comparison between wireless standards in the 2.4GHz ISM band
Since the 2.4GHz ISM band has been chosen as the project frequency range, here below is
listed a selection of the main protocols worldwide used in this frequency range. One of
these protocols could be chosen to be used in the sound masking transmission system; but
above all, these protocols are likely to be found in the area where the transmission system
will be operating. Hence, a good understanding of these standards and their properties
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 22
(such as bandwidth and modulation) makes easier to develop a system that will coexist
with them, avoiding interference.
3.3.1 IEEE 802.11 – The Wi-Fi Standard
Wireless fidelity (or Wi-Fi), is the popular name for the IEEE 802.11 standard.
With its many variants, has become the standard for public and private local area networks.
This standards allows to build up wireless local area networks in which users can access
the internet and share data at high speeds, reaching 600 Mbps with its latest standard
802.11n25
(which uses MIMO technology), with a reasonably wide operative range of
several tens of meters (although the maximum output power limit is set at 10dBm EIRP). It
is capabilities allow interconnecting up to 200726
users at the same time, far beyond what
needed in the case of sound masking systems.
On the other hand, these powerful performances come with a price of complexity; to
implement and to run the software with network protocol requires a relatively large amount
of computational power, which is not compatible with a low-cost system.
The Wi-Fi standards uses the whole 2.4 ISM spectrum, however the frequency range is
divided into 13 channels (in Europe), each of them 22MHz wide (the standards has been
adapted to different variants in the ISM band depending on the country, hence uses 11
channels in USA and 14 in Japan27
).
Each channel is masked with an attenuation of 30dB on the channel edges and since each
channel is 22MHz wide28
a maximum of four Wi-Fi channels can be used at the same time
without channel overlapping. In particular, to ideally achieve zero interference four LANs
could be set up in the same area using channel 1, 5, 9 and 13. Figure 3.1 shows a
representation of the Wi-Fi channels in the 2.4 ISM band.
Figure 3.1: Wi-Fi Channels in the 2.4 GHz ISM band29
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 23
Thus, this protocol is most suited to share large quantities of data among a large number of
users, reaching rather high data rates. As this standard is very popular, it is reasonable to
expect some Wi-Fi channels present in the transmission system operating environment.
However, the standard property to use the ISM range dividing it into channels makes it
easier to avoid mutual interference between different systems.
3.3.2 IEEE 802.15.1 – The Bluetooth Standard
Another popular standard that uses the 2.4 ISM bad is the IEEE 802.15.1 Bluetooth
standard. It is particularly used for wireless personal area networks (WPAN) and short
range devices such as wireless keyboard or mouse, wireless microphones and wireless
printers. The standard development has been focused to achieve very low power
consumption and a transmission range of few meters (depending on the transceiver class),
with a modest data rate –making it suitable to interconnect the above mentioned devices.
The Bluetooth network is established between a device serving as a master and one or
more slave devices, this is also called Bluetooth piconet network. Unlike the Wi-Fi
standard, Bluetooth does not divide the ISM band into wide portions; instead, FHSS is
used, with the 2.4GHz ISM band divided in 79 channels of 1 MHz each30
. The fist channel
used has a frequency of 2402 MHz30
, while the other 78 channels are found incrementing
the frequency with a 1 MHz step (channel 2 at 2403MHz, channel 3 at 2404, and so on..).
For Bluetooth the dwell time is 625μs30
(corresponding to a hop rate of 1600 hops/second).
In the Piconet network the hopping pattern is pseudo-randomly chosen by the master,
which depending on the surrounding environment makes the selection on what frequencies
to use; the slave device instead keeps following the frequency pattern described by the
master24
. Designers used FHSS for this popular standard to avoid interference as the
2.4GHz ISM band is notoriously a crowded band. This standard both fits the requirements
of coexistence with other protocols (as it constantly moves along the spectrum it does not
jam other systems) and low cost.
However to accomplish the sound masking transmission system requirements a Bluetooth
class 1 or 2 would have to be used (slightly more expensive) and above all, the 802.15.1
standard allows a maximum number of active connection equal to eight30
, which is
incompatible with the requirements set by the sound masking system company. However,
as the example of this standard shows, the FHSS technique is an ideal method for wireless
coexistence.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 24
3.3.3 IEEE 802.15.4-2006 – The ZigBee Standard
ZigBee instead, is an industrial standard specially developed for low cost, low data rate
applications with a typical operating range of around 10 meters31
. As the bit rate that it can
support is quite limited, the Zigbee protocol is ideal for applications such as infrared
sensor, smoke detectors, meters readings or light switches. Most of all, this standard is
designed around an extremely low power consumption, in fact a transmission system to be
certified with the Zigbee standard must be battery powered, with at least a 2 year operating
lifetime. However the number of nodes in a Zigbee network can be greater than 65,00031
.
The modulation technique used in this standard is Direct Sequence Spread Spectrum,
which is particularly useful for fitting many users in a limited frequency range, but does
not offer the same anti-interference capabilities as FHSS.
3.3.4 Texas Instruments SimpliciTI
SimpliciTI is another network protocol commonly used within ISM bands. It has been
developed by Texas Instruments to help creating networks with its produces transceivers. It
is very similar to Zigbee for both data rate and range, making it ideal for application like
smoke detectors, alarms or automatic meter readings32
. Nonetheless, it is an open protocol
and does not require to be implemented into battery-powered systems. The maximum
number of nodes that can be set up into a network using the SimpliciTI standard is defined
as 232
, well beyond what required by the sound masking transmission system. On the other
hand, in order to use the SimpliciTI protocol Texas Instruments components have to be
used and the protocol used is not customizable, reducing the overall efficiency –as most of
its features will not be used in the transmission system. But above all, using this protocol
does not allow flexibility –every system aspect, including data rate, coexistence, bit-error-
rate will be strictly related to Texas Instruments original design, making it hard to modify
it to the sound masking transmission system needs.
Table 3.2 reassumes all the different network protocols characteristics
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 25
PROTOCOL PURPOSE ADVANTAGES DISADVANTAGES FREQUENCY
RANGE
802.11 a/b/g/n Medium range
wireless LAN
Worldwide standard
high data rates
can implement
encrypted
communications
Sensible cost
Not readily
available
Requires
elevated
computational
load and
software to be
implemented
2.4 GHz,
5 GHz
Bluetooth Short range
wireless personal
area networks
Worldwide standard
Wide choice of low
cost components
Good interoperability
Short range
Non suited for
crowded
environments
(limited
number of
channels)
2.4 GHz
Zigbee
Short range, very
low power
wireless
communication
link
Worldwide standard
Low cost components
and wide choice
Very low power
consumption
Low system
requirements
Battery
powered
systems only
Strict power
consumption
specifications
Low data rate
2.4 GHz
TI SimpliciTI
Medium range
low power
wireless
communication between devices
3
Low cost components
and wide choice
Low power
consumption and duty
cycle;
Low system
requirements
TI devices to
be used
Low data rate
Non
customizable
protocol
Sub 1 GHz,
2.4 GHz
Custom
Purpose built:
bidirectional
peer-to-peer
communication link
Very low cost
hardware
Highly efficient data
rate
Low power
consumption
Robust to channel
interferences
Able to coexist with
other wireless
transmission
Wide choice of low
cost components
Time to
develop
Network not
interoperable
with other
wireless
standards
Any ISM BAND
Table 3.2: Network protocols characteristics40
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 26
3.4 2.4 GHz ISM Band Survey
Figure 3.2 shows a 2.4 GHz ISM band survey taken with a spectrum analyzer in a public
metropolitan area of Manchester, UK. The measurements were taken in the frequency
range spanning from 2.4 to 2.485 GHz using a resolution bandwidth of 1 kHz. In the graph,
it is possible to distinguish three different Wi-Fi channel used and Bluetooth activity over
different frequencies –seen as narrow channels 1MHz wide along all the spectrum. This
graph is a practical confirmation that the Wi-Fi standard uses portion of the spectrum well
defined in width and position, while Bluetooth uses a FHSS technique probing the
spectrum over different frequencies.
As the bit rate required by sound masking system does not need a wide bandwidth, the
transmission system could still operate in such crowded ISM band, avoiding those
frequencies already being used by the other standards.
It is then vital for the system to be able to first perform a scan of the band in order to
operate in those unused regions of the spectrum.
Figure 3.2: Spectrum Survey of the 2.4 GHz ISM Band
-140
-120
-100
-80
-60
-40
-20
0
2400
.000
001
2402
.472
728
2404
.945
455
2407
.418
182
2409
.890
91
2412
.363
637
2414
.836
364
2417
.309
091
2419
.781
819
2422
.254
546
2424
.727
273
2427
.2
2429
.672
728
2432
.145
455
2434
.618
182
2437
.090
91
2439
.563
637
2442
.036
364
2444
.509
091
2446
.981
819
2449
.454
546
2451
.927
273
2454
.4
2456
.872
728
2459
.345
455
2461
.818
182
2464
.290
91
2466
.763
637
2469
.236
364
2471
.709
091
2474
.181
819
2476
.654
546
2479
.127
273
2481
.600
001
2484
.072
728
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 27
3.5 Custom Built Protocol
The previously mentioned protocols represent a common and reliable solution used in great
deal of applications all over the world; yet, every standard protocol has its own benefits
and drawbacks and its characteristics are designed for a specific purpose.
An alternative of using a standard protocol would be developing a custom protocol from
ground up, a protocol especially designed for the sound masking transmission system.
A custom-made network protocol could be designed just for this wireless system,
improving efficiency and reducing the computational power required, hence the hardware
cost. Such custom build protocol can be fitted around the components selected and deal
with more flexibility issues like coexistence and interference.
In addition, if a non-standard protocol is implemented in the transmission, any possible
maintenance operation or future upgrade to be done on the system could be exclusively
performed by the manufacturing company, leaving no space for competitors.
Such protocol could make use of FHSS technology, which is one of the best methods to
improve standards coexistence.
It is then believed, that the best solution to meet the project requirements with the lowest
cost, is to develop a custom protocol especially designed for this application.
3.6 Additional Requirements for FHSS systems in the 2.4 GHz ISM
band
For wireless systems operating in Europe, The European Conference of Postal and
Telecommunications Administrations classifies, in its recommendation 70-0333
, the non-
specific short range devices in the 2.4GHz ISM band as class 1l23
. For this class of devices
the maximum transmission power is set at 10mW EIRP23
.
Furthermore, if such devices use FHSS technique they must also comply with the
European Telecommunications Standards Institute EN 300 44034
directive.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 28
This directive defines, among other specifications, that all systems belonging to class 1l
and using FHSS must
–define the occupied bandwidth where the spectral density is greater than -74.8dBm/Hz35
(or -30 dBm if measuring the power in a 30 KHz bandwidth);
-the transmitter maximum output power must not exceed the limit set in the ERC 70 03
directive35
;
-such measurements must be made using a hopping sequence with both the highest and
lowest hop frequency 35
(or each frequency in two different measurements);
-FHSS must make use of at least 20 channels separated by a channel bandwidth measured
with a drop of 20dB below the peak level; -the dwell time for each frequency must not
exceed 0.4 s36
;
-each channel must be used at least once in a period of time calculated with the formula:
𝑡𝑚𝑖𝑛 = 4 × 𝑑𝑤𝑒𝑙𝑙𝑇𝑖𝑚𝑒 × 𝑡𝑜𝑡𝑎𝑙𝐶ℎ𝑎𝑛𝑛𝑒𝑙𝑠𝑁𝑢𝑚𝑏𝑒𝑟
-during the blanking time the transmit power must drop below 20nW36
(-47 dBm);
To be noted that as an eventual system malfunction would not involve any risk or danger to
a person, the ETSI does not require any selectivity or reliability requirement.
The above requirements are mandatory for every FHSS operating in Europe and
appropriate measurements must be made before the final system is sold in the market.
These regulations are harmonized throughout all the European countries, while in the USA
and Japan similar rules apply, however those are less restrictive.
To be noted that American FCC regulations measure the maximum transmission power in
terms of field strength instead of effective isotropic radiated power.
The transmission system development will then start implementing a custom FHSS
network protocol especially designed for the sound masking application. This protocol,
while fulfilling the company requirements, will also have to comply with the
aforementioned regulations.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 29
Chapter 4
System Design
4.1 High Level Design
In this section, the project system level design and main components will be outlined,
focusing on the reasons for each component to be included in the system.
In order to form a wireless network each node of the sound masking system has to be
connected with a wireless board. Each wireless board must consist, to perform the required
task, of several hardware components and software (which contains the network protocol).
As discussed in chapter 3.5, such software will be a custom-made network protocol built
from ground up; this can be designed to make each network node process, manage and
share data coming from the respective sound masking digital signal processing board. The
software must perform all different kind of operations required to transmit and receive the
information from one node to another. Such software can be written in a programming
language and then, once converted by compiler into machine language, stored into a non-
volatile memory inside each wireless board.
The main hardware components for each network node of the transmission system are: a
processing unit (to acquire, process and mange data), a transceiver (to convert the
information from binary code to modulated radio frequencies), a non-volatile memory
(large enough to contain all the network protocol) and an antenna (to transmit and receive
information using radio frequencies). Depending on the transceiver of choice could also be
needed (in the RF front-end) a power amplifier or low noise amplifier. Respectively in case
the output power has to be increased or the received signal is too weak to be successfully
decoded.
Figure 4.1 shows the schematic view of the main components for each network node.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 30
Figure 4.1 Wireless board and its main components connected to a sound masking node
The processing power needed for promptly executing the network protocol can be
addressed using a modern microcontroller. This is a unit which represents a good trade-off
between processing power and unit cost. Furthermore, high-end modern microcontrollers
are fitted with non-volatile memory on board big enough to store the whole network
protocol. Using this component, would remove the need to install for a separate non-
volatile memory, reducing the size of each node and facilitating the board layout.
In line with the system requirements, the transceiver main properties are: the possibility to
span the entire 2.4 GHz ISM band; to have FHSS capabilities; to transmit/receive with an
adequate data rate; and have the ability to detect when a faulty data reception occurs. Such
capabilities can be found in modern low-cost transceivers, which are especially made to
interoperate with microcontroller units. However those chips have often limited
transmission power, so it could become necessary to boost the output power with a power
amplifier to reach the require range (this always respecting the regulations regarding the
maximum EIRP output power). Moreover, low-cost transceivers sensitivity could be
enhanced adding a low-noise amplifier to increase the power lever of weak received
signals. Such extra components to be installed between the transceiver chip and the
antenna will increase the system capabilities, but will also increase the price and design
complexity.
The antenna is another vital system component, it can be isotropic (irradiating power
equally in all directions) or directional. Theoretically, to achieve best performances its
length must be equal to half of the carrier wavelength. This means, for frequencies in the
2.4 GHz ISM band, its length would be around 12.5 cm.
On the other hand, for short-range communications it is also possible to use a printed
circuited antenna (also called PCB antenna): this type of antenna often consists in a
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 31
microstrip track printed on the surface of the PCB board. Over the years, RF engineers
have designed advanced layouts for printed circuit antennae; probably the most successful
type of PCB antenna is what is commonly called the F antenna. This printed circuit
antenna is f-shaped and its dimensions are much shorter than conventional antennae: in
fact, f-antennae are usually not longer than few centimeters for the 2.4 GHz ISM band
frequencies. In addition, since it is only made of a microstrip track (with no need for a
balun) both production cost and layout complexity are reduced significantly. However, f-
antennae are designed for relatively short-range communications and its performances are
inferior to standard isotropic or directional antennae.
4.2 Hardware Component Selection
In this section, topics discussed comprise the selection for all hardware components to be
installed in each wireless board; such components will be chosen using parameters like the
requirements fulfilment, cost and ease of assembly as the main guideline.
In addition, the main aspects of hardware assembly and testing are discussed.
4.2.1. Microcontroller
As discussed in the previous section, a microcontroller unit is the ideal choice for giving
the wireless board enough processing power with both low cost and power consumption.
Even though low power consumption is not a requirement for this project, such feature
allows smaller packaging and eliminates the need for cooling fans. This makes the whole
board smaller, simpler to design and build, and above all, cheaper to produce.
Since the microcontroller will handle all the network protocol, the unit of choice has to be
a high-end model. Furthermore, as mentioned in the previous section, to simplify the board
layout and reduce the mounted components the microcontroller unit must be equipped with
enough onboard non-volatile memory to contain the whole network protocol software.
The major producers of these devices are Texas Instruments37
, Motorola38
and
Microchip39
. All these companies produce low-power, low-cost microcontrollers.
Currently, the most popular and widely used models are the MSP430 and PIC from Texas
Instruments and Microchip respectively. Using one of these devices would guarantee good
processing power, excellent reliability and low-cost. However, the company Embedded
Systems Projects have used Microchip components in the past and has some expertise in
programming such units. This would enable to company to provide product assistance and
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 32
upgrades in the future. Hence, the PIC microprocessor is the microprocessor type of
choice.
The PIC family is divided in three main categories, depending on the word length: 8-bit,
16-bit and 32-bit. The 32-bit PIC microcontroller is most performing in the PIC family; it
provides both relatively high processing power and built-in memory space.
However, PIC32 models are in respect to the 8 and 16-bit types generally more expensive,
have bigger packaging dimensions and higher power consumption.
Due to the complexity of the network protocol and as neither power consumption or layout
dimensions are critical in this project, the PIC32 microcontroller is chosen as the
processing unit. This high performance microcontroller is an adequate device to manage
communication with both the sound masking node and the transceiver.
The the PIC32 family contains several device models, each one built with different
characteristics and features designed for specific area of application.
The microcontroller will be interfaced between the digital signal processing board (in the
sound masking system node) and the transceiver, both using an SPI connection to
communicate. Therefore, the model of choice must feature at least two SPI ports.
This essential feature narrows down the list of possible models to be chosen within the
PIC32 family. As mentioned, enough on-board memory is another vital requirement;
which is why, a model with 512 KB of built in non-volatile memory is preferred.
A PIC32 model that contains the required feature is the PIC32MX360F512L41
; in fact, this
high performance microcontroller has a clock frequency of 80 MHz and a word length of
32 bit, giving it fine processing power. It also features 512 KB of on-board flash memory;
it is equipped with 2 SPI ports; and it has a low price unit.
As a result, the PIC32MX360F512L is chosen to be the project microcontroller unit.
Figure 4.2 reassumes the microcontroller main features.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 33
Figure 4.2 PIC32MX360F512L main features42
4.2.2 Transceiver
The transceiver unit has the purpose to transmit data over RF frequencies to be shared in
the network. Therefore this is a vital component and extreme care has been taken to select
the most suitable chip. As mentioned in chapter 3, the 2.4 GHz ISM band is very used
worldwide therefore there is quite a wide variety of components to choose from. However,
the nature of the project and its requirements –the FHSS implementation above all- require
an accurate component selection. In particular properties such as frequency span,
frequency resolution, maximum output power, data rate, receiver sensitivity and frequency
calibration speed are the main criteria used to select the appropriate component.
As previously said, for this frequency range many companies such as RF Micro Devices 43
,
Texas Instruments and Microchip, however Texas Instruments has developed over the
years a wide variety of transceivers for the most used frequency range, gaining a leading
position in the market. As a matter of fact, table 4.1 shows all the transceiver made
available from Texas Instruments for the 2.4 GHz ISM band.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 34
Table 4.1Product comparison guide for the 2.4 GHz ISM band44
As table 4.1 shows there is a vast selection of transceivers from Texas Instruments for the
required frequency range, however it is easily noticeable that the CC2500 is the most
suitable for the project. This transceiver has the best frequency resolution in the product
range (427 Hz, which is remarkable for a low-cost chip), a maximum data rate of 500 kbps
(which is adequate for the project requirements), a fairly good sensitivity and, above all,
it‟s capable of FHSS technique –meaning it can change carrier frequency at a high rate.
This transceiver is also capable of Cyclic Redundancy Check (CRC), which is a method
for detecting corrupted data reception. All these features make this chip fulfil the given
requirements.
Furthermore, with a high sensitivity and a maximum output power of 1 dBm, the CC2500
transceiver eliminates the need for a power amplifier and a low noise amplifier to be
mounted between the transceiver and the antenna for increasing the communication range.
If for example the free space propagation model is applied, it is possible to calculate the
attenuation in the RF signal in the typical distance between two network nodes:
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 35
𝐿𝐹.𝑆. 𝑑𝐵 = −10 log 𝜆2
4𝜋𝑑 2 = −10 log((
𝑐
2.44×109 )2
(4𝜋×10)2 ) ≅ 60.18 dB equation 4.145
Where λ is the wavelength of the carrier in the middle of the ISM band, c is the speed of
light in vacuum and d the typical node distance (10 meters). Hence, the RF signal
travelling from one node to another is expected to suffer an attenuation of about 60.18 dB.
This large attenuation in the signal strength is due to the propagation of the wave – in fact,
as an electromagnetic wave travels it expands in a spherical order; therefore as the wave
travels in space its energy density decreases as the inverse of the squared distance.
The calculated loss in the signal strength is only an approximation, assuming no objects or
reflections occur. However, for relatively short distances this path loss approximation
could still be accurate.
If two isotropic antennae are used, the received signal strength can be calculated as:
𝑃𝑅 = 𝑃𝑇 + 𝐺𝑇 + 𝐺𝑅 − 𝐿𝐹.𝑆. = −29 𝑑𝐵 − 60.18 𝑑𝐵 = −89.18 𝑑𝐵 = −59.18 𝑑𝐵𝑚
equation 4.245
Where PT is the transmission power in dB; while GT and GR are respectively the transmitter
and the receiver antenna gains, set to 0 dB as both antennae are passive devices ideally
radiating equally in every direction. Such power budget calculation will be repeated once
the antenna model is chosen; resulting in a more precise approximation.
As table 4.1 shows, a received signal strength of -59.18 dBm is well above the sensitivity
limit for the CC2500 transceiver (-99 dBm at 10kbps44
), even if the transmission uses with
the maximum data rate.
Consequently, due to its features, the Texas Instruments CC2500 is selected as the
transceiver of choice for this project.
4.3 Hardware Assembly and Testing
At this stage of the project, the two main components for the wireless transmission system
have been selected. The PIC32MX360F512L microcontroller will host on board and
execute the network protocol, sending and receiving data with both the sound masking
node and the CC2500 transceiver. The Texas Instruments chip instead will send and
receive data over RF frequencies, establishing a wireless link with all network nodes in its
sub network.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 36
Each wireless board will contain these two main components and an antenna.
However, the previously mentioned chips require the addition of several surface-mounted
components in order to work. These components can be mainly classified in resistors (to
adjust the voltage levels), capacitors (to filter frequencies or to accumulate charge for
current consumption peaks) and oscillators (to synthesize frequencies). For instance, figure
4.3 shows the external components that need to be connected to the CC2500 transceiver.
Figure 4.3 Overview of External Components to be connected to the CC2500 transceiver46
The wireless board layout has to take account of those external components as well as the
SPI connection tracks and the antenna matching circuit. The layout design will be made for
mass production, optimizing size and cost for each board; however, the creation of such
layout is not part of this project.
In this project instead of using the boards with the custom layout, general-purpose
development boards will be used. Manufacturers equip these boards with all the surface
mounted components needed, plus some additional hardware (such as LCD screens,
communication ports, LEDs and sensors), to provide developers a ready to use platform for
a vast variety of applications. Development boards are in fact the best solution to reduce
the time required for hardware setup, as they come already fitted with all the parts a
developer needs for whole variety of different projects. On the other hand, these boards
have generally a higher unit price and bigger dimensions with respect to single purpose
boards, but are usually bought in small quantities just for prototyping.
Microchip produces several development boards; Explorer 1647
(shown in figure 4.4) is
among them and it is designed for the PIC microcontroller family. It supports different
types of microcontrollers, including the PIC32MX360F512L. This board includes many
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 37
different features with the most significant being a LCD display, serial connection,
potentiometer, USB port and a Pictail connector slot. Using such a board during the project
development stage would allow the use of all the PIC32 features without spending time for
the wireless board layout.
Figure 4.4 Microchip Explorer 16 Development Board47
To furthermore reduce the time spent on hardware setup during the developing stage, a
pre-fabricated module could also be used for the transceiver. As a matter of fact, Texas
Instruments produces the CC2500EM module, which is a PCB board with installed the
CC2500 transceiver, all the external components required for a correct functioning and a
balun circuit for plugging an external antenna. This module represents a very effective and
rapid solution for using the transceiver; nevertheless, the unit price is fairly high and is not
a convenient choice for the prototyping stage.
Quasar UK48
, a company that produces RF modules, also manufactures a board with the
CC2500 chip installed with all the surface mounted components. This module also
includes an F antenna in the same PCB, which eliminates the need of purchasing an
external isotropic antenna. In addition, above all, the unit price for each module is
relatively very low.
On the other hand, the quality of the components used in this module –such as the
oscillator or the F antenna- will not offer the same transmission quality offered by the
Texas Instruments module or by a custom PCB layout with first quality components. Yet
this reduction in quality is acceptable for the prototype board, and this module was
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 38
approved to be part of the project; figure 4.5shows an image of the Quasar module, in
which can be seen: the CC2500 chip; its external surface mounted components; the SPI
connector; and the F antenna made by Microstrip tracks.
Figure 4.5 Quasar CC2500 module48
Since an F antenna is mounted in the prototyping board, a reduction in the link range is
likely to occur; Quasar does not include in the module datasheet the antenna radiation
pattern, however an estimation can be made using the radiation pattern from a known
similar type of F antenna. The Texas Instruments 2.4 GHz Inverted F antenna has almost
the same layout characteristics, is therefore a good performance reference point for the
Quasar module F antenna. In figure 4.6 is shown the radiation pattern for the antenna XY
axis (the plane parallel to the PCB board).
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 39
Figure 4.6 Texas Instruments 2.4 GHz Inverted F Antenna78
From the XY radiation pattern shown on figure 4.6, it is possible to notice that the antenna
gain drops consistently in those regions around 10º and 190 º, which correspond to the
ends of the antenna longitudinal axis. The typical F antenna radiation patter is far from
being isotropic. However, as an approximation, the average gain along the XY plane for
this type of antenna is 1.1 dB79
. Therefore. the received signal strength (equation 4.2) can
be re-calculated as (with both transmitter and receiver gains set as 1.1dB):
𝑃𝑅 = 𝑃𝑇 + 𝐺𝑇 + 𝐺𝑅 − 𝐿𝐹.𝑆. = −29 𝑑𝐵 + 1.1 𝑑𝐵 + 1.1𝑑𝐵 − 60.18 𝑑𝐵 =
−86.98 𝑑𝐵 = −56.98 𝑑𝐵𝑚 equation 4.3
As a result, using the free space loss approximation over a 10 meters distance, the received
signal strength of at the receiver is -56.98 dBm; such power level is well above the
transceiver sensitivity (-99 dBm at 10kbps44
), making the Quasar CC2500 module an
adequate choice for the project requirements.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 40
To connect the transceiver module with the microcontroller SPI interface, the Explorer 16
Pictail connector can be used. Hence, a breadboard is plugged in the Pictail socket -each
contact in the breadboard matches to a pin in the PIC32. At this point a female connector
(which matches the male connector of the Quasar CC2500 module) is glued on one end of
the breadboard, creating a socket in which the transceiver module could be plugged in.
Finally, each pin of the female connector is soldered with the correspondent contact on the
breadboard, effectively putting in contact the CC2500 module with the PIC32 pins.
More in detail the connection between the CC2500 and the microcontroller was established
following the SPI protocol pinout. In fact, each SPI interface is made of 4 pins: serial data
in, serial data out, clock, and cable select. A description of the SPI protocol will be made in
the next chapter, however a correct hardware connection between the transceiver and the
microcontroller is vital for the system functioning.
Figure 4.7 shows the pinout on the Pictail connector on the Explorer 16 board (where the
SPI interface, power and ground PINs can be seen); while figure 4.8 shows the Quasar
CC2500 module.
Figure 4.7 Pictail connector pinout49
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 41
Figure 4.8 Quasar CC2500 module pinout50
Hence the connection order followed was:
CC2500 module Explorer 16 board
PIN 1 (Vcc 3.3 V) ↔ PIN 21 (Vcc 3.3 V)
PIN 2 (DATA IN) ↔ PIN 7 (DATA OUT)
PIN 3 (SPI CLOCK) ↔ PIN 3 (SPI CLOCK)
PIN 4 (DATA OUT) ↔ PIN 5 (DATA IN)
PIN 5 (NOT CONNECTED)
PIN 6 (GROUND) ↔ PIN 9 (GROUND)
PIN 7 (GDO0) ↔ PIN 101 (I/O PIN)
PIN 8 (CABLE SELECT) ↔ PIN 1 (CABLE SELECT)
Table 4.2 PIN connection list
Table 4.2 shows the SPI pinout configuration: the microcontroller data output pin is
connected with the data input pin on the CC2500, and similarly the microcontroller data
input is connected with the data output pin on the CC2500. These pins are used to transmit
data on the SPI interface. Instead, the clock pin is used to synchronize the SPI data
transfer; in fact, data will be sampled only when a transition occurs on this pin. The cable
select pin is used to enable or disable the communication with the transceiver. As a matter
of fact, communication with the transceiver can occur only if the cable select pin is at a
low logic level (0 V), instead if this pin is at a high logic level (3.3 V) the CC2500 will
ignore every communication.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 42
In order to avoid a „cold soldered joint‟ each connection was tested after the soldering. A
multimeter was used to check if electrical connection was established between the
microcontroller and the transceiver pins. Figures 4.9, 4.10 and 4.11 show the main steps
followed for connecting the microcontroller with the CC2500 module.
Figure 4.9 (left) Soldering the glued female connector with the corresponding contacts. Figure 4.10 (right)
Plugging the CC2500 module in the glued female connector.
Figure 4.11 The breadboard inserted into the Pictail connector of the Explorer 16 board.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 43
Once all the connections were verified and the breadboard (fitted with the CC2500
module) inserted into the Pictail connector, full communication was established between
the microcontroller and the CC2500 transceiver –effectively creating the prototype
wireless board. This board, in addition, is equipped with a serial connection which will
become very handy for debugging and testing during the network protocol development
phase.
However, in order to establish a wireless link at least two wireless boards are needed; so
another development board and transceiver module are required. Microchip produces a
cheaper development board in respect to the Explorer 16, this smaller and simpler board is
named PIC32 Starter Kit51
. This development board comes fitted with a
PIC32MX360F512L microcontroller, a USB connection for programming, three LEDs and
a general-purpose expansion slot. This board has a lower price compared to other
development board; however, it does not include a serial connection or a Pictail connector.
For this reason, to connect the Starter Kit board to the breadboard fitted with the CC2500
module, a Microchip „I/O Expansion Card‟ is first plugged on top of the Starter Kit
expansion slot. Since such expansion card is equipped with a Pictail connector, a
breadboard could then be inserted, finally connecting the microcontroller in the Starter Kit
with the CC2500 module. Figure 4.12 and 4.13 show the afore mentioned components.
Figure 4.12 PIC32 Starter Kit52
(bottom view). Figure 4.13 I/O Expansion Board with the Pictail connector53
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 44
As the Pictail connector in Microchip I/O Expansion card has the exact same pin layout as
the Pictail connector, the pin connection list used is the same as shown in table 4.2 in the
case of the Explore 16 board. For this board also the all series of connection tests were
performed, assuring a reliable link between the CC2500 and microcontroller pins.
Figure 4.14 All the hardware assembled and tested, ready to be programmed
At this point all the hardware which is needed to perform a peer to peer wireless link is
assembled and tested. Setting up a link with two boards will allow to develop a network
protocol that can be extended to a network of nodes. As all the hardware required is all set,
the next project phase is the software development.
4.4 Software Design
Both development boards are equipped with the same microcontroller unit, the well
mentioned PIC32MX360F512L. To make the microcontrollers manage their respective
transceiver unit a firmware must first be programmed into the onboard flash memory. Such
firmware, (also simply called microcontroller software) will contain all the instructions and
modus operandi to run the wireless link, so such element represents the key project aspect.
This protocol will have to make the most of the hardware installed on each board.
4.4.1 Software Environment
Microchip has developed a software environment called MPLAB54
specifically designed
for programming Microchip microcontrollers and digital signal processors. These units are
general-purpose processors and need a firmware to be installed in their on board flash
memory to operate. The device function is only dictated by the firmware installed. The
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 45
MPLAB PC program allows developers to write the firmware in C language, compile it,
and then transfer it into the device.
The first step for programming a device is selecting from a drop down menu, then
choosing what type of device is going to be used, the PIC32MX360F512L for this project.
Once the device is selected, a C program can be written in one or more source files, saved
as .c source file. The syntax and instructions set used in the MPLAB environment is very
similar to the standard ANSI C, however some specific functions are also implemented
(such as those for code optimization or device specific ones). After the C code is
completed, the MPLAB C compiler will first check the syntax of the code (looking for
errors or inconsistencies); then, if the check is successful, it will compile the C code.
Compiling the code transforms the human oriented C instructions into binary code, the also
called machine language. This series of ones and zeros contains all the instructions that the
device will run. Such code can vary from device to device: that is the reason why, prior to
compiling, the exact device type must be selected.
The next step is to transfer the just created code into the device, hence the device board
must be connected to the PC. Such operation can be done in several ways: by using a USB
cable, by using a ICD2 or a REAL ICE programmer. The method by which a device is
programmed depends on the connection used between the PC and the microcontroller
board; the main factor that changes using different transfer method is the transfer speed.
Furthermore, the REAL ICE programmer has the lowest program time and can be used for
debugging. In fact, the REAL ICE programmer can in real time pause the execution of a
device program, allowing developers to check the program flow and variables content. The
Explorer 16 developing board is compatible with a REAL ICE programmer while the
Starter Kit will be programmed through a USB cable.
After the device is programmed the code can be ran and paused from the MPLAB
environment, permitting developers to verify the program tasks. Figure 4.12 shows the
MPLAB environment with the development boards connected ready to be programmed.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 46
4.4.2 SPI Interface and Transceiver Configuration
While the microcontroller unit offers a
general purpose processing unit, that will
execute the instructions saved in its built it
memory, the CC2500 transceiver is
programmed through the 4 wired SPI
interface (figure 4.15). Moreover, the same
interface will be used to establish
communication between the wireless board
and sound masking node, however such
communication will not be discussed as it it not part of the project. The developemnt will
in fact focus on the network protocol (installed in the microcontroller) and in the
transceiver configuration.
More specifically, the CC2500 transceiver has 47 one byte long configuration registers,
that can be either read or written through the SPI protocol, configuring the transceiver; to
each register is assigned one or more specific chip feature. Hence, to modify the CC2500
behaviour and performance the microcontroller unit must access and modify several
transceiver registers. Each register is given a unique hexadecimal address, consequently for
accessing each register, the microcontroller unit must initially send the register address
(specifying if that register is going to be read or written) and then perform the read or write
operation. Such commands are sent using the SPI serial data out pin from the
microcontroller (MOSI); and received in the serial data in pin in the CC2500 (SI). Figure
4.16 shows the address header that must be sent by the microcontroller for accessing a
transceiver register. It is possible to notice that the most significant bit (MSB) specifies if
that register is going to be read or written (if zero it is a write operation, if one it is a read
operation). The second bit instead is the burst bit: if this bit is set, the transceiver will
expect multiple register read/write operations, not requiring the transmission of an address
header (an internal counter will automatically increase the address by one for every data
byte sent by the microcontroller). Finally, the last 6 bits represent the register address that
is going to be read or written.
Figure 4.15 4-Wire SPI Interface55
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 47
Figure 4.16 CC2500 Address Header56
The all sequence for reading and writing a register in the CC2500 is well shown by
figure4.17, found in the DN503 Chipcon design note.
Figure 4.17 Single Byte Access: register writing (top) and reading (bottom)57
It is possible to notice that for establishing communication with the transceiver, the
microcontroller unit must first set the CS pin low, and then send the address header byte
-specifying in the most significant bit whether is a reading or writing operation. In case of
a write operation, after the header byte the microcontroller sends the byte to be written in
that register. Instead, in case of a read operation, after the header byte the microcontroller
just toggles the clock pin to receive the register content over its MISO pin. In fact, as the
SPI protocol specifies, every data transfer is done only when the CLK pin is toggled. In
case of the CC2500 the data is sampled on the clock transition from a low to a high level,
as shown by figure 4.18.
Figure 4.18 SPI Clock Phase and Polarity55
Each configuration register has to be programmed with the specific value corresponding to
the desired functionality. In fact, it is by changing some specific configuration registers
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 48
that characteristics like modulation scheme, data rate, packet length or output power are
applied. Due to the big number of configuration registers and the high number of
transceiver functionalities, it can be a complex and time consuming operation to find, for
each configuration register, the exact value that produces the desired chip behaviour.
To help developers finding the correct registers values to program into the chip, a PC
software can be used. This software, produced by Texas Instruments, is called Studio RF58
.
Such software allows to selectively enable all the different options and transceiver
parameters, converting such choices into configuration registers values. It is also possible
to export such values with syntax compatible with the C programming language, making
easy to implement such code into the microcontroller software. However, the current
version of the program (v.6.11.5.0), is best suitable for programming transceivers installed
on Texas Instruments development boards. This is the reason why, for some specific
registers, the configuration values were calculated by hand. Figure 4.19 shows the list of
all the CC2550 configuration registers: the whole transceiver programming is dictated by
those registers values.
Figure 4.19 Configuration registers overview59
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 49
The CC2500 transceiver it is quite a complex chip, however it is possible to send direct
command in order to change it is behaviour (or state). Such commands are also called
command strobes. A command strobe takes the shape of a one-byte long instruction, that
once received in the CC2500 serial data input pin, makes the chip „jump‟ in the requested
state. For instance, it is possible to send command strobes to make the chip go in reception
mode, transmission mode, idle mode or flush the data FIFOs (First Input First Output are
two special registers that contain data to be sent or just received. Both the transmit and
receive FIFO are for the CC2500 transceiver 64 bytes long.
In addition, every time the CC2500 receives a command strobe it also automatically
outputs on its serial output pin a status byte. Such status byte contains the main information
about the system status; such as the state in which the transceiver is or the number of bytes
in the FIFOs. Figure 4.19 shows the complete radio control state diagram of the CC2500
transceiver.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 50
Figure 4.20 Complete Radio Control State Diagram60
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 51
As it is possible to notice from figure 4.20, sending command strobes allows to move
through the CC2500 states.
Therefore, the software managing the communication between the microcontroller and the
transceiver can be built on few basic functions:
A function to read a specific register;
A function to write a specific register;
A function to send command strobes;
A function to read the status byte;
All the tasks performed by the network protocol are made using those above basics
functions. For instance, to transmit data one only needs to fill the transmit FIFO (using the
write register function) and then enter in the transmit mode by sending the transmit strobe.
Similarly to receive data the procedure is to first enter in receive mode by sending the
receive strobe, then ensure a full packet is received and finally read the receive FIFO
(using the read function). Even changing carrier frequency involves, in this order, writing
into a register, sending a command strobe and reading a register.
Hence, the whole firmware is divided into four main source files:
main.c (which contains the high level instructions);
MicroSetup.c (which mainly contains a function used to setup the microcontroller
clock and serial connection. These functions are part of the Microchip library);
SPI.c (which contains the mentioned basic functions);
and RF.c (which contains those functions used to manage data transfer);
In the next chapter, all the functions used in the network protocol will be analyzed in
detail.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 52
Chapter 5
Development of a FHSS MAC Layer Protocol
Developing a network protocol that uses FHSS technique is not a straightforward task,
since many aspects and details need to be taken into account. The approach adopted in this
project is to develop the MAC layer of the network protocol step-by-step, first starting with
a simple peer-to-peer link over a fixed carrier frequency. Once such result is achieved the
development will gradually evolve toward an adaptive FHSS network protocol. Hence, the
final network protocol will still contain most of the code used for a fixed frequency link;
with the addition of the more advanced functions.
The following functions are given in pseudo code, and describe all the operations needed
to control the CC2500. As the pseudo code is not device specific, such functions could
easily be ported to be ran by different microcontrollers. Furthermore, the device specific
functions, such as the ones used to configure the microcontroller clock speed and serial
communication are not explained. In fact, those are part of the standard code library and
have not been developed in this project. Such functions are standard for every PIC32
device and are all only called in the file MicroSetup.c. All the source code explained in this
chapter is found in full in the appendix at the end of this paper.
5.1 Basic Functions
As previously mentioned, the functions that perform basic transceiver operations (such as
read or write a register) are vital for the whole network protocol. These functions are
contained in the source file SPI.c. This file contains in its first lines some useful
definitions, which will make the code more readable and compact; the functions are here
explained in the same order as they appear in the SPI.c source file.
As the CC2500 has both address header and registers one byte long, it is useful to define a
custom variable type of the same size. This variable type has been called „BYTE‟ and is
defined as an unsigned char, meaning its content can be a number ranging from 0 to 255
(exactly as 28, the byte definition).
The pseudo code instruction is: define type unsigned char as BYTE
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 53
It is also useful to define the command strobes names: in fact, a hexadecimal number
represents each command strobe that can be sent to the transceiver. It is then easier to
define a name for each command strobe, in order to use just a name throughout the code
instead of its number. Table 5.1 shows the list of all command strobes that can be sent to
the CC2500 transceiver.
Figure 5.1 Command Strobes list61
Therefore, for each command strobe a name was defined (the names are the same used in
Figure 5.1).
The pseudo code instruction is: define command strobe 0x30 as SRES
As showed by figure 4.17 for enabling communication with the CC2500 transceiver the
microcontroller must fist pull the cable select pin (CS) low. This is can be programmed
into the microcontroller using a PIC32 library function called PORTClearBits(PORT,
NUMBER)62
. Such function takes two parameters as input: the port number and the pin
number. In fact, in the PIC microcontroller family, all the pins are divided into ports
(ranging from A to G in the PIC32), where each port contains pin numbers (ranging from 0
to 15 in the PIC32). Hence, for referring to a specific microcontroller pin both the port and
the number must be specified. Therefore, a simple function named CSlow is created, which
by calling the PORTClearBits, allows to set the CS pin to a low logic level of 0 V,
enabling communication with the transceiver. As showed by figure 4.4, the cable select pin
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 54
is connected with the pin at port B, number 2 at the microcontroller interface.
Consequently, the pseudo code is:
function CSlow{
PORTClearBits(B,2)
}
Similarly, to interrupt communication with the transceiver the cable select pin must be set
at a high logic level of 3.3 V. This can be done using the PIC32 Library function
PORTSetBits(PORT, NUMBER)63
; which has an analogue behaviour as the previous
mentioned PORTClearBits. Therefore, the function created to set the CS high is:
Function CSHigh{
PORTSetBITS(B,2)
}
However, as mentioned in the transceiver datasheet, the CC2500 might take some time
before being operative after the microcontroller pulls the CS pin low. The ready state for
the transceiver is signalled by its data out pin, which goes low once the chip is fully
operative. Hence, a function called CCready is created; this function contains a while cycle
which continuously checks the state of the CC2500 output pin (connected with the pin F7
at the microcontroller, as figure 4.4 shows). Only when the transceiver data output pin goes
low, the program exits the while cycle and the code execution can continue. This function
effectively prevents the microcontroller from communicating with a non-ready transceiver.
The pseudo code is:
Function CCready{
while(F7 is high) stays here
}
As most of the PIC32 pins are capable of different options, part of the code must enable
those pins used the SPI protocol (as showed by figure 4.4). The PIC32 Library contains a
function called SpiChnOpen64
, which enables the SPI module in the PIC32. By selecting
different parameters, it is possible to set, among other things, the communication speed,
the SPI channel, the master device, the clock polarity, in what clock transition data should
be sampled, and the transfer size word. Given the parameters, this function automatically
finds the correct values to put in the SPI1CON register (the register that defines the
parameters for the SPI channel 1). The transceiver datasheet specifies that the CC2500 is
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 55
always to be selected as the slave device in the SPI communication, the communication
speed must not exceed the 10 MHz, the clock idle state is low and the data sampling
happens on the clock rising edge (such information is also contained in the Chipcon design
note DN503). Hence, all those mentioned parameters are included in the function
OpenSPI, which calls the SpiChnOpen with all the required options. Furthermore, this
function also enables the pin D8 as an input pin (using the PIC32 Library function
PORTSetPinsDigitalIn65
). Such pin will be used in the protocol to sample the value of the
transceiver GDO0 pin, as explained later in the document.
Function OpenSPI{
SpiChnOpen(1, SPICON_ON | SPICON_MSTEN | SPICON_CKE , 400)
PORTSetPinsDigitalIn(IOPORT_D, BIT_8);
}
The parameters used in the function SpiChnOpen fulfil the requirements for
communicating with the transceiver, this using the SPI channel 1, a transfer word of 8 bit,
and a communication speed of 200Kbaud. A transfer word of 8 bit has been chosen since
both the address headers and the registers, in the CC2500, have a 8 bit size.
To be noted that the communication speed has been set finding the value for fpbDiv,
following the formula:
𝑓𝑝𝑏𝐷𝑖𝑣 = 𝑓𝐶𝐿𝐾
𝐵𝑎𝑢𝑑𝑅𝑎𝑡𝑒=
80𝑥106
200𝑥103 = 400 equation 5.164
By selecting a fpbDiv parameter equal to 400 for the SPI channel 1, the SpiChnOpen
function will automatically put in the SPIBRG register (the register where the SPI
communication speed is set) a value of:
𝑆𝑃𝐼𝐵𝑅𝐺 = 𝑓𝐶𝐿𝐾 −2×𝐵𝑎𝑢𝑑𝑅𝑎𝑡𝑒
2 ×𝐵𝑎𝑢𝑑𝑅𝑎𝑡𝑒=
80 × 106− 2 ×200×103
2 ×200 × 103 = 199 equation 5.264
A communication speed of 200 Kbaud between the microcontroller and the transceiver is
believed to be sufficient for the required application.
Instead, to close a previously opened SPI connection the function CloseSPI() is created.
This function simply contains a call to the PIC32Library function SpiChnClose66
(where
the channel closed is channel 1).
At this point, the microcontroller can open the SPI connection by calling the OpenSPI
function, and the communication with the transceiver can start by calling the function
CSlow and waiting for a „ready acknowledgement‟ from the CCready code.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 56
As a result, one of the protocol key functions can be written: readRegister is a function that
returns the register content for a given address. As illustrated by figure 4.14 to read the
content of a single CC2500 register first an address header as to be sent: such header will
contain the most significant bit set in read option (set to 1) and the successive bit, the burst
bit set to zero (resulting in a single read). The rest of the header must contain the address of
the register to be read for the remaining bits (see figure 4.13). Once such address header is
sent, the CC2500 will output the register content on its serial output pin. The register
content is outputted each time the SPI clock pin is toggled, outputting the most significant
bit first. To make the SPI clock pin toggle at connection speed of 200kbaud, a „dummy
byte‟ is sent by the microcontroller. This byte will not be read by the CC2500, but instead
will just make the clock pin toggle 8 times making the transceiver outputting the requested
register content. The pseudo code for the readRegister function is:
Function readRegister(register given as input parameter){
enable communication
when CC2500 is ready
send one byte with (requested register + read bit set to 1)
wait for address header to be sent
read the status byte sent by default by the CC2500
send one byte of dummy data (just to make the SPI clock pin toggle 8 times)
wait for dummy byte to be sent
read the register content outputted by the transceiver
return such value
close communication
}
These are the steps required for successfully reading a transceiver register. To send a byte
over the SPI interface, the PIC32 Library function putcSPI167
has been used. This function,
when the 8 bit transfer word is enabled, sends a byte of information from the
microcontroller SPI output pin, starting with the byte most significant bit first. A bit is sent
each time the SPI clock pin toggles; which happens, at 200kbaud, every 5μs. Successfully
reading a transceiver register is, as previously said, a vital point in the program
development. However, during the code development many difficulties were encountered
before accomplishing this task. In fact, reading a register is not as straight forward as
sending the address header, a „dummy byte‟, and reading the content. Every time the
transceiver receives data on its input pin it automatically outputs, on the CC2500 output
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 57
pin, a status byte. As figure 5.2 shows, on the SPI module of the PIC32 both the SPI
transmitter and SPI receiver register share the same address, named SPI1BUF (in the case
of SPI channel 1). Hence, after each byte is sent to the CC2500 transceiver, the content of
the SPI1BUF register has to be read out. This in order to clear the microcontroller
transmission/reception SPI1BUF register from the received transceiver status byte. This
procedure is a peculiarity of the PIC32 microcontroller and has to be strictly followed each
time a byte is sent to the CC2500. The content of the received status byte can either be read
and processed or just read a discarded.
Figure 5.2 SPI Module Block Diagram68
Additionally, in the early stages of the project a function from the PIC32 Library named
readSPI169
was used to read data over the SPI protocol, yet with no results. The function
description in the PIC32 Library Guide states “This function will read single byte/half
word/word from SPI receive register”69
. As known, the SPI protocol requires the SPI clock
pin to toggle for each bit transfer in both send and read operations. Instead, after accurate
testing performed with a logic analyzer, this function was proven not to make the SPI clock
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 58
pin toggle, therefore not reading any data. This is the reason why, in the final code, this
library function is not used. The solution found for reading data from the transceiver
consist in: manually making the clock pin toggle by sending a „dummy byte‟ and afterward
reading out the content of the SPI1BUF register.
Having implemented this code allows the PIC32 microcontroller to access and read every
register in the transceiver. To use such a function one only needs to specify the register
address as all the other steps are automatically performed.
Another key function for the whole firmware is the one that allows modifying a transceiver
register value. It is by changing the CC2500 configuration registers values that the
transceiver can be programmed. Hence, the function writeRegister is implemented. The
pseudo code for this function is:
Function writeRegister(register address, value to be written){
enable communication
when CC2500 is ready
send one byte with (register address + write bit set to 0)
wait for address header to be sent
read the status byte sent by default by the CC2500
send the value to be written in the register
wait for data to be sent
read the status byte sent by default by the CC2500
close communication
}
This function is closely related to the previous one; the main difference is that the PIC32
doesn‟t read a value after sending the address header, but instead sends the data to be
stored on the specified register. Therefore, the function allows change the content of any
transceiver configuration register. Figure 5.3 shows a screenshot of the logic analyzer
output. The logic analyzer is attached to the SPI interface wires while a read a write
operation are performed. In this figure, it is possible to notice that the cable select line is
pulled low and for every bit sent by the microcontroller on the MOSI pin the transceiver
outputs a bit on the MISO line (either part of its status byte or a register content value).
Moreover, it is possible to notice that every communication is made one byte at the time;
the clock pin toggles 8 times for every bit, and data is sampled on its rising edge. With the
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 59
aid of the marker was also possible to verify the communication speed: in fact, every clock
cycle takes 5 us, equivalent to the communication speed of 200 kbaud.
Figure 5.3 Read and Write SPI operation sampled with a logic analyzer
As mentioned in chapter 4.4.2 for changing the transceiver state command strobes can be
used. A simple function sendStrobe is then written allowing the microcontroller to move
through the CC2500 states showed on figure 4.17. The pseudo used is:
Function sendStrobe(desidered next state){
enable communication
when CC2500 is ready
send one byte the next state name
wait for address header to be sent
read the status byte sent by default by the CC2500
close communication
}
As a result, is now possible to dynamically change the transceiver states, entering for
example into receive, transmission or idle mode; one only needs to call the function
sendStrobe specifying the strobe name (as such names where previously defined). To be
noted that the path to follow when moving from one state to another is still the one
depicted on figure 4.17.
Moving from one state to another, however, is not instantaneous. In fact, the CC2500 takes
a specified number of its clock cycles to change its state. Figure 5.4 shows such transitions
timing requirements.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 60
Figure 5.4 State transition timing70
Consequently, the microcontroller has to take account of the time needed by the transceiver
to change state. With a clock frequency of 80 MHz, each microcontroller clock cycle takes
about 12.5 ns;
Hence,
to change state from RX to IDDLE (with no calibration involved) the
microcontroller has to wait a number of cycles equal to:
𝑃𝐼𝐶32 𝐶𝐿𝐾 𝐶𝑌𝐶𝐿𝐸𝑆 = 𝑅𝑋 𝑡𝑜 𝐼𝐷𝐿𝐸 𝑛𝑜 𝑐𝑎𝑙𝑖𝑏𝑟𝑎𝑡𝑖𝑜𝑛 𝑇𝐼𝑀𝐸
𝑇𝐶𝐿𝐾 =
0.1 ×10−6
12.5 ×10−9 = 8 𝑐𝑦𝑐𝑙𝑒𝑠
to change state from IDLE to RX (with no calibration involved) the
microcontroller has to wait a number of cycles equal to:
𝑃𝐼𝐶32 𝐶𝐿𝐾 𝐶𝑌𝐶𝐿𝐸𝑆 = 𝐼𝐷𝐿𝐸 𝑡𝑜 𝑅𝑋 𝑛𝑜 𝑐𝑎𝑙𝑖𝑏𝑟𝑎𝑡𝑖𝑜𝑛 𝑇𝐼𝑀𝐸
𝑇𝐶𝐿𝐾 =
88.4 ×10−6
12.5 ×10−9 = 7072 𝑐𝑦𝑐𝑙𝑒𝑠
to perform a frequency calibration the microcontroller has to wait a number of
cycles equal to:
𝑃𝐼𝐶32 𝐶𝐿𝐾 𝐶𝑌𝐶𝐿𝐸𝑆 = 𝐶𝐴𝐿𝐼𝐵𝑅𝐴𝑇𝐼𝑂𝑁 𝑇𝐼𝑀𝐸
𝑇𝐶𝐿𝐾 =
721 × 10−6
12.5 × 10−9= 57,680 𝑐𝑦𝑐𝑙𝑒𝑠
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 61
Therefore three functions called delayRX_TXtoIDLE, delayIDLEtoRX_TX,
delayCALIBRATION are written; each functions contains a while loop of 15, 7500 and
60000 cycles respectively (the cycles number are slightly bigger than previously calculated
to compensate possible variation in the PIC32 clock frequency). Such functions guarantee
a sufficient delay when switching between reception, transmission and idle states (those
are the main states used in the network protocol).
It is now possible to efficiently change the CC2500 state by just sending a command strobe
and calling the adequate delay function.
5.2 Output Functions
Since the Explorer 16 development board has a serial connection built in, it is possible by
connecting such board to a PC, to output data from the microcontroller unit to the PC
screen. In the source file MicroSetup.c are listed the functions used to configure the serial
module (done with Microchip PIC32 Library functions). Several functions have been
written in the source file SPI.c to output information about the transceiver state and
configuration registers values.
Here below is a list of all the functions used to output different information about the
transceiver status on a PC screen (data displayed with the Hyperterminal PC program):
noBytesInTXFIFO; this function outputs the number of data bytes currently
written in the TX FIFO. This done by reading the transceiver register 0xFA.
noFreeBytesInTXFIFO; this function outputs the number of bytes currently still
available to be written in the TX FIFO. This done by interpreting the CC2500
status byte.
noBytesInRXFIFO; this function outputs the number of data bytes currently
written in the RX FIFO. This done by reading the transceiver register 0xFB.
noAvaBytesInRXFIFO; this function outputs the number of data bytes currently
still available in the RX FIFO. This done by interpreting the CC2500 status byte.
displayAllregisters; this function displays on the PC screen the name and the
content of each transceiver configuration register (addresses ranging from 0x00 to
0x2E).
getState; this function outputs the name of the current CC2500 state by reading and
interpreting the value stored in the MARCSTATE register (address 0xF5).
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 62
getStatusByte; this function has the same purpose as the previous getState, but the
information in this case is recovered by getting and interpreting the CC2500 status
byte.
These functions have been linked to keyboard keys, helping development and debugging.
In fact, the final wireless board is unlikely to have installed a serial connection.
Consequently, such output functions are only useful during the development stage.
The keys layout used is:
L key: calls and outputs the function readRegister with the channel number register
set as address header. Therefore pressing the L key outputs the current channel
number used by transceiver.
V key: sends a strobe to flush the RX FIFO.
R key: sends a strobe to reset the transceiver.
D key: calls the function displayAllRegisters.
I key: sends a strobe to change the state into idle.
S key: writes a test value into the channel number register.
P key: outputs the bytes in the RX FIFO by calling the noBytesInRXFIFO function.
A key: outputs the available bytes in the RX FIFO by calling the
noAvaBytesInRXFIFO function.
G key: outputs the current transceiver state by calling the getState function.
K key: outputs the current transceiver state by calling the getStatusByte function.
Z key: outputs the bytes in the TX FIFO by calling the noBytesInTXFIFO function.
X key: outputs the bytes available in the TX FIFO by calling the
noFreeBytesInTXFIFO function.
T key: sends a strobe to enter in the transmit state.
F key: sends a strobe to enter in the receive state.
Figure 5.5 shows a screenshot of the Hyperterminal window while communication with the
transceiver is established. In this picture it possible to notice the output of the functions
getStatusByte, sendStrobe(IDLE), noBytesInRXFIFO, noAvaBytesInRXFIFO and
noBytesInTXFIFO.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 63
Figure 5.5 Hyperterminal screenshot while calling different output functions
5.3 Configuring the Transceiver
Configuring the transceiver is a matter of writing the desired values into the configuration
registers. As mentioned, most of the registers values have been found using the Studio RF
PC program, which calculated most suitable values for the specified parameters. The
configuration registers to be set, range from the address 0x00 to 0x2E; however not all of
them have to been changed from their default values. In fact, after every power on or reset,
these registers return to a default state. Most of the registers values have been found using
the Studio RF program, except the most critical ones. Here is a list of those registers that
have been manually set to suit the project needs:
GDO0 pin configuration (IOCFG0);
packet length (PKTLEN);
data packet configuration (PKTCTRL0, PKTCTRL1);
device address (ADDR);
channel spacing registers (MDMCFG0, MDMCFG1);
channel number register (CHANNR);
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 64
main radio control state machine configuration (MCSM1, MCSM0);
The GDO0 output pin configuration register (IOCFG0, found at the 0x02 address) sets the
configuration for the transceiver general purpose GDO0 pin. While its default value is 63
(or 0x3F in hexadecimal), it can be changed to suit a vast variety of settings. However, as
advised in the Chipcon design note DN500, the register value can be changed for applying
an interrupt driven solution for packet handling. In fact, setting the register IOCFG0 to a
value equal to 0x06, makes the GDO0 pin (while the chip is in transmit mode) assert when
a packet is starting to be transmitted and de-assert when the packet has been fully
transmitted. Instead, while the chip in receive mode, it makes the GDO0 pin assert when
the beginning of a packet has been received and de-assert when the packet has been fully
received. As showed by the table 4.2 the transceiver GDO0 pin is connected with the
microcontroller 101pin. Therefore, by sampling the value of such pin it is possible to
retrieve information about packet transmission/reception (also called interrupt driven
solution for packet handling).
The packet length register (PKTLEN, found at the 0x06 address) specifies the payload
length for each packet. As a matter of fact, the CC2500 is capable of transmitting payloads
of fixed, variable and infinite lengths. If a fixed length payload is selected, the PKTLEN
register specifies the payload length. To be noted that, as figure 5.6 shows, the CC2500
transceiver is capable of many different packet-handling options. It is then possible to add,
for each packet, a variety of information regarding the packet destination address, the
payload length, the signal strength of the received packet and the result of the CRC test. It
is important to underline that the PKTLEN register specifies just the payload length. This
value determines the number of bytes expected in the RX FIFO for every received packet
(or the bytes expected in the TX FIFO when a packet is transmitted). When using a fixed
packet length transmission, every packet with a payload size larger than the PKTLEN
value will be discarded. It is then vital that all the transceivers involved in the
communication share this same register value.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 65
Figure 5.6 Packet Size options71
The packet automation control registers (PKTCTRL1 and PKTCTRL0, respectively found
at 0x07 and 0x08) determine which packet handling options are enabled. In detail, it is
possible to: -enable the flush of RX FIFO in case of corrupted data reception (CRC check
failed), this would avoid the system to process corrupted data; -to append two status bytes
after the payload to each packet (the first byte containing the signal strength indicator, also
called RSSI and the second one containing information about the link quality and the result
of the CRC check); -to enable the address check (this adds a prefix before the payload,
specifying the destination for each packet), in this way only the transceiver with a
matching address would receive that packet; -to enable data whitening (enables an
algorithm to avoid sending long series of zeros or ones as this decreases transmission
performances); -to enable or disable the CRC check; -and to select between fixed, variable
or infinite packet length mode. Figure 5.7 reassumes the different options for packet
handling. To note that at the beginning of each packet transmission, a minimum number of
preamble bytes are sent (4 by default). Such preamble bytes (which are sent as soon as the
transmit state is entered by the transmitter) are useful to make the low noise amplifier
adjust its gain at the receiver, as the variable gain depends on the strength of the received
signal power. Moreover, after the preamble bytes a sync word is also automatically sent.
This sync word, which is a predefined pattern of bits that can be changed in size and
length, has the purpose of making distinguish the CC2500 packets from other wireless
transmissions.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 66
Figure 5.7 Packet Format72
These are key registers and their values will be changed to suit the protocol needs as the
project develops.
The device address register (ADDR, found at 0x09 address) specifies the transceiver
network address. If the network address check option in the aforementioned PKTCTRL1
register is enabled, this register can be by the network protocol to deliver data only to
certain recipients. As this register, as all the configuration registers, is one byte long, a
maximum number of 256 addresses are available. Practically, the addresses available are
255 as 0x00 is set as the broadcast address (this if the last two significant bits of the
PKTCTRL1 register are set to 10). However, for the project needs, this number is adequate
and such address register will be implemented in the network protocol for packet sorting.
The modem configuration registers (MDMCFG0 and MDMCFG1, respectively found at
0x14 and 0x13 addresses) are responsible for the channel spacing. The CC2500 can
synthesize carrier frequencies ranging in the whole 2.4 GHz ISM spectrum, however to
make changing frequency easy, the frequency range is divided in 256 channels. The
bandwidth of each channel is determined by the data rate and automatically set by Studio
RF. It is then possible, by changing the values in the modem configuration registers to
vary the spacing between channels. More in detail, the value can be calculated with the
formula:
𝛥𝑓𝐶𝐻𝐴𝑁𝑁𝐸𝐿 = 𝑓𝑋𝑂𝑆𝐶
218 × 256 + 𝐶𝐻𝐴𝑁𝑆𝑃𝐶𝑀 × 2𝐶𝐻𝐴𝑁𝑆𝑃𝐶 _𝐸 equation 5.173
Where fXOSC is the transceiver oscillator frequency (26 MHz in the Quasar module used),
CHANSPCM is the value stored in the MDMCFG0 register and CHANSPC_E are the last
two least significant bits in the MDMCFG1 register.
In order to use the whole 2.4 GHz ISM frequency range, the required channel spacing was
calculated as:
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 67
𝐼𝑆𝑀𝑅𝐴𝑁𝐺𝐸 = 2483.5 × 106 − 2400 × 106 = 83.5 × 106 𝐻𝑧 (spectrum available)
equation 5.2
𝑀𝐴𝑋𝛥𝑓𝐶𝐻𝐴𝑁𝑁𝐸𝐿 =𝐼𝑆𝑀𝑅𝐴𝑁𝐺𝐸
# 𝑐ℎ𝑎𝑛𝑛𝑒𝑙𝑠 =
83.5×106
256 = 326.17 𝐾𝐻𝑧 (maximum allowed channel
spacing) equation 5.3
Given the maximum allowed channel spacing when using a 256 channels system, equation
5.1 is then left with two unknown. The approach followed was to fix CHANSPC_E at a
value of 3, and solve the equation in respect to CHANSPCM, which is the value to put in
the MDMCFG0 register. Hence,
326.17 × 103 = 26 × 106
218 × 256 + 𝐶𝐻𝐴𝑁𝑆𝑃𝐶𝑀 × 23
𝐶𝐻𝐴𝑁𝑆𝑃𝐶_𝑀 = 326.17 × 103 − 793.45 × 256
793.45 = 155 = 0𝑥9𝐵
Therefore, setting the last two significant bits of the MDMCFG1 register (also called
CHANSPC_E) to a value of 3 and setting the MDMCFG0 register (its value called
CHANSPC_M to a value of 155, gives a frequency separation of 326.17 KHz between
channels; making use, with all the 256 channels of the whole 2.4 GHz ISM band.
Due to rounding in the frequency synthesizer, the base frequency (which is set in the
values stored in the registers FREQ2, FREQ1 and FREQ0) has been set at a frequency of
2400.000031x106 Hz, slightly shifting all the channels. However, as most of the RF power
is centred around the carrier frequency, the system still complies with all the frequency
regulations mentioned in chapter 3.
The main advantage of using a channelized system is that once the transceiver is in
operation, changing channel will be just a matter of setting a new value in the channel
number register (CHANNR, found at 0x0A address). To be noted that in order to have a
correct frequency matching between receiver and transmitter, all devices must share the
same register values.
The main radio control state machine configuration register (MCSM0, found at 0x18
address) is used to set the default return state after packet transmission and reception. In
fact, it is possible to specify if the transceiver should remain in transmit state after a packet
is transmitted or return to idle state (dually if to remain in receive mode or to go to idle
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 68
after a packet is received). It was chose to set this register four most significant bits to zero,
making the transceiver return to idle after both packet reception and transmission.
The above mentioned registers are the ones that have a biggest impact on the wireless
performance, consequently during the all development phase different settings and
combination were tested. Thus, a source file that automatically configures the transceiver
with the specified settings is created, such file is called setRegisters.c. This file, created
with a Studio RF custom template and then manually modified, is a list of all the register to
program. Instead of using a burst write operation, only those selected registers are
modified with a single write access (as not all the configuration registers have to be
modified from their default values).
5.4 Fixed Frequency Transmission
The first step toward an adaptive FHSS network is to establish a simple peer-to-peer link
over a fixed frequency. All the functions developed in the source files SPI.c and
MicroSetup.c are an essential basis from which the network MAC layer can be developed.
During development, one board will act as a transmitter and the other one as a receiver;
since the Explorer 16 development board is fitted with a serial connection, such board will
be used as the receiver. This will in fact allow to collect and output statistics from the
received data and check the program functioning.
At this point a new source file, called RF.c is created. This file contains all those functions
related to data transmission and reception. One of those is RFreceive, which is designed to
receive data. This function in fact makes the transceiver: enter into receive state, wait for a
packet to be fully received (by using the GDO0 pin as an interrupt), read the RX FIFO,
verify data integrity with a CRC check and return to idle state. This first transmission uses
a fixed length payload size of 50 bytes, plus the addition of the 2 bytes containing link
information for every received packet (this done by setting the PKTLEN register to 0x32,
and both PKTCTRL1 and PKTCTRL0 to 0x04). Also, statistics are collected by updating 4
variables: faulty packets received (CRC_fail), correct CRC checks (CRC_ok), total packets
received (pktcount) and interferences received (interference). Such variables provide useful
information on the link quality under different environments, and are used for
benchmarking the protocol.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 69
The pseudo-code for this function is:
Function RFreceive{
enable communication
when CC2500 is ready
enter in receive mode
wait for full packet reception (GDO0 asserts and de-asserts)
if there is data in the RX FIFO
read out the payload from the RX FIFO (with a burst read)
read the signal strength of the received packet
verify the result of the CRC check (and update the statistics count)
}
To be noted that in this case there is no need to call for a delay function after sending the
receive state strobe. In fact, the next instruction after the strobe is a while loop which will
not exit until a valid sync word is found (the successive instruction is then another while
loop that exits when the packet is fully received). The fact that a valid sync word is
detected implies that the receive mode is already entered, making the delayIDLEtoRX_TX
function useless in this portion of the code. Once a packet is fully received an if statement
verifies that some data are effectively been written in the RX FIFO, this prevents from
reading an empty RX FIFO: if such event occurs, the function considers that as
interference, and updates the interference received variable. The RX FIFO might be empty
even after a packet is received due to CRC fail if the CRC auto-flush option is enabled, or
due to address filtering, or in the unfortunate case that a false sync word was produced by
some interferer. Then, if some data is available to be read, the RX FIFO is scanned with a
burst access, for the entire payload length (except for the two appended byte which are
read with two singles accesses) Finally, a counter keeps statistics by updating the pktcount,
CRC_ok, CRC_fail and interference variables.
To be noted that one of the major problems encountered while developing the RFreceive
function was due to a failure due to a Microchip PIC32 Library function while sampling
the value of the GDO0 pin. Initially, to sample the pin value the function
mPORTDReadBits74
was used, yet with no results. After debugging the code and
analyzing the signals with a spectrum analyzer it was seen that that library function was
not respecting the timing imposed by the C code. To solve this problem an alternative
code, which does not make use of the mPORTDReadBits function is instead implemented.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 70
The reason for such malfunction in the mPORTDReadBits function is still unknown and
was reported to the company website.
As previously mentioned, the Explorer 16 board will act as the receiver so the RFreceive
function will be programmed into such board. Instead, the Starter Kit development board
will act as the transmitter, hence a function nam ed RFsend is programmed into this board.
The function RFsend is designed to fill the TX FIFO with data, send a enter transmit mode
strobe, and then wait until the packet is fully transmitted (by using the GDO0 pin as an
interrupt). In this, and in all the transmissions performed during the project development
the RFsend function will transmit random data. Such random information is only meant to
provide information on the link quality for benchmarking the protocol. Hence, the pseudo
code for the RSsend function is:
Function RFsend{
enable communication
when CC2500 is ready
fill the TX FIFO with random data (50 bytes)
send transmit strobe
wait for full packet transmission (GDO0 asserts and de-asserts)
}
As in the RFreceive function, no delay needs to be implemented after sending the strobe as
the code execution is held by the GDO0 pin interrupt; moreover also for this function the
FIFO is filled by using a burst access for the whole payload length.
Additionally, two more functions were developed for this test: readPower and setPower.
As their name suggest, these two functions read and set the output power level. The output
power is defined by setting the PATABLE, which is a sequence of 8, one byte long
registers. Each table row defines the output power for a different modulation sequence (the
first row sets the output power for frequency shift keying). For accessing the first row of
PATABLE, the address 0x3E must be first called; then every byte sent to the transceiver
will make access the successive table rows. However if the cable select pin is toggled, the
index is reset. Figure 5.8 shows a PATABLE schematic view, while figure 5.9 depicts the
different output power levels available for the CC2500 with the relative current
consumption and register value. For this first test the output power was set at the maximum
value of 1dBm, done by setting the PATABLE at a value of 0xFF.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 71
Figure 5.8 PATABLE Schematic view75
Figure 5.9 Available output power levels75
This first transmission test was successful as it provided a constant wireless peer-to-peer
link. Both the receiver and transmitter board shared the same transceiver configuration as
they both must use the same transmission frequency (fixed in this text in the arbitrarily
chosen channel 3), same modulation (frequency shift keying), same data rate (10 kbaud),
same packet length and all the other above mentioned configuration registers. The link
statistics collected for this kind of link are showed in the next chapter. The next step will
be furthermore develop the code to establish a frequency hopping transmission system.
5.5 Frequency Hopping System
Even though the previous test provided a good wireless link between transmitter and
receiver, operating over a single frequency is heavily subjected to interference and is not
the aim of this project. Instead, as discussed in chapter 3, a FHSS protocol must be
implemented in the transmission protocol. In this section will be discussed the
development of a FHSS transmission link, again taking place between a transmitting
device (Started Kit) and a receiver (Explorer 16). The channels pattern used in this FHSS is
predetermined and stored in the transmitter device.
In order to make the wireless link constantly operate over a different frequency, several
modifications must be made to the previous program. Above all, the key new features to
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 72
add in the new program are: a function to successfully change and calibrate frequency, and
a method to keep the transmitter and receiver synchronized on the frequency to use.
Changing the carrier frequency, hence the channel, during transmission is done by
following these steps:
go to idle state
put the new channel in the channel register
run calibration
wait for the PPL to be locked
return to receive/transmit mode
These are the steps to be followed for changing channel and calibrating the frequency
synthesizer to the new carrier frequency. Calibrating the new frequency is necessary as the
VCO characteristics vary with the operating frequency, temperature and supply voltage76
.
Such calibration can be performed by calling a calibration strobe and, as figure 5.3 shows,
such operation takes a determined amount of transceiver clock cycles. Therefore, a delay
function that waits for that amount of time can be created (as showed in the paragraph 5.1).
To furthermore ensure that the Phased-Locked Loop (PLL) is „locked‟ with the new carrier
frequency the register FSCAL1 can be read: in fact, if such register has a content value
different than 0x3F means that the PLL is in lock. Consequently to new functions are
created: waitPLLinLock and changeChanell.
The first one consists in a while loop, which is exited only once the content of the FSCAL1
register is different than 0x3F. Effectively putting the program execution on hold until the
PLL is in lock.The latter instead is the complete function to be called when a channel
change is desired (as a matter of fact this function includes the waitPLLinLock code). The
pseudo code for the changeChannel function is:
Function changeChannel{
go to idle
wait to change state into idle
write the new channel value into the channel register
run calibration
wait to perform calibration
verify PLL is in lock
}
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 73
Therefore by only calling the function changeChannel, allows the transmission system to
change its operating frequency.
Nevertheless, each time the changeChannel function is called, data transmission is
interrupted; the time spent changing time is also commonly called „blanking time‟.
The low blanking time is a good figure of merit for a FHSS transceiver. The blanking time
for the changeChannel function can be calculated as:
IDLE STROBE 5x10-6
s +
CHANGE STATE TIME (RX/TX to IDLE) 0.18 x10-6 s +
WRITE NEW CHANNEL IN REGISTER 10 x10-6 s +
SEND CALIBRATION STROBE 5 x10-6 s +
CALIBRATION TIME 750 x10-6 s +
READ OPERATION (PLL in lock check) 10 x10-6 s +
SEND RX STROBE 5x10-6
s +
CHANGE STATE TIME (IDLE to RX/TX) 93.75 x10-6
s =
__________
878.93 x10-6
s
Such value takes into account every step involved in changing channel and also the SPI
communication speed (200 Kbaud). These figures are then believed to be more realistic
than what stated in the CC2500 datasheet (810 us76
), which do not consirer the time spent
to send instructions over the SPI interface (in fact, if the SPI is ignored the blanking time is
found to be 809.5us, but this is not a realistic figure).
A blanking time of 878.93 us allows a maximum frequency hopping rate of about 1137
hops per second (constantly changing channel without sending any data). Yet, even a
much lower hopping rate is more than adequate for the application required and also fulfils
the international and national regulations for FHSS systems. For example if 4 packets are
sent between each hop (transmitting with a data rate of 10 kbaud, a 2-FSK modulation and
a payload size of 52 bytes), the time elapsed between two consecutive hopes (also called
dwell time) would be:
𝑑𝑤𝑒𝑙𝑙𝑡𝑖𝑚𝑒 = 1
10 ×103 × 52 × 4 = 20.8 𝑚𝑠 equation 5.4
A dwell time of 20.8 ms is well smaller than the maximum dwell time dictated by the ETSI
EN 300 440 regulation (which corresponds to a dwellmax=0.4s36
).
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 74
There is also another technique for changing channels more rapidly, such method will be
showed later on in the chapter. However, calibrating the frequency synthesizer for every
new channel, especially for a low-cost module, is the most reliable solution and therefore
offers the best performances.
The other key issue for a FHSS system is the frequency synchronization between
transmitter and receiver. In the early system development synchronization was kept by
making both receiver and transmitter change channel after a predefined amount of packets.
This technique was proven to be quite weak as if the receiver loses just one packet the
whole frequency synchronization is lost.
Hence, to produce a more robust protocol, the RFsend and RFreceive functions were
modified. Instead of just sending 50 bytes of payload, these function have been modified to
transfer 50 bytes of data plus 2 extra bytes. The first of the two extra bytes is named the
„instruction byte‟, while the second one is the „new channel byte‟. With this update, the
transmitter constantly sends the payload, instruction and new channel bytes with every
packet. Both wireless boards start communication in the same channel (channel 0 by
default), then when the transmitter „decides‟ to change channel, it starts sending an change
channel instruction and a new channel along with the payload. The receiver checks the
instruction for every packet received and, once the change channel instruction is detected,
it automatically changes into the channel specified in the „channel byte‟.
The pseudo code for theupgraded RFsend and RFreceive functions is:
Function RFsend{
enable communication
when CC2500 is ready
fill the TX FIFO with random data (50 bytes)
send instruction byte
send new channel byte
send transmit strobe
wait for full packet transmission (GDO0 asserts and de-asserts)
}
Function RFreceive{
enable communication
when CC2500 is ready
enter in receive mode
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 75
wait for full packet reception (GDO0 asserts and de-asserts)
if there is data in the RX FIFO
read out the payload from the RX FIFO (with a burst read)
read the instruction byte
read the new channel byte
read the signal strength of the received packet
verify the result of the CRC check (and update the statistics count)
}
With this technique, the transmitter can constantly control in what channel the receiver
should be positioned; thus, the transmitter acts as a master for the wireless communication.
The frequency at which channel is changed, and the channel number is only determined by
the transmitting board.
This synchronization method proved to be a much more robust one, especially in the
presence of interferer. On the other hand, synchronization could be lost if the packet
containing the „change channel‟ instruction (and the new channel) is corrupted or lost. To
prevent this from happening, the transmitter is programmed to send that instruction in more
than one packet, assuring frequency synchronization.
With such software a FHSS communication link was established, greatly improving
performances in electromagnetically crowded environments. However, as for this protocol
the channels pattern was predetermined, the link is still prone to interference, such as
wireless LANs and Bluetooth devices. To solve such issue, in the next section an adaptive
FHSS protocol will be developed.
5.6 Adaptive Frequency Hopping System
In the previous FHSS link the master, that instructs the receiver on what channel to use,
follows a channel pattern previously stored in its memory. This method, even if benefits
from the advantages of a spread spectrum technique, does not adapt to the surrounding
environment. Consequently, it is not capable of avoiding particularly crowded channels.
To overcome this problem a function called scan is developed and added to the existing
FHSS software. This function, before any transmission is started, senses the signal power
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 76
for every channel, effectively scanning the all ISM spectrum. This is possible by reading
the content of the Received Signal Strength Indication (RSSI) register, found at the 0xF4
address. In fact, every time the transceiver enters in receive mode this register is constantly
updated with a value proportional to the RF power sensed in that channel. Therefore, if all
channels are scanned before any transmission is started, the transmitter can store the RSSI
level and use for transmission only those channels with the lowest sensed RF power.
Consequently, the transmission between the two development board will take place only
on those channels not currently used by other devices, therefore it adapts to the
surrounding environment. Furthermore, the transmission between the device should be
stopped regularly to allow a new scan to take place, allowing to update the environment
status. This methods allow to constantly use just those channels not used by other
protocols. To be noted that at the beginning of transmission both devices are by default set
into channel 0. Once the transmitter has performed the ISM scan, it will start
communicating the receiver the channels to use.
More in detail, the pseudo code for the scan function is:
Function scan{
for every channel
read the RSSI value
convert the value into a dBm number and save it into an array
save into an array the best 50 channels (those with the lowest RSSI value)
}
More in detail, this fairly elaborated function saves a list of the 50 (out of the total 256)
electromagnetically quietest channels, saving them into an array where the first position is
occupied by the best channel, hence the first one to use. If two channels are found having
the same low RSSI readings, both of them are added to the list as both of them are suitable
for transmission. The list of the channels to use is elaborated by the transmitter board,
which will use all of them one by one in crescent order. Will in fact be the transmitter to
instruct the receiver when to change into the next best channel. During development phase
was chosen to use each best channel for the transmission of 4 packets and to use the same
best channel list for 3 times, before executing another environment scan. However these
parameters can easily be changed to suit the final product needs.
The more often the scan function is ran, the safer the transmission is; this due to the fact
that having an updated scan of the surrounding area allows to avoid those systems that
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 77
could have possibly be turned on after the previous scan was performed (for example
someone walking in the room with a Bluetooth device turned on).
On the other hand, as the Texas Instruments Design Note DN505 shows, in order to make a
reliable RSSI reading, the transceiver should spend a minimum amount of time in receive
mode for every channel (at least 376 us to properly read a strong RF signal when the data
rate is set at 10kbaud). In addition, since all the 256 channels have to be scanned, the
changeChannel function is called 255 times, furthermore increasing the time required to
fully execute the band scan. Consequently, calling the scan often sensibly reduces the
overall network throughput.
In the final product a trade off must be made, evaluating the rate of change in the
environment in which the system is installed.
5.7 Variable Base Adaptive Frequency Hopping System
The protocol depicted in the previous section offers an adaptive FHSS wireless system,
however it has one weak point. As a matter of fact, at system start up both devices are by
default set to channel 0 (called the base frequency). It will be in fact from this channel that
the transmitter will start communicating to the receiver the best channels to use. Once the
receiver has received the first packet (over channel 0), it will then follow the channel
pattern dictated by the transmitter. The intrinsic problem with this approach is in the fact
that no communication would be possible if channel 0 is heavily used by another network
protocol. Nevertheless, as most wireless routers have as default setting the Wi-Fi channel
1, the transceiver channel 0 (which corresponds to the very beginning of the 2.4 GHz ISM
band) is likely to be electromagnetically busy. This will not allow any initial link between
the transmitter and receiver, resulting in a total system failure.
To solve this problem two new functions are added to the previous protocol:
scanAndPosition and SearchBase. Respectively added to the receiver and to the
transmitter.
The function scanAndPosition is implemented in the Explorer 16 board, which still acts a
receiver. This function makes the receiver scan the entire ISM band looking for the
channel with the lowest RSSI reading, hence the best one to use. Once the receiver has
found the electromagnetically quietest channel, independently tunes into it. It therefore
changes its default base channel depending on the surrounding environment. The code for
this function is very similar to the transmitter scan function, for the exception that when the
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 78
receiver finds the very best channel automatically tunes into that frequency. At this point,
the receiver is positioned into a variable base frequency waiting for communication from
the transmitter.
The function SearchBase, which is programmed into the transmitter, is called at the very
beginning of the communication protocol. This function makes the transmitter board send
a packet to every single channel of the ISM, looking for an answer from the receiver. In
fact, as the base frequency is variable, the receiver does not know in which channel the
receiver is awaiting communication. After sending a packet, the receiver awaits (for a fixed
amount of time) a possible answer from the receiver. If no signal is received from the
receiver, the transmitter assumes that the channel currently sampled is not the one chosen
by the receiver as a base frequency and therefore moves on sampling the next one. Once an
answer is found, the transmitter cease the base channel search and acquires the current
channel as the communication base channel. From that moment on, data transfer can start
as showed in the previous FHSS system, with the exception that the base frequency is not
the default channel 0 but the channel chosen by the receiver.
Given the relatively short distance between two sound masking system nodes (5 to 10
meters), it is assumed that the quietest channel found by the receiver board can be likely to
host data transmission. However, if for any reason the transmitter (after scanning all the
256 channels) has not received any base channel acknowledgement from the receiver,
restart the search from channel one. In fact, the transmitter is programmed to run an
indefinite number of scans in order to find the base channel.
Figure 5.10 shows a synthetic view of the program flow.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 79
This FHSS transmission protocol is believed to be robust against interference, especially
when large parts of the spectrum are occupied by other network protocols (for example
wireless LANs). It is then believed to fulfil the project technical requirements.
Nevertheless, the receiver is programmed to store link statistics (storing the number of
corrupted packets and interference received). In the chapter system testing and
performance this program will be benchmarked under different ranges and environments.
TRANSMITTER RECEIVER
SCAN AND POSITION
WAITING IN BASE
TO SEND
ACKNOLEDGMENT
START RECEIVING DATA
SEARCH BASE
PROBING EVERY
CHANNEL LOOKING
FOR BASE
START SENDING DATA
AND HOPPING
INSTRUCTIONS
PACKET RECEIVED,
ACKNOLEDGMENT SENT
DATA
TRANSFER
ACKNOLEDGMENT RECEIVED,
BASE FOUND
Figure 5.10 Variable Base Adaptive Frequency Hopping System program flow
SCAN FOR 50
BEST CHANNELS
POWER ON POWER ON
TRANSCEIVER CONFIGURATION TRANSCEIVER CONFIGURATION
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 80
5.8 Network Setup
At this phase of the project a robust adaptive FHSS transmission protocol has been
developed. Such protocol allows peer-to-peer data transmission even in presence of other
wireless devices in the same band. However, one last project requirement needs to be
addressed, the network setup. As specified in the project requirements section, the wireless
transmission system must be able to deliver information to a whole network of nodes, not
just deliver information in a peer-to-peer link.
As only two wireless boards were available during development phase, such network of
nodes could only be simulated. Nevertheless, the lack of physical nodes does not prevent
from design the protocol to support such network. Taking the adaptive peer-to-peer FHSS
transmission protocol as foundation, the feature to send data to different nodes can be
added. As figure 5.7 depicts, the CC2500 supports in the packet format an address byte.
This method makes available a maximum number of 255 addresses, which are enough for
the average sound masking system. Nevertheless, this number could be increased to 65536
by using two bytes as an address field (but this solution has to be implemented in the
protocol as not implemented in the CC2500 packet handling).
Therefore, to setup a network of multiple nodes each transceiver must be assigned with a
unique network address (ranging from 1 to 256, included) and must have the address check
enabled in the PKTCTRL1 register. In this configuration, every time a node sends a packet
it must include, before the actual payload, the destination address for that packet
(information could be either addressed to one single node or broadcasted to the whole
network). The packet, even if received by all the nodes in the communication range, will
only be acquired by the designed recipient. In fact, the CC2550 automatically filters out the
packet payload if the receiver network address does not match with the address field
included in the packet. During the developing stages the transmitter was arbitrarily given
the network address of 0x01 and receiver 0x02.
This technique effectively allows every packet to be delivered only to the intended network
nodes. To include such feature in the existing protocol some upgrades have to be made.
Since one more byte will be included for every packet, the PKTLEN register must be
incremented by one unit; and the two least significant bits of the PKTCTRL1 must be set
to 2 (broadcast delivery enabled).
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 81
As the recipient address field must be included before the payload during transmission, the
RFsend function contains now 3 paramenters (instruction, new channel, recipient address).
The correspondent pseudo code is:
Function RFsend{
enable communication
when CC2500 is ready
send recipient address
fill the TX FIFO with random data (50 bytes)
send instruction byte
send new channel byte
send transmit strobe
wait for full packet transmission (GDO0 asserts and de-asserts)
}
To be noted that the function RFreceive does not need to be modified thanks to the RX
FIFO „if‟ statement included. In fact, even if a packet is fully received (asserts and de-
asserts the GDO0 pin) the RX FIFO will not be read if the payload has been filtered out by
the address check. This means that if a packet is received, and its content fills the RX
FIFO, such packet has a matching address byte and is meant to be received.
By using this version of the transmission protocol, it is possible to sort packets within the
network still using a FHSS transmission. Hence, with this final version, the protocol
complies with the project requirements and therefore it is suitable to be implemented as a
sound masking wireless transmission system.
5.9 Variable Base Adaptive Fast Frequency Hopping System
The updated network protocol showed in the previous section can be seen as the project
final stage as it fulfils the system requirements. Yet, further development was made to the
protocol. That next step has not been requested by the sound masking system company,
and represents only a technical exercise to make use of other options offered by the
CC2500 transceiver. It is in fact possible to greatly reduce the actual system blanking time,
increasing the overall link throughput.
As demonstrated in section 5.5, using the function changeChannel to hop from one
frequency to another allows achieving an adequate frequency-hopping rate. In actual fact,
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 82
even calibrating each new carrier frequency, results in a blanking time inferior to a
millisecond. The blanking time is a delay resulting from the sum of different transceiver
processes; although, when calling the changeChannel function the main delay is the time
needed for the transceiver to calibrate the frequency synthesizer. Every time a frequency is
calibrated, the resulting parameters are saved in the transceiver registers: FSCAL1,
FSCAL2, FSCAL3. These registers are update with new values every time a new channel
is calibrated.
It is then possible before starting the data transmission, to run the calibration and save the
respective results in the microcontroller memory, this for each channel that is going to be
used. Once the calibration results are saved in memory, when a new channel has to be used
the results relative to that frequency could be recalled and substituted into the FSCAL
registers, this would avoid running a new calibration. Therefore if an array is created,
containing the calibration results for each channel that is going to be used, the change
channel operation would only require a writing those results into the FSCAL registers,
cutting the blanking time.
IDLE STROBE 5x10-6
s +
CHANGE STATE TIME (RX/TX to IDLE) 0.18 x10-6 s +
WRITE NEW CHANNEL IN REGISTER 10 x10-6 s +
WRITE IN FSCAL1 10 x10-6 s +
WRITE IN FSCAL2 10 x10-6 s +
WRITE IN FSCAL3 10 x10-6 s +
SEND RX STROBE 5x10-6
s +
CHANGE STATE TIME (IDLE to RX/TX) 93.75 x10-6
s =
__________
143.93 x10-6
s
Using the previously stored calibration results reduces the blanking time to only 143.93us;
therefore, by applying fast hopping the overall transmission data rate will increase. On the
other hand, changes in operating temperature and frequency drift tend to degrade the
wireless capabilities; therefore, fast hopping transmissions tend are likely to have a lower
performance in terms of link quality. This will be showed in the next chapter where this
system will be benchmarked and confronted with the standard hopping protocol.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 83
As for the previous protocol version, the transmitter will choose the 50 best channel to
transmit, while the receiver will decide which channel to use as a the base. To store the
calibration results for each of those 51 channels a new C structure type is defined in the
code. The structure includes three byte type variables, since the calibration results for each
channel are stored in three different transceiver registers. After the transceiver has
acknowledged what base channel to use, and has selected the 50 best frequencies, a loop
calibrates each channel that is going to be used. The calibration results are then saved into
an array of the structure previously defined. To make the receiver pre-calibrate all the
channels that are going to be used, the best channel list is sent from the transmitter to the
receiver over the base channel. Once the receiver has acquired the list of the 50 channels
chosen by the transceiver, it will calibrate each one of them; preparing the results for the
fast hopping. From this point on every time the transmission channel needs to be changed,
a function called changeChannelFast will substitute the previously stored calibration
results (relative to that specific channel number) into the transceiver registers; this avoids
running a new calibration for each new hop and effectively reduces the blanking time.
The fast hopping program flow can be synthetically depicted as figure 5.11 shows on the
next page.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 84
TRANSMITTER RECEIVER
POWER ON
SCAN AND POSITION
WAIT IN BASE TO
SEND
ACKNOLEDGMENT
POWER ON
SEARCH BASE
PROBE EVERY
CHANNEL LOOKING
FOR BASE
PACKET RECEIVED,
ACKNOLEDGMENT SENT
ACKNOLEDGMENT RECEIVED, BASE
FOUND AND CALIBRATED
Figure 5.11 Variable Base Adaptive Frequency Hopping System program flow
START RECEIVING DATA START SENDING DATA
AND HOPPING
INSTRUCTIONS
DATA
TRANSFER
SCAN FOR 50 BEST
CHANNELS AND
TRANSMIT LIST
WAIT FOR BEST
CHANNEL LIST
CALIBRATE BEST
CHANNELS
CALIBRATE BEST
CHANNELS
LIST RECEIVED
TRANSCEIVER CONFIGURATION TRANSCEIVER CONFIGURATION
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 85
Chapter 6
System Testing and Performance
In this chapter will be represented the results of various tests conducted to measure the
transmission system performance. The main figures of merit used to characterize the
system are: packet error rate, payload length, communication range, and immunity to
different sources of interference. For all the tests, the transmitter output power is set to
1dBm, the transmission data rate has been fixed to 10kbaud and the modulation used is 2-
FSK (Frequency Shift Keying). These fixed parameters are believed to be the most
adequate solution for the project needs and will not therefore be modified. All the others
main parameters and the test conditions involved, instead, will be mentioned for each test.
6.1 Range Test
This series of tests are aimed to verify how the distance between transmitter and receiver
affects the received signal strength. Non-ideal components and fabrication defects may
give the system different performances than what theoretically calculated. The real
received signal strength is measured through the reading of the RSSI value attached on the
first byte after the payload of each packet. The source code used to perform the tests and to
output the results is provided in this document appendix.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 86
Link Range
[meters]
TX Antenna Orientation
TX Antenna Orientation
RSSI value
[dBm]
10 XZ
(antenna long axis on X)
XZ
(antenna long axis on X) -68
10 XY
(antenna long axis on X)
XY
(antenna long axis on X) -76
10 XY
(antenna long axis on Y)
XY
(antenna long axis on Y) -78
28 XZ
(antenna long axis on X)
XZ
(antenna long axis on X) -72
28 XY
(antenna long axis on X)
XY
(antenna long axis on X) -79
28 XY
(antenna long axis on Y)
XY
(antenna long axis on Y) -80
Table 6.1 Test Results
This test results are compatible from what expected: the real received signal strength is
lower that what theoretically calculated (equation 4.3), this due to hardware imperfections.
Furthermore, it has been verified that the worst antenna performance occurs when both
transmitter and receiver are oriented with their long axis on the Y-axis.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 87
6.2 Variable Base Adaptive FHSS System Test
These results have been collected to test the efficiency of the network protocol discussed
on section 5.7. Different payload and ranges have been tested, making the protocol work
under different electromagnetic environments. However all tests have been performed
sending a total number of 1000 packets (containing random data) with a data rate of 10
kbaud and transmitter output power set at 1dBm. The full transceiver configuration can be
seen in the code provided in the document appendix.Table 6.2, 6.3, 6.4, and 6.5 show the
test results of the Variable Base Adaptive Frequency Hopping System.
PAYLOAD
LENGTH [BYTES]
LINK RANGE
[meters] INTERFERANCE
CRC
FAIL
PACKETS
LOST
FALSE PACKET
RECEIVED
52 2, line of sight none 0 0 0
52 2, line of sight
Bluetooth device
(class 1)
transmitting in
between transmitter
and receiver
12 0 0
52 2, line of sight
Bluetooth device
(class 1) 5 meters
apart from both
transmitter and
receiver
9 0 0
52 2, line of sight
Wi-Fi channel 1
(router D-
Link802.11g using
full bandwidth)
2 0 0
52 2, line of sight
Wi-Fi channel-1
(router D-
Link802.11g using
full bandwidth) +
Bluetooth device
(class 1) 5 meters
apart from both
transmitter and
receiver
8 0 0
Table 6.2 Test Results
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 88
PAYLOAD
LENGTH [BYTES]
LINK RANGE
[meters] INTERFERANCE
CRC
FAIL
PACKETS
LOST
FALSE PACKET
RECEIVED
5 2, line of sight none 0 0 0
5 2, line of sight
Bluetooth device
(class 1)
transmitting in
between transmitter
and receiver
5 0 0
5 2, line of sight
Bluetooth device
(class 1) 5 meters
apart from both
transmitter and
receiver
3 0 0
5 2, line of sight
Wi-Fi channel 1
(router D-
Link802.11g using
full bandwidth)
0 0 0
5 2, line of sight
Wi-Fi channel-1
(router D-
Link802.11g using
full bandwidth) +
Bluetooth device
(class 1) 5 meters
apart from both
transmitter and
receiver
1 0 0
Table 6.3 Test Results
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 89
PAYLOAD
LENGTH [BYTES]
LINK RANGE
[meters] INTERFERANCE
CRC
FAIL
PACKETS
LOST
FALSE PACKET
RECEIVED
52 15, line of sight none 36 0 0
52 15, line of sight
Bluetooth device
(class 1)
transmitting in
between transmitter
and receiver
41 0 0
52 15, line of sight
Bluetooth device
(class 1) 10 meters
apart from both
transmitter and
receiver
35 0 0
52 15, line of sight
Wi-Fi channel 1
(router D-
Link802.11g using
full bandwidth)
103 0 0
52 15, line of sight
Wi-Fi channel-1
(router D-
Link802.11g using
full bandwidth) +
Bluetooth device
(class 1) 10 meters
apart from both
transmitter and
receiver
101 0 0
Table 6.4 Test Results
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 90
PAYLOAD
LENGTH [BYTES]
LINK RANGE
[meters] INTERFERANCE
CRC
FAIL
PACKETS
LOST
FALSE PACKET
RECEIVED
5 15, line of sight none 2 0 0
5 15, line of sight
Bluetooth device
(class 1)
transmitting in
between transmitter
and receiver
7 0 0
5 15, line of sight
Bluetooth device
(class 1) 10 meters
apart from both
transmitter and
receiver
6 0 0
5 15, line of sight
Wi-Fi channel 1
(router D-
Link802.11g using
full bandwidth)
26 0 0
5 15, line of sight
Wi-Fi channel-1
(router D-
Link802.11g using
full bandwidth) +
Bluetooth device
(class 1) 10 meters
apart from both
transmitter and
receiver
29 0 0
Table 6.5 Test Results
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 91
Table 6.6 shows the test results of the Variable Base Adaptive Frequency Fast Hopping
System:
PAYLOAD
LENGTH [BYTES]
LINK RANGE
[meters] INTERFERANCE
CRC
FAIL
PACKETS
LOST
FALSE PACKET
RECEIVED
52 2, line of sight none 0 0 0
52 2, line of sight
Bluetooth device
(class 1)
transmitting in
between transmitter
and receiver
18 0 0
52 2, line of sight
Bluetooth device
(class 1) 5 meters
apart from both
transmitter and
receiver
21 0 0
52 2, line of sight
Wi-Fi channel 1
(router D-
Link802.11g using
full bandwidth)
4 0 0
52 2, line of sight
Wi-Fi channel-1
(router D-
Link802.11g using
full bandwidth) +
Bluetooth device
(class 1) 5 meters
apart from both
transmitter and
receiver
7 0 0
Table 6.6 Test Results
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 92
Table 6.7 shows the test results of the Variable Base Adaptive Frequency Hopping System
when between the transmitter and the receiver boards two walls are present. These walls
are thin plasterboard walls, which could symbolize the type of obstruction represented by
typical office ceiling tiles.
PAYLOAD
LENGTH [BYTES]
LINK RANGE
[meters] INTERFERANCE
CRC
FAIL
PACKETS
LOST
FALSE PACKET
RECEIVED
52
5, two walls
between
transmitter and
receiver
none 0 0 0
5
5, two walls
between
transmitter and
receiver
none 0 0 0
Table 6.7 Test Results
The test results show that the developed transmission protocol can achieve acceptable
packet error rates even in presence of strong interferer. In fact, during the tests the Wi-Fi
router was set to transmit with an output power of 20dBm (the maximum allowed for
wireless LANs in the 2.4 GHz34
), which is well above the 1dBm used by the CC2500
transceiver. Nevertheless, the interference produced by wireless LANs is the easiest to
avid, as the portion of the spectrum used by that protocol is fixed. Conversely, the
interference produced by Bluetooth devices was found harder to avoid, as the frequency
used by that protocol continuously change (as previously mentioned Bluetooth uses
FHSS). Since both the Bluetooth start frequency and channel width are known (section
3.3.2), the transmission system has been programmed to use a start frequency and channel
width designed to avoid Bluetooth channels (see setRegisters.c for detail). However, as
both Bluetooth and the transmission system developed use a pseudo random channel
pattern, eventually some packet collision can happen. In fact, if by chance the same
frequency (or the same small portion of the spectrum) is used by both systems at the exact
same time, an error will occur. Those errors can be detected by the CRC check and have to
be taken into account in common wireless systems.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 93
The system configuration tested that was less susceptible to interference is the one using
the standard hopping method with a payload of 5 bytes. A smaller payload size reduces the
time necessary to transmit a single packet, hence reduces the time spent in each channel
(the number of packets transmitted per channel is fixed). On the other hand, this reduces
the network throughput, as more each packet contains less data.
For the final product production, is then strongly advised to use the smaller payload size
compatible with the required data rate. Moreover, depending on the quality of the
components and on the type of antenna used, the data rate could be increased up to
500kbps44
. When transmitting real data some CC2500 additional features can be used
(such as data blanking, forward error correction or Manchester encoding).
The configuration provided in the source code file setRegisters.c fulfils the projects
requirements; however, according to the final product needs (packet error rate, data rate,
range), such configuration can be furthermore tuned using the many CC2500 features to
suit specific usage.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 94
Chapter 7
Conclusions and Further Work
In this document have been showed the main steps followed to develop the prototype MAC
layer of a wireless transmission system. As the 2.4 GHz ISM band tends to get always
more electromagnetically crowded, coexistence in this band between many different
protocols is a present and growing issue. The technique exploited to solve what can be seen
as a interference related problem is Frequency Hopping Spread Spectrum. As a result
FHSS is a growing technology becoming more and more widely used. Implementing such
method has given the results shown on chapter 6, achieving what is believed to be an
acceptable link even in case of strong interference; in real life situations such interference
are likely to be less intense.
Given the project requirements, the first step taken was selecting the band of operation.
The wireless transmission system was required to operate within an unlicensed frequency
range and the 2.4 GHz ISM band was chosen because it is found worldwide and
transceiver manufacturers produce a vast products selection. The hardware components
were then chosen, selecting only low-cost devices fully compatible with the required
performances. For speeding up the hardware assembly and testing, development boards
and pre-assembled modules were used; this project did not involve any hardware design.
As a matter of fact, the whole focus of the dissertation was the development of a FHSS
network MAC layer. For producing a working protocol, the approach followed was to
achieve protocol key functionalities step by step. The network protocol in fact was built
from ground up following the procedure shown throughout chapter 6. The final protocol,
presented in chapter 5.8, addresses all the project requirements. In fact, the adaptive
channel selection ensures a reliable communication even when different potions of the
spectrum are being used by other protocols; while the communication between multiple
nodes is supported by the implementation of a network destination address for every
packet sent.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 95
Further development could be done in designing a time-based synchronization. In the
present protocol, synchronization is kept thanks to the addition of an instruction and a new
channel byte appended to every packet sent. To ensure a robust synchronization every
channel hop is sent multiple times. However, sending this delicate information could be
inconvenient, especially if the channel pattern is intended to be secret (for military
applications). In fact with the present system, the information on the next channel to use is
sent in the open range; making possible, once a packet is intercepted, to completely follow
the transmission channel pattern. If for any reason the communication channel pattern is
wanted to be secret, synchronization could be kept by storing a predefined subset of
channels into all devices, also specifying the moment in time for each hop. With this
method, all the devices involved in the communication would change channel according to
a list stored inside their memory at predetermined moments in time.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 96
References
1: Sound Masking Installation image, American Sound Masking,
http://www.americansoundmasking.com/faq.html [accessed on 19/08/09];
2: Embedded System Projects, Manchester, UK.
3: Frequency Hopping Spread Spectrum, http://en.wikipedia.org/wiki/Frequency-
hopping_spread_spectrum [accessed on 19/08/09];
4: Frequency Hopping Systems Application Note AN014, page: 3 of 7, Chipcon Products
from Texas Instruments;
5: Typical Sound Masking System statistics, Embedded System Projects, Manchester, UK;
6: Typical Sound Masking System statistics, page 3 of 4, Embedded System Projects,
Manchester, UK;
7: Typical Sound Masking System statistics, page 2 of 4, Embedded System Projects,
Manchester, UK;
8: Behrouz A. Forouzan, “Data Communications and Networking”, 3rd
edition, page 364 of
972, McGraw Hill;
9 Behrouz A. Forouzan, “Data Communications and Networking”, 3rd
edition, page 372 of
972, McGraw Hill;
10: International Telecommunication Union, http://www.itu.int/en/pages/default.aspx
[accessed on 23/07/09];
11: International Telecommunication Union region,
http://en.wikipedia.org/wiki/International_Telecommunication_Union_region [accessed on
05/07/09];
12: The European Conference of Postal and Telecommunications Administrations,
http://www.cept.org/ [accessed on 06/08/09];
13: European Telecommunications Standards Institute,
http://www.etsi.org/WebSite/homepage.aspx [accessed on 07/08/09];
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 97
14: Federal Communications Commission, http://www.fcc.gov/ [accessed on 05/08/09];
15: Association of Radio Industries and Business , http://www.arib.or.jp/english/ [accessed
on 12/08/09];
16: Office of Communications, http://www.ofcom.org.uk/ [accessed on 02/08/09];
17: Federal Network Agency for Electricity, Gas, Telecommunications, Post and Railway,
http://www.bundesnetzagentur.de/enid/xn.html [accessed on 02/08/09];
18: Ministero delle Comunicazioni, http://www.comunicazioni.it [accessed on 03/08/09];
19: Ministere de l'Econonie des Finances et des L'Industrie, http://www.minefe.gouv.fr/
[accessed on 02/08/09];
20: Industrial and Scientific Band, http://en.wikipedia.org/wiki/ISM_band [accessed on
06/08/09];
21: Unlicensed Spectrum | ICT Regulation,
http://www.ictregulationtoolkit.org/en/Section.2843.html [accessed on 02/06/09] ;
22: ZigBee Alliance, http://www.zigbee.org/ [accessed on 04/07/09];
23: SRD Regulations for license-free transceiver operation in the 2.4 GHz band,
Application Note AN032, table 1, page 5 of 28, SWRA060, Chipcon Products from Texas
Instruments;
24: European Frequency Information System –ERO, document: EN 301893,
http://www.efis.dk/views2/search-
documents.jsp?action=search&low=5&high=6&unit=GHz&applicationterm=-
1&user=1&documenttype=-1&sortingcolumn=0&submitSearch=Search, -table from drop
down menu- [accessed on 25/06/09];
25: 802.11n: Next-Generation Wireless LAN Technology,
http://www.broadcom.com/collateral/wp/802_11n-WP100-R.pdf, page 4 [accessed on
9/05/09];
26: Jin-Shyan Lee, Yu-Wei Su, and Chung-Chou Shen, “A Comparative Study of
Wireless Protocols: Bluetooth, UWB, Zigbee, and Wi-Fi”, page 3 of 6, Industrial
Technology Research Institute (ITRI) Hsinchu, Taiwan, 2007;
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 98
27: List of WLAN channels, http://en.wikipedia.org/wiki/List_of_WLAN_channels
[accessed on 10/05/09];
28: IEEE 802.11, http://en.wikipedia.org/wiki/IEEE_802.11 [accessed on 06/05/09];
29: IEEE 802.11, Graphical representation of Wi-Fi channels in 2.4 GHz band,
http://en.wikipedia.org/wiki/IEEE_802.11 [accessed on 06/05/09];
30: Behrouz A. Forouzan, “Data Communications and Networking”, 3rd
edition, page 375
of 972, McGraw Hill;
31: Jin-Shyan Lee, Yu-Wei Su, and Chung-Chou Shen, “A Comparative Study of
Wireless Protocols: Bluetooth, UWB, Zigbee, and Wi-Fi”, page 2 of 6, Industrial
Technology Research Institute (ITRI) Hsinchu, Taiwan, 2007;
32: SimpliciTI Network Protocol,
http://focus.ti.com/docs/toolsw/folders/print/simpliciti.html, [accessed on 10/05/09];
33: ERC Recommendation 70-03, European Conference of Postal and
Telecommunications Administrations, June 2009;
34: ETSI EN 300 440-2 V1.1.1 (2001-09), European Telecommunications Standards
Institute, reference: REN/ERM-RP08-0406-2;
35: SRD Regulations for license-free transceiver operation in the 2.4 GHz band,
Application Note AN032, page 11 of 28, SWRA060, Chipcon Products from Texas
Instruments;
36: SRD Regulations for license-free transceiver operation in the 2.4 GHz band,
Application Note AN032, page 13 of 28, SWRA060, Chipcon Products from Texas
Instruments;
37: © Copyright 1995-2009 Texas Instruments Incorporated;
38: ©2009 Motorola Inc.;
39: ©2009 Microchip Technology Inc.;
40: Feasibility Study Report, page 11 of 18, Flavio Felici, University of Manchester 2009;
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 99
41: PIC32MX360F512L main features,
http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en532441 [accessed
on 20/08/09];
42: PIC32MX360F512L home page,
http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en532441 [accessed
on 27/08/09];
43: RF Micro Devices, Inc. (RFMD®);
44: Low-Power RF Guide, page 33 of 43, http://focus.ti.com/lit/sg/slab052b/slab052b.pdf
Texas Instruments Incorporated;
45: “Tutorial for Personal Mobile Communications 2009” page 1 of 4, Dr. D K C So,
University of Manchester 2009;
46: “CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver” page 19 of 92, Chipcon
Products from Texas Instruments, version of 2007-11-29;
47: Explorer 16 Development Board,
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&d
DocName=en024858 [accessed 04/08/09], ©2009 Microchip Technology Inc;
48: Quasar UK Ltd, http://www.quasaruk.co.uk/acatalog/index.html, [accessed 04/08/09];
49: “Explorer 16 Developing Board Datasheet”, page 36 of 46, ©2009 Microchip
Technology Inc;
50: “CC2500 2.4 GHz Transceiver Module Datasheet”, page 2 of 6, Quasar UK Ltd.;
51: “PIC32 Starter Kit”,
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2615&d
DocName=en532453, [accessed 04/08/09], ©2009 Microchip Technology Inc;
52: PIC32 Starter Kit bottom view image,
http://farm3.static.flickr.com/2046/2510143398_10822ee5f7.jpg?v=0 [accessed 09/08/09];
53: I/O Expansion Card,
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2615&d
DocName=en535444, [accessed 09/08/09], ©2009 Microchip Technology Inc;
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 100
54: MPLAB Integrated Development Environment,
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&d
DocName=en019469&part=SW007002, [accessed 09/08/09], ©2009 Microchip
Technology Inc;
55 “SPI Access Design Note DN503”, page 3 of 9, Chipcon Products from Texas
Instruments;
56: “SPI Access Design Note DN503”, page 4 of 9, Chipcon Products from Texas
Instruments;
57: “SPI Access Design Note DN503”, page 5 of 9, Chipcon Products from Texas
Instruments;
58: SmartRF Studio, http://focus.ti.com/docs/toolsw/folders/print/smartrftm-studio.html
[accessed 01/08/09];
59: : “CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver” page 59 of 92, Chipcon
Products from Texas Instruments, version of 2007-11-29;
60: “CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver” page 42 of 92, Chipcon
Products from Texas Instruments, version of 2007-11-29;
61: “CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver” page 58 of 92, Chipcon
Products from Texas Instruments, version of 2007-11-29;
62: “PIC32 Peripheral Libraries for MPLAB C32 Compiler”, page 148 of 320, ©2007
Microchip Technology Inc.;
63: “PIC32 Peripheral Libraries for MPLAB C32 Compiler”, page 147 of 320, ©2007
Microchip Technology Inc.;
64: “PIC32 Peripheral Libraries for MPLAB C32 Compiler”, page 207 of 320, ©2007
Microchip Technology Inc.;
65: “PIC32 Peripheral Libraries for MPLAB C32 Compiler”, page 111 of 320, ©2007
Microchip Technology Inc.;
66: “PIC32 Peripheral Libraries for MPLAB C32 Compiler”, page 208 of 320, ©2007
Microchip Technology Inc.;
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 101
67: PIC32 Peripheral Libraries for MPLAB C32 Compiler”, page 206 of 320, ©2007
Microchip Technology Inc.;
68: “PIC32MX Family Reference Manual”, page 23-4, ©2008 Microchip Technology
Inc.;
69: PIC32 Peripheral Libraries for MPLAB C32 Compiler”, page 204 of 320, ©2007
Microchip Technology Inc.;
70: “CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver” page 43 of 92, Chipcon
Products from Texas Instruments, version of 2007-11-29;
71: : “Packet Transmission Basics Design NoteDN500”, page 4 of 8, Texas Instruments;
72 : “Packet Transmission Basics Design Note DN500”, page 3 of 8, Texas Instruments;
73: “CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver” page 69 of 92, Chipcon
Products from Texas Instruments, version of 2007-11-29;
74: PIC32 Peripheral Libraries for MPLAB C32 Compiler”, page 143 of 320, ©2007
Microchip Technology Inc.;
75: “CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver” page 48 of 92, Chipcon
Products from Texas Instruments, version of 2007-11-29;
76: “CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver” page 46 of 92, Chipcon
Products from Texas Instruments, version of 2007-11-29;
77: “CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver” page 56 of 92, Chipcon
Products from Texas Instruments, version of 2007-11-29;
78: “2.4 GHz Inverted F antenna Design Note DN0007”, page 5 of 4, Texas Instruments;
79: “2.4 GHz Inverted F antenna Design Note DN0007”, page 12 of 4, Texas Instruments;
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 102
Appendix A
Source Code
Due to the size of the source code, the full project source code is available in the CD-ROM
attached with this document.
However here below is the content of two key source files: SPI.c and RF.c
SPIc
#include <plib.h>
typedef unsigned char BYTE; //defining a 1 byte var
/*----COMMAND STROBES----*/
#define SRES 0x30
#define SFSTXON 0x31
#define SXOFF 0x32
#define SCAL 0x33
#define SRX 0x34
#define STX 0x35
#define SIDLE 0x36
#define SWOR 0x38
#define SPWD 0x39
#define SFRX 0x3A
#define SFTTX 0x3B
#define SWORRST 0x3C
#define SNOP 0x3D
void CShigh(){//THIS FUNCTION WAS GIVING TIMING PROBLEMS SO THE CSn IS KEPT
ALWAYS LOW -CC2500 IS THE ONLY SLAVE ANYWAY
PORTSetBits(IOPORT_B, BIT_2); //puts CS at an high value (CS is active low, so goes low during
transfers)
}
void CSlow(){
PORTClearBits(IOPORT_B, BIT_2); //CS low
}
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 103
BYTE CCready(){
while(PORTReadBits(IOPORT_F, BIT_7) == 1){
; //stays in the cycle until the CC2500 out is high (F7 at the micro)
}
return 1;
}
//Initialize and Set SPI channel 1 as MASTER
void OpenSPI(){
SpiChnOpen(1, SPICON_ON | SPICON_MSTEN | SPICON_CKE , 400); //200 KBaud
PORTSetPinsDigitalOut(IOPORT_B, BIT_2); //makes the CS pin software driven as an output
PORTSetPinsDigitalIn(IOPORT_D, BIT_8); //makes the port D8 an input, in this way we can read
the packet status from the CC
CShigh();
}
//this function closes SPI channel 1
void CloseSPI(){
SpiChnClose(1);
}
/*-------THIS FUNCTION READS THE REGISTER WITH A SINGLE ACCESS--------*/
BYTE readRegister(BYTE registro){
BYTE value, mask;
mask = 0x80; //this mask always adds the 1 for the reading 1000.0000
CSlow();
while(!CCready());
putcSPI1(registro | mask);
while(!SpiChnDataRdy(1));
value = SPI1BUF; //status byte
putcSPI1(0x00);
while(!SpiChnDataRdy(1));
value = SPI1BUF; //actual read
return value;
CShigh();
}
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 104
/*-------THIS FUNCTION WRITES THE REGISTER WITH A SINGLE ACCESS--------*/
void writeRegister(BYTE registro, BYTE value){
BYTE mask, dvalue; //dvalue is a dummyread to read the buffer
//both the R/W and BURST bit have to be set to 0 (SINGLE WRITE MODE), 00xxxxxx so the mask is
00111111 ---> 3f
mask = 0x3f;
CSlow();
while(!CCready());
putcSPI1(registro & mask); //ADDRESS HEADER: telling we want to write that register with a single access
while(!SpiChnDataRdy(1));
dvalue = SPI1BUF; //status byte, received to clear the buffer
putcSPI1(value); //sending the register value
while(!SpiChnDataRdy(1));
dvalue = SPI1BUF; //status byte, received to clear the buffer
CShigh; //CS high, returns high after transfer is done
}
/*-------------THIS FUNCTION SENDS A COMMAND STROBE TO THE CC2500-------*/
void sendStrobe(BYTE strobe) {
BYTE value;
CSlow();
while(!CCready());
putcSPI1(strobe);
while(!SpiChnDataRdy(1));
value = SPI1BUF; //status byte
CShigh();
}
/*--THIS FUNCTION DISPLAYS ALL THE REGISTERS AND VALUE ON THE HYPERTERMINAL
WINDOW IN THE HEX FORMAT--*/
void displayAllregisters(void){
BYTE i,value;
char string[8];
for(i = 0x00; i <= 0x2e; i++) {
putsUART2("The content of register ");
sprintf(string, "%x", i);
putsUART2(string);
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 105
putsUART2(" is: ");
value = readRegister(i);
sprintf(string, "%x", value);
putsUART2(string);
putsUART2("\r\n");
}
}
/*--------------THIS FUNCTION RETURNS THE NUMBER OF BYTES CURRENTLY IN THE TX FIFO--
------*/
//NOTE: THIS FUNCTION DIFFERS FROM noFreeBytesInTXFIFO BECAUSE THIS ONE GIVES THE
ACTUAL
//NUMBER OF BYTES THAT ARE CURRENTLY IN THE TX FIFO
//THAT VALUE IS HELD IN THE REGISTER 0xFA
BYTE noBytesInTXFIFO(){
BYTE value;
char string[8];
value = readRegister(0xFA); //adress of register TXBYTES
value = (value & 0x3F); //we are interested only in the bits 6:0 so 0011.1111= 0x3F
putsUART2("-from register- The number of bytes in the TXFIFO register is: ");
sprintf(string, "%d", value);
putsUART2(string);
putsUART2("\r\n");
return value;
}
/*--------------THIS FUNCTION RETURNS THE NUMBER OF FREE BYTE IN THE TX FIFO--------*/
//NOTE: THIS FUNCTION READS THE STATUS BYTE AND TELLS HOW MANY BYTES ARE
CURRENTLY AVAILABLE
//TO BE WRITTEN IN THE TX FIFO
//THIS INFO IS OBTAINED FROM THE STATUS BYTE
BYTE noFreeBytesInTXFIFO(){
BYTE value;
char string[8];
CSlow();
while(!CCready());
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 106
putcSPI1(SNOP); //sends the no operation strobe (in Write and Single mode)
while(!SpiChnDataRdy(1));
value = SPI1BUF; //status byte read
value = (value & 0x0F); //the mask is 00001111 -> 0x0F in order to read just the last 4 bits
putsUART2("-from status byte- The number of free bytes in the TX FIFO is equal or greater than ");
sprintf(string, "%d", value);
putsUART2(string);
putsUART2("\r\n");
return value;
CShigh();
}
/*-------THIS FUNCTION RETURNS THE NUMER OF BYTES CURRENTLY IN THE RX FIFO----------
*/
//NOTE: THIS FUNCTION DIFFERS FROM noAvaBytesInRXFIFO BECAUSE THIS ONE GIVES THE
ACTUAL
//NUMBER OF BYTES THAT ARE CURRENTLY IN THE RX FIFO
//THAT VALUE IS HELD IN THE REGISTER 0xFB
BYTE noBytesInRXFIFO(){
BYTE value;
char string[8];
value = readRegister(0xFB);
value = (value & 0x3F); //we are interested only in the bits 6:0 so 0111111 = 0x3F
//_____THE SERIAL OUTPUT IS DONE IN THE INTERRUPT IN ORDER TO USE THIS FUNCTION
IN RFreceive
//putsUART2("-from RXFIFO register- The RX FIFO has got bytes: ");
//sprintf(string, "%d", value);
//putsUART2(string);
//putsUART2("\r\n");
return value;
}
/*-------THIS FUNCTION RETURNS THE NUMER OF BYTES AWAILABLE IN THE RX FIFO----------
*/
//THIS INFO IS OBTAINED FROM THE STATUS BYTE
BYTE noAvaBytesInRXFIFO(){
BYTE value;
char string[8];
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 107
CSlow();
while(!CCready());
putcSPI1(0xBD); //sends the No Operation Header in Read mode and Burst=0 --> 1011.1101 =
0xBD
while(!SpiChnDataRdy(1));
value = SPI1BUF;
value = (value & 0x0F); //the mask is 00001111 -> 0x0F in order to read just the last 4 bits
putsUART2("-from status byte- The number of bytes available in the RX FIFO is: ");
sprintf(string, "%d", value);
putsUART2(string);
putsUART2("\r\n");
return value;
CShigh();
}
/*----------------------THIS FUNCTION GETS THE CC2500 STATE-------------*/
//THIS FUNCTION READS THE STATE FROM THE MARCSTATE REGISTER
BYTE getState(){
BYTE value;
char string[8];
value = readRegister(0xF5); //0xF5 is 1111.0101 is in Read and Burst mode.. but are not
bursting
value = (value & 0x1F); //this mask is 0001.1111 = 0x1F is to read just the last 5 bits of the register
if(value == 0){
putsUART2("The chip is in the state SLEEP\r\n");
}
if(value == 1){
putsUART2("The chip is in the state IDLE\r\n");
}
if(value == 2){
putsUART2("The chip is in the state XOFF\r\n");
}
if(value == 3){
putsUART2("The chip is in the state VCOON_MC\r\n");
}
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 108
if(value == 4){
putsUART2("The chip is in the state REGON_MC\r\n");
}
if(value == 5){
putsUART2("The chip is in the state MANCAL\r\n");
}
if(value == 6){
putsUART2("The chip is in the state VCOON\r\n");
}
if(value == 7){
putsUART2("The chip is in the state REGON\r\n");
}
if(value == 8){
putsUART2("The chip is in the state STARTCAL\r\n");
}
if(value == 9){
putsUART2("The chip is in the state BWBOOST\r\n");
}
if(value == 10){
putsUART2("The chip is in the state FS_LOCK\r\n");
}
if(value == 11){
putsUART2("The chip is in the state IFADCON\r\n");
}
if(value == 12){
putsUART2("The chip is in the state ENDCAL\r\n");
}
if(value == 13){
putsUART2("The chip is in the state RX\r\n");
}
if(value == 14){
putsUART2("The chip is in the state RX_END\r\n");
}
if(value == 15){
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 109
putsUART2("The chip is in the state RX_RST\r\n");
}
if(value == 16){
putsUART2("The chip is in the state TXRX_SWITCH\r\n");
}
if(value == 17){
putsUART2("The chip is in the state RXFIFO_OVERFLOW\r\n");
}
if(value == 18){
putsUART2("The chip is in the state FSTXON\r\n");
}
if(value == 19){
putsUART2("The chip is in the state TX\r\n");
}
if(value == 20){
putsUART2("The chip is in the state TX_END\r\n");
}
if(value == 21){
putsUART2("The chip is in the state RXTX_SWITCH\r\n");
}
if(value == 22){
putsUART2("The chip is in the state TXFIFO_UNDERFLOW\r\n");
}
return value;
}
/*----THIS FUNCTION READS THE STATUS BIT AND INTERPRETS THE CHIP STATE----------*/
BYTE getStatusByte(){
BYTE value;
char string[8];
CSlow();
while(!CCready());
putcSPI1(SNOP); //sends the Nop in order to receive the status byte
while(!SpiChnDataRdy(1));
value = SPI1BUF; //reads the status byte
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 110
value = (value & 0x70) >> 4; //the mask is 01110000 -> 0x70 in order to read just the 3 status bit, and then
shift it by 4 positions
if(value == 0){
putsUART2("The chip is in IDLE mode.. it's LAZY, must be Italian!! \r\n");
}
if(value == 1){
putsUART2("The chip is in RX mode\r\n");
}
if(value == 2){
putsUART2("The chip is in TX mode\r\n");
}
if(value == 3){
putsUART2("The chip is in ready for the Fast Transmission mode \r\n");
}
if(value == 4){
putsUART2("The chip Frequency Synthesizer calibration is running\r\n");
}
if(value == 5){
putsUART2("The chip PLL is settling.. give him a brake!\r\n");
}
if(value == 6){
putsUART2("The chip RX FIFO has overflowed.. Read out and then flush the FIFO with the
sendStrobe(SFRX)\r\n");
}
if(value == 7){
putsUART2("The chip TX FIFO has underflowed, acknowledge with sendStrobe(SFTX)\r\n");
}
CShigh();
return value;
}
void delayRX_TXtoIDLE(){
unsigned int i;
//theoretically to go from either RX or TX to IDLE should only take 8 cycles
//(with a 80MHz clk) but let's give it 15 cycles to be safe
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 111
for(i=0; i<15; i++){
Nop();
}
}
void delayIDLEtoRX_TX(){
unsigned int i;
//theoretically to go from IDLE to either RX or TX should only take 7072 cycles
//(with a 80MHz clk) but let's give it 7500 cycles to be safe
for(i=0; i<7500; i++){
Nop();
}
}
void delayCALIBRATION(){
unsigned int i;
//theoretically to calibrate (SCAL strobe) should only take 57680 cycles
//(with a 80MHz clk) but let's give it 60000 cycles to be safe
for(i=0; i<60000; i++){
Nop();
}
}
Fast Hopping RF.c
#include <plib.h>
//#include <p32mx360f512l.h>
#include "SPI.h"
extern unsigned int pktCount, CRC_fail, CRC_ok, interferance;
extern BYTE bestChannels[50], base, transmitter;
typedef struct{
BYTE FSCAL1;
BYTE FSCAL2;
BYTE FSCAL3;
}calibrationResults_type;
calibrationResults_type calibrationResults[50]; //this array of struct contains calibration
//info for every best channel
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 112
calibrationResults_type calibrationResults_base;
/*----COMMAND STROBES----*/
#define SRES 0x30
#define SFSTXON 0x31
#define SXOFF 0x32
#define SCAL 0x33
#define SRX 0x34
#define STX 0x35
#define SIDLE 0x36
#define SWOR 0x38
#define SPWD 0x39
#define SFRX 0x3A
#define SFTTX 0x3B
#define SWORRST 0x3C
#define SNOP 0x3D
/*--------THIS FUNCTION SENDS DATA OVER THE AIR-------------*/
void RFsend(BYTE tosend[], BYTE instruction, BYTE newchannel, BYTE address){
BYTE dvalue, i, payload;
CSlow();
while(!CCready());
payload = 50; //(50 bytes payload)
putcSPI1(0x3F); //TX SINGLE ACCESS
while(!SpiChnDataRdy(1));
dvalue = SPI1BUF;
putcSPI1(address); //transmitter address
while(!SpiChnDataRdy(1));
dvalue = SPI1BUF;
putcSPI1(0x7F); //TX FIFO address 0x3F plus (OR) the Burst bit 0x40 = 0111.1111
while(!SpiChnDataRdy(1));
dvalue = SPI1BUF; //dummy read status byte, you might wanna check if there is space in txfifo by
now..
//now sending the payload (50 bytes)
for (i = 0; i < payload; i++) {
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 113
//putcSPI1(tosend[i]); //filling in the TX FIFO with data
putcSPI1((BYTE)(rand() % 10)); //sending random data
while(!SpiChnDataRdy(1));
dvalue = SPI1BUF; //dummy read
}
putcSPI1(instruction); //the first byte after the payload is the instrucion
while(!SpiChnDataRdy(1));
dvalue = SPI1BUF;
putcSPI1(newchannel); //the second byte after the payload is the new channel
number
while(!SpiChnDataRdy(1));
dvalue = SPI1BUF;
PORTSetBits(IOPORT_B, BIT_2); //CS high so the CC2500 knows that burst data has finished
PORTClearBits(IOPORT_B, BIT_2); //CS low again to continue communicating with the CC2500
sendStrobe(STX); //no need to add delay because the code waits anyway for the bit8 to go high
//and it does only when in tx mode
//SINCE WE HAVE SET THE REGISTER IOCFG0 to 0x06, we can get the packet transmission status from GDO0 (port-D bit-8)
while(PORTDbits.RD8 == 0); // Wait for GDO0 to be cleared -> end of packet
// Wait for GDO0 to be set -> sync transmitted
while(PORTDbits.RD8 == 1); //stays in here until D8 goes low
mPORTAToggleBits(BIT_0); //turns on the led to tell it has transmitted
//now in IDLE (TXOFF_MODE=00)
CShigh;
}
/*-------------------THIS FUNCTION IS TO RECEIVE RF PACKETS---------------------*/
void RFreceive(BYTE rxBuffer[], BYTE *instruction, BYTE *newchannel){
BYTE dvalue, i, payload, RSSI, CRC;
unsigned char string[100]; //for outputting the received
CSlow();
while(!CCready());
payload = 50; //(50 bytes payload)
sendStrobe(SRX); //NOW IN RECEIVE MODE (no need to wait because of the while)
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 114
// Wait for GDO0 to be set -> sync received
while(PORTDbits.RD8 == 0); //stays in here until D8 goes high
// Wait for GDO0 to be cleared -> end of packet
while(PORTDbits.RD8 == 1); //stays in here until D8 goes low
if(noBytesInRXFIFO() != 0){
//First read is to read out the destination address
// (if we are at this point means it's the same as this device address.. so it's a dummy read)
putcSPI1(0xBF); //RX FIFO SINGLE ACCESS
while(!SpiChnDataRdy(1));
dvalue = SPI1BUF;
putcSPI1(0x00); //to clock
while(!SpiChnDataRdy(1));
dvalue = SPI1BUF; //unuseful
//now sends the Read Burst TXFIFO command
putcSPI1(0xFF); //RX FIFO is 0x3F + (OR) BURST READ MODE = 0x3F | 0xC0 = 0xFF
while(!SpiChnDataRdy(1));
dvalue = SPI1BUF;
//now reading the RX FIFO
for(i=0; i<payload; i++){
putcSPI1(0x00); //to clock
while(!SpiChnDataRdy(1));
rxBuffer[i] = SPI1BUF; //read
}
//now reading the instruction (byte 51)
putcSPI1(0x00); //to clock
while(!SpiChnDataRdy(1));
*instruction = SPI1BUF; //read the instruction
//now reading the channel (byte 52)
putcSPI1(0x00); //to clock
while(!SpiChnDataRdy(1));
*newchannel = SPI1BUF; //read the new channel
PORTSetBits(IOPORT_B, BIT_2); //CS high so the CC2500 knows that burst data has finished
PORTClearBits(IOPORT_B, BIT_2); //CS low again to continue communicating with the CC2500
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 115
RSSI = readRegister(0xBF);
CRC = readRegister(0xBF);
CRC = (CRC & 0x80) >> 7;
if(CRC == 0){
CRC_fail++; //times that CRC checks gives 0 (failiure)
}else{
CRC_ok++;
}
pktCount++; //pkt received (maybe with errors, but it did fill in the RX FIFO)
}//end if noBytesInRXFIFO check
else{
putsUART2("INTERFERANCE\r\n ");
interferance++;
}
mPORTAToggleBits(BIT_0 | BIT_1 | BIT_2 | BIT_3); //turn the 4 LEDs off at startup
CShigh();
//since RXOFF_MODE=00 after receiving a pkt the state is IDLE
}
/*---THIS FUNCTION CHECKS (READING THE STATUS BYTE) IF THE CHIP IT'S IN THE
RXOVERFLOW CONDITION,
IF SO RETURNS IT SENDS A SFRX STROBE, PUTTING THE CHIP IN THE IDDLE STATE
---*/
void clearPotentialRXoverflow(){
BYTE value;
CSlow();
while(!CCready());
putcSPI1(SNOP); //sends the Nop in order to receive the status byte
while(!SpiChnDataRdy(1));
value = SPI1BUF; //reads the status byte
value = (value & 0x70) >> 4; //the mask is 01110000 -> 0x70 in order to read just the 3 status bit, and then
shift it by 4 positions
if(value == 6){//if it was in over flow goes in the cycle
sendStrobe(SFRX);
//after issueing the SFRX strobe you are in IDLE mode
sendStrobe(SRX);
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 116
//now in RX mode
}
CShigh();
}
/*------THIS FUNCTION WAITS UNTIL THE PLL LOCKS THE FREQUENCY (CALL IT AFTER
CALIBRATING)----*/
void waitPLLinLock(){
//when the FSCAL1 register is different than 0x3F it means the PPL locked the freq
while(readRegister(0x25) == 0x3F); //stays in there until PPL locks
}
/*---THIS FUNCTION CHANGES THE CHANNEL, CALIBRATES IT AND WAITS UNTIL THE PLL
LOCKS IN THE FREQUENCY---*/
//NOTE: THE CHANGECHANNEL FUNCTION GOES TO RX STATE AT THE END (optimization
purposes)
void changeChannel(BYTE newchannel){
sendStrobe(SIDLE);
delayRX_TXtoIDLE();
writeRegister(0x0A, newchannel);
sendStrobe(SCAL);
delayCALIBRATION();
waitPLLinLock();
//leaves it in IDLE
}
/*---THIS FUNCTION READS THE CRC FLAG FROM THE PKTSTATUS REGISTER---*/
//NOTE: in order to work this function requires PKTCTRL0.CC2400_EN=1
//ANYWAY IT'S BETTER TO READ THE CRC FLAG FROM THE APPEND STATUS
BYTE getCRCflag(){
BYTE value;
value = readRegister(0xF8); //reads the value from the PKTSTATUS register
value = (value & 0x80) >> 7; //masks the register to leave untouched just bit 7 and shifts it to lsb
return value;
void changeChannelFast(BYTE newBestChannel){
writeRegister(0x25, calibrationResults[newBestChannel].FSCAL1); //writing the values previously stored
writeRegister(0x24, calibrationResults[newBestChannel].FSCAL2); //during best channels calibration
writeRegister(0x23, calibrationResults[newBestChannel].FSCAL3);
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 117
writeRegister(0x0A, newBestChannel); //also update the cannel number
//leave it in IDLE
}
/*-----THIS FUNCTION SCANS ALL THE CHANNELS AND CHANGES THE CHANNEL INTO THE
BEST ONE-----*/
void ScanAndPosition(){
BYTE RSSI_dec, offset=69, j;
int RSSI_dBm, allChannels[256], i, s=0;
//get a RSSI value for every channel (256 channels)
//i corresponds to the channel number, and allChannels[] contains the RSSI value for that channel (in dBm)
for(i=0; i<256; i++){
changeChannel((BYTE)i); //goes from channel 0 to 255 (INCLUDED)
//change channel finishes in IDLE
sendStrobe(SRX);
delayIDLEtoRX_TX();
delayCALIBRATION(); //to get a better RSSI reading the chip has to spend some time in RX
MODE (DN 505)
RSSI_dec = readRegister(0xF4);
if (RSSI_dec >= 128){
RSSI_dBm = (int)(((int)( RSSI_dec - 256) / 2) - offset);
}else{
RSSI_dBm = (int)((RSSI_dec / 2) - offset);
}
allChannels[i] =RSSI_dBm;
}
//now all the channels have been scanned, you are now in RX STATE and in channel 255
//search for the smallest RSSI value (best channel)
for(i=0; i<256; i++){
if(allChannels[i] <= s){
s = allChannels[i];
base = i;
}
}//end search best channel
changeChannel(base); //change channel to the best just found (base)
//the base channel can potentially not be part of the bestChannel list found by the TX
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 118
//the base channel has to be calibrated separately
calibrationResults_base.FSCAL1=readRegister(0x25); //FSCAL1
calibrationResults_base.FSCAL2=readRegister(0x24); //FSCAL2
calibrationResults_base.FSCAL3=readRegister(0x23); //FSCAL3
//now the calibration results have been stored
//as now you are in the best channel and in IDLE state
sendStrobe(SRX);
delayIDLEtoRX_TX();
// Wait for GDO0 to be set -> sync received
while(PORTDbits.RD8 == 0); //stays in here until D8 goes high
// Wait for GDO0 to be cleared -> end of packet
while(PORTDbits.RD8 == 1); //stays in here until D8 goes low
//when a pkt is detected send a packet to tell that this is the base freq
RFsend(0x00, 0x00, 0x00, transmitter); //sends a packet to tell the TX that this is base frequency
sendStrobe(SFRX); //because the RX FIFO wasn't read
//now in the base channel and IDLE
}
void changeIntoBaseFast(){
//you must be in idle (you are because RXOFF_MODE=00)
writeRegister(0x25, calibrationResults_base.FSCAL1);
writeRegister(0x24, calibrationResults_base.FSCAL2);
writeRegister(0x23, calibrationResults_base.FSCAL3);
writeRegister(0x0A, base); //also update the cannel number
//leave it in IDLE
}
/*------------------------CALIBRATES THE LIST OF BEST CHANNELS RECEIVED-----------------------*/
void CalibrateBestReceived(){
BYTE i;
//the bestChannels array has been filled
//for each channel we have to run the calibration and save the results in the calibration array
//you are in base now and idle
for(i=0; i<50; i++){
//calibrate each best channel
writeRegister(0x0A, bestChannels[i]);
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 119
sendStrobe(SCAL);
delayCALIBRATION();
waitPLLinLock();
calibrationResults[i].FSCAL1=readRegister(0x25); //FSCAL1
calibrationResults[i].FSCAL2=readRegister(0x24); //FSCAL2
calibrationResults[i].FSCAL3=readRegister(0x23); //FSCAL3
}//end for calibrate best
changeIntoBaseFast(); //goes back to base using the values previously stored for the base freq
}//function end
/*-----------THIS FUNCTION MODIFIES THE PATABLE------------*/
void setPower(BYTE newvalue){
CShigh(); //resets the PATABLE counter
CSlow(); //re-establishes the communication with the chip
while(!CCready()); //waits for the chip to be ready
writeRegister(0x3E, newvalue);
CShigh(); //resets the PATABLE counter
CSlow(); //re-establishes the communication with the chip
while(!CCready()); //waits for the chip to be ready
}
/*-----------THIS FUNCTION READS THE PATABLE------------*/
BYTE readPower(){
BYTE value;
CShigh(); //resets the PATABLE counter
CSlow(); //re-establishes the communication with the chip
while(!CCready()); //waits for the chip to be ready
value=readRegister(0x3E);
CShigh(); //resets the PATABLE counter
CSlow(); //re-establishes the communication with the chip
while(!CCready()); //waits for the chip to be ready
return value;
}
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 120
Appendix B
Feasibility Study
University of Manchester
Faculty of Engineering and Physical Sciences
School of Electrical & Electronic Engineering
The Application of low-power wireless networks
to wide-area distributed audio systems
-Feasibility Study Report-
Flavio Felici
ID: 7317556
Project Supervisor:
Mr. Peter Green
May 2009
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 121
Abstract
In this document is studied the feasibility to design and develop a wireless transmission
system: Such wireless link will be applied to inter connect a network of loudspeakers
forming a noise masking system.
The connection between each loudspeaker unit is required to work under an unlicensed
frequency range and through a protocol which preserves coexistence with other wireless
standards.
All the technical requirements, the basic background information, high level layout and
developing methodology are illustrated in this study.
Table of contents
1. Introduction
1.1 Sound Masking Systems Overview
1.2 Project Aim
1.3 Report Content
2. Transmission System Technical Requirements
2.1 Frequency of Operation
2.2 Network Layout
2.3 Traffic Pattern
2.4 Wireless Coexistence
3. Wireless Transmission in the Unlicensed Band
3.1 ISM Band properties
3.1.1 The 2.4 and 5.8 GHz ISM Band
3.2 Comparison between wireless standards in ISM bands
3.2.1 IEEE 802.11 – The Wi-Fi Standard
3.2.2 IEEE 802.15.1 – The Bluetooth Standard
3.2.3 IEEE 802.15.4-2006 – The ZigBee Standard
3.2.4 Texas Instruments SimpliciTI
3.2.5 2.4 GHz ISM Band Survey
3.2.6 Custom Built Protocol
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 122
4. High Level Design
4.1 Transmission System Overview
4.2 Transceiver ISM Band Selection
4.3 Component Selection and Network Protocol
5. Methodology
5.1 Peer-to-Peer Link
5.2 Fixed Frequency Hopped Spread Spectrum Token Ring Network
5.3 Adaptive Frequency Hopped Spread Spectrum Token Ring Network
6. Project Management
7. Conclusions
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 123
1. Introduction
1.1 Sound Masking Systems Overview
The purpose of this document is to verify the feasibility and to describe the design
methodology involved to develop a low-power wireless network applied to wide-area
distributed audio systems. The project serves as the final stage of a postgraduate course
and will last for four months. The wireless network that will be designed and developed
will provide a communication link between different nodes making up a distributed audio
system; in particular the audio system is an arrangement of loud speakers emitting sound
waves designed to eliminate any unwanted noise source in the area. Such method is called
sound masking, which by the emission of specially created sound patterns it allows to
reduce or eliminate the awareness of unwanted noises in the environment. Using this kind
of technique speech privacy is greatly enhanced as well as the awareness of noise sources
nearby, therefore improving concentration and productivity in work places.
Noise masking systems work thanks to a loudspeaker array counterbalancing any
unwanted sound source: this is made possible by each independent loudspeaker node that
acquires, processes and counteracts disturbing sounds. To accomplish good noise masking
performance and a coherent action, each node in the array has to share information on
noise sources, noise level and have synchronization with the other units. Therefore the
need for a communication link between the nodes rises; such a link could be wired or
wireless.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 124
Figure 1: Typical sound masking loud speakers network -using wired network connection
For early systems such a communication link was wired but high installation costs and the
impossibility to install wiring in historic buildings make the wireless option the better
solution.
1.2 Project Aim
Apple Dynamics1 is a audio system company based in Salford, England; it develops a
variety of products focused on acoustics and digital signal processing. –Ism® 2 is the name
of their sound masking system, which consists in a network of digital signal processing
boards coupled with a loudspeaker, each forming an independent network node.
At the moment the nodes network is connected through wires, which represent a high
expense in terms of both installation costs and installation flexibility. It‟s easy to
understand how complicate and expensive can be interconnecting tens of network nodes
through big spaces such as congress halls or open plan offices
Hence the aim of this project is to replace the wired link with a wireless transmission
system, interconnecting each node of the sound masking system without the need of wires.
Such transmission system will interface with the existing sound processing board,
upgrading it with wireless capability.
To avoid radio license costs and to keep installation flexibility, the wireless link will have
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 125
to operate within an unlicensed ISM3 (Industrial, Scientific and Medical band), operating
under SRD4 (Short Range Devices) regulations. Both the operation frequency range and
power/modulation regulations will be key elements in the design solutions as are imposed
by the national electromagnetic spectrum regulator scheme.
Another fundamental element for the wireless network is coexistence –in fact as the sound
masking system will work within an unlicensed frequency range in work places and
crowded public areas, it is likely to find a busy electromagnetic environment.
The wireless link therefore will have to coexist with other wireless standards in the area
such as IEEE 802.115(also popularly known as Wi-Fi) and IEEE 802.15.1 (also popularly
known as Bluetooth).
1.3 Report Content
In this document the project key aspects are analyzed and discussed, underling the major
issues that the transmission system has to overcome.
In chapter two the technical requirements dictated by the sound masking manufacturing
company are listed, these parameters represent what performances and characteristics the
wireless system must have. In chapter three the major properties and regulations of the
unlicensed ISM band are discussed, the wireless system will have to obey to such set of
regulations imposed by the telecommunication authority. In chapter four the hardware
components properties and the high level design are discussed, where instead in chapter
five the project methodology is showed. This represents a guideline for the project
development. Chapter six briefly gives explanation to the project time scale, referencing
the project planning to a Gantt chart. Finally in chapter seven the feasibility study report
conclusions are discussed.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 126
2. Transmission System Technical Requirements
The sound masking system is made up by an array of loudspeakers forming a network
where each loudspeaker represent an independent node. Each node senses the sounds in its
surrounding environment to acquire, analyse and counterbalance what is recognized as
disturbing noise. To achieve an effective reduction in noise the counter noise action must
be simultaneous and synchronized among all the loudspeakers nodes in the area of interest,
hence the interconnection between all the network nodes has to effective and reliable. In
the early versions of sound masking systems a wired connection had such properties,
however implementing such type of connection wirelessly needs to take consideration of
several aspects. Nevertheless, being the number of nodes quite high in the average sound
masking network, the transmission system has to be low cost, making the choice of
software and hardware components a key issue.
The requirements imposed by the sound masking manufacturing company for the wireless
transmission system are listed as follows.
2.1 Frequency of Operation
The transmission system must be able to work within the unlicensed spectrum of different
countries: As the main markets for such type of sound masking devices are Europe, USA
and Japan, both the frequencies used for data transmission and the maximum transmission
power must comply with the unlicensed spectrum regulation of the country of installation.
Hence the transmission hardware and software must be capable of working in all the
above mentioned countries within an unlicensed frequency range. However European
common laws and international agreements have set common frequency windows,
standard transmission power levels and modulating schemes to address such type of issues,
making easier to find common unlicensed windows. One of these common unlicensed
frequency ranges is defined at 2.4 GHz, it has been asked by the company to take such
range into account when selecting the frequency of operation.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 127
2.2 Network Layout
To allow a correct sound masking action, the wireless link must be able to provide constant
communication between all the independent nodes, in round-robin. The nodes network can
be made of smaller ring sub-networks in which every node communicates with all the units
in its network ring and where inter sub-networks link is assured through a common node,
shared by two or more sub-networks. This implies that it won‟t be necessary for each node
to be able to communicate with every other node in the system.
Previously installed wired systems have shown that the typical number of nodes for each
sub-network is around 50 with each node within a 10 meters range.
This kind of link is required as each node contains an independent audio processor which
acquires and processes the audio signals in the nearby area, sharing them with all the other
nodes for a synchronized sound masking action. Figure 2 shows a typical network layout.
Figure 2: Ring Networks set up21
2.3 Traffic Pattern
In order for the sound masking system to work the link between nodes has to be reliable
and constant, but not necessarily in real time. This implies that each node will transmit data
at predetermined intervals applying some sort of error detection technique, this to ensure
that the transmission has been successful. As the communication is not in real time, if an
error is detected the transmission can be repeated until the data is successfully received.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 128
Statistics from previously installed wired systems have shown that the typical traffic bit
rate is around 100 kbps, with a possible peak of 200 kbps, with data packets not exceeding
256 bytes.
Figure 3 shows a table containing values of a typical traffic pattern.
Figure 3: Sound Masking System Typical Traffic Pattern21
2.4 Wireless Coexistence
Sound masking systems are most useful in working environments –such as offices or
meeting rooms; or in crowded public spaces –such as congress halls;
consequently it is very likely to find a fully engaged unlicensed spectrum. This because
popular devices such as cordless phones, wireless security cameras, local area networks
(like IEEE 802.115) and personal area networks (like IEEE 802.15.1
6) operate within
unlicensed bands, making interference a key issue.
The wireless link will have not only to withstand interference from other devices and
standards but also co-exist with them.
In fact the transmission between the network nodes must successfully take place without
jamming other devices. For this reason has been commissioned that the transmission
system requires a Frequency Hopping Spread Spectrum (FHSS) technique, which allows a
dynamic change of transmission frequency reducing channel losses and jamming other
devices.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 129
3. Wireless Transmission in the Unlicensed Band
Around the world all wireless transmissions have to obey the rules set by the International
Telecommunication Union7, these worldwide shared set of rules are furthermore modified
and adjusted by each singular country according to its needs and own regulations. More
specifically the ITU divides the world in three large regions: Region1 comprises Europe,
Africa, the Middle East west of the Persian Gulf including Iraq, the former Soviet Union
and Mongolia; Region2 covers the Americas, Greenland and some of the eastern Pacific
Islands; while Region3 is consists of most of non former Soviet Union, Asia, east of and
including Iran, and most of Oceania8.
The ITU regulations define for each particular frequency range, among other things, the
purpose of the transmission, the kind of license required, the maximum allowed
transmitted power and the modulation scheme to be used. However for defined frequency
ranges wireless transmission are allowed without any license or specific purpose –these
ranges are often called Industrial, Scientific and Medical (ISM3) bands.
For instance in the UK, which is lies in the ITU Region1, the unlicensed frequency ranges
are defined by the Office of Communications9 (OFCOM) as showed in table 1.
Generic Frequency Band Application
9 kHz to 30 MHz Short Range Inductive Applications
27 MHz Telemetry, Telecomm and Model Control
40 MHz Telemetry, Telecomm and Model Control
49 MHz General Purpose Low Power Devices
173 MHz Alarms, Telemetry, Telecomm and Medical Applications
405 MHz Ultra Low Power Medical Implants Devices
418 MHz General Purpose Telemetry and Telecomm and Applications
458 MHz Alarms, Telemetry, Telecomm and Medical Applications
864 MHz Cordless Audio Applications
868 MHz Alarms, Telemetry and Telecomm and Applications
2400 MHz General Purpose Short Range Applications, including CCTV and
RFID. Also used for WLANs including Bluetooth Applications.
5.8 GHz Hyper LANs, General Purpose Short Range Applications,
including Road Traffic and Transport Telematics
10.5 GHz Movement Detection
24 GHz Movement Detection
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 130
63 GHz 2nd
Phase Road Traffic and Transport Telematics
76 GHz Vehicle Radar Systems
Table 1 : Unlicensed Bands in the UK10
Unlicensed band doesn‟t mean unregulated, in fact transmissions within those bands
require to obey public health safety regulations, transmission purposes, often
predetermined modulation schemes and anti jamming regulations.
Transmitting in such bands offers a great deal in terms of reducing bureaucracy, cost and
increasing flexibility, on the other hand these frequencies tend to be always more and more
electromagnetically crowded –coexistence and interference are then key issues within these
bands.
3.1 ISM Band properties
As table 1 shows there are quite a few possible ISM bands to choose from. At this point
other parameters have to be taken into account for selecting the operating frequency:
components availability, antenna dimension, path loss, scattering and interference are
among them.
Since the transmission system will be installed indoor (often in small areas such as false
ceiling or suspended on walls) and since the standard isotropic antenna length is related
with the transmitting frequency wavelength, ISM bands below the megahertz order are
discarded (those would require antennae more than meters long). Another factor is path
loss, the higher the transmitting frequency the higher the attenuation caused by the
atmosphere will be; however the transmission system will only be installed indoor with
relatively short distances between nodes, making this parameter negligible. The scattering
produced by the electromagnetic waves being reflected by objects increases with the
frequency, offering to the receiver a good multipath reception -particularly in small indoor
environments. Given these considerations, the most suitable ISM bands for this kind of
transmission system are the 2.4 and 5.8 GHz, both offering small antenna dimension and
good scattering.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 131
3.1.1 The 2.4 and 5.8 GHz ISM Band
Yet the 2.4 GHz band already hosts various public wireless services, such as IEEE 802.11,
IEEE 802.15.1 and IEEE 802.15.4-200611
(also popularly known as Zigbee) to name a few.
This involves that this frequency range is likely to be very electromagnetically crowded
and full of interferences, especially in urban environments (since cordless phone, cordless
security cameras, microwave ovens share this very same band).
On the other hand this implies that the market has produced quite a large variety of
components specially designed to work at this frequency range. Instead the 5 GHz ISM
band is likely to have less interferences and data traffic but, as it is fairly new ISM band
the choice of components produced by manufacturers is fairly limited.
Another key parameter to be taken into account is the maximum transmission power level
defined for each ISM band: for instance throughout the European Union in the 2.4-2.4835
GHz ISM range the maximum output power out of the antenna is set as 10 mW19
; in the
5.150-5.350 GHz ISM range (also called Band A, indoor use only) the limit is set at 200
mW with a power density of 10 mW/MHz20
; while in the 5.470-5.725 GHz ISM range
(also called Band B, indoor and outdoor use allowed) the maximum irradiated power is set
to be 1 W with a power density of 50 mW/MHz20
.
To be noted that regulations have allowed higher power levels for the 5 GHz ISM band
because of the higher path loss encountered at these higher frequencies. On the other hand,
at this frequency range regulations also impose to use the OFDM modulation scheme.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 132
3.2 Comparison between wireless standards in ISM bands
With the commercial development of devices working in the 2.4 GHz ISM band over the
years many protocols have been developed for the public market. The most common for
the public use are probably Wi-Fi, Bluetooth while ZigBee and SimpliciTI12
are common
for industrial applications.
3.2.1 IEEE 802.11 – The Wi-Fi Standard
Wireless fidelity (Wi-Fi), in its many variants, has become the standard for public and
private local area networks. It allows users to access the internet and share data within the
local network at high speeds, achieving 600 Mbps with its latest standard 802.11n13
(which
uses MIMO technology), with a reasonably large operative range of several tens of meters
(despite the transmit power limit is set at 10dBm EIRP). However this standard is fairly
complex to implement on software and requires a relatively high amount of computational
power to run, raising the cost for each network node. Nevertheless the Wi-Fi standards
allows a great number of network users to be connected, in fact the protocol can handle up
to 2007 users16
, far beyond what is necessary for the sound masking system. Nowadays
most of the Wi-Fi LANs are operating in the 2.4 GHz ISM band, making this frequency
range electromagnetically crowded. However it is possible to set up several LANs in the
same area at the same time: In fact the Wi-Fi standard divides the 2.4 GHz band into 13
channels in Europe (14 in Japan and 11 in USA14
) where each channel is 22 MHz wide5.
As noticeable from figure 4 these channels overlap, giving interference between
neighbouring channels, however each channel is masked as its power is attenuated by 30
dB at ± 11 MHz from the channel central frequency. This means that channels 22 MHz
apart don‟t interfere with each other.
In particular, to ideally achieve zero interference four LANs could be set up operating in
the non overlapping channels 1, 5, 9 and 13.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 133
Figure 4: Wi-Fi Channels in the 2.4 GHz ISM band15
Therefore the Wi-Fi protocol is ideal to set up local area networks sharing large quantities
of data between users and from the internet, yet this powerful protocol comes with the
price of a complex software implementation and as a result needs powerful hardware to be
ran.
3.2.2 IEEE 802.15.1 – The Bluetooth Standard
Bluetooth is another commonly applied standard in the 2.4 GHz band, particularly used for
personal area network devices (WPAN) such as mice, mobile phones and printers. The
standard has been developed to achieve very low power consumption and a transmission
range of few meters (depending on the transceiver class), with a modest data rate –making
it ideal choice to interconnect such personal devices. The Bluetooth connection is
established between a device serving as a master and another set as slave. Instead of
dividing the band into channels, as the Wi-Fi standard defines, the Bluetooth link uses a
frequency hopping technique to constantly change the communication frequency between
the master and the slave devices16
. The frequency hopping pattern is defined by the master
devices which dynamically selects what frequency to communicate at, avoiding
interference with other appliances. Yet the maximum number of active connections is
eight16
, which limits its network capabilities.
3.2.3 IEEE 802.15.4-2006 – The ZigBee Standard
ZigBee instead, is a standard specially developed for industrial applications and its typical
operating range is around 10 meters6. The bit rate that it can support is quite limited,
making the Zigbee protocol ideal for applications such as infrared sensor, smoke detectors
or light switches. Most of all, this standard is designed around an extremely low power
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 134
consumption, in fact a transmission system to be certified with the Zigbee standard must be
battery powered, with at least a 2 year operating lifetime. However the number of nodes in
a Zigbee network can be greater than 65,00016
.
3.2.4 Texas Instruments SimpliciTI
SimpliciTI is another network protocol commonly used within ISM bands. It has been
developed by Texas Instruments to help creating networks with its produces transceivers. It
is very similar to Zigbee for both data rate and range, making it ideal for application like
smoke detectors, alarms or automatic meter readings17
. Nonetheless it‟s an open protocol
and doesn‟t require to be implemented into battery powered systems. The maximum
number of nodes that can be set up into a network using the SimpliciTI standard is defined
as 232
, well beyond what required by the sound masking transmission system. On the other
hand in order to use the SimpliciTI protocol Texas Instruments components have to be
used and the protocol used is not customizable, reducing the overall efficiency.
3.2.5 2.4 GHz ISM Band Survey
Figure 5 shows a 2.4 GHz ISM band survey taken with a spectrum analyzer. The
measurements were made in the frequency range spanning from 2.4 to 2.485 GHz using a
resolution bandwidth of 1 kHz. In the picture it is possible to distinguish three different
Wi-Fi channel used and Bluetooth activity over different frequencies. In fact it is clear
from this picture that the Wi-Fi standard uses portion of the spectrum well defined in width
and position, while Bluetooth uses a FHSS technique probing the spectrum over different
frequencies.
As the bit rate imposed by sound masking system doesn‟t require a wide bandwidth, the
wireless transmission system can operate in such ISM band, even if it is so
electromagnetically crowded.
Will be fundamental for the transmission system to operate in those unused regions of the
spectrum.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 135
Figure 5: Spectrum Survey of the 2.4 GHz ISM Band
3.2.6 Custom Built Protocol
The above mentioned protocols represent a common and reliable solution used in great
deal of applications all over the world, however every standard protocol has its own
drawbacks as it has to suit a vast variety of applications.
A custom made network protocol could instead be developed just for this wireless system,
improving efficiency and reducing the computational power required. Such custom build
protocol can be fitted around the components selected and deal with more flexibility issues
like coexistence and interference. Furthermore if a non standard protocol is used, any
possible maintenance operation will have to be performed only by the manufacturing
company, leaving no space for competitors.
Is consequently believed that the best solution to meet the project requirements (in terms of
performances, characteristics and cost) is to develop a custom protocol.
Table 2 reassumes all the different network protocols characteristics.
-150
-100
-50
0
2400
.000
001
2402
.627
273
2405
.254
546
2407
.881
819
2410
.509
091
2413
.136
364
2415
.763
637
2418
.390
91
2421
.018
182
2423
.645
455
2426
.272
728
2428
.9
2431
.527
273
2434
.154
546
2436
.781
819
2439
.409
091
2442
.036
364
2444
.663
637
2447
.290
91
2449
.918
182
2452
.545
455
2455
.172
728
2457
.8
2460
.427
273
2463
.054
546
2465
.681
819
2468
.309
091
2470
.936
364
2473
.563
637
2476
.190
91
2478
.818
182
2481
.445
455
2484
.072
728
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 136
PROTOCO
L PURPOSE ADVANTAGES DISADVANTAGES
FREQUENCY
RANGE
802.11
a/b/g/n
Medium range wireless
LAN
Worldwide
standard
high data rates
can implement
encrypted
communications
Sensible cost
Not readily available
Requires elevated
computational load
and software to be
implemented
2.4 GHz;
5 GHz;
Bluetooth Short range wireless
personal area networks
Worldwide
standard
Wide choice of low
cost components
Good
interoperability
Short range
Non suited for
crowded
environments
(limited number of
channels)
2.4 GHz;
Zigbee
Short range, very low
power wireless
communication link
Worldwide
standard
Low cost
components and
wide choice
Very low power
consumption
Low system
requirements
Battery powered
systems only
Strict power
consumption
specifications
Low data rate
2.4 GHz;
TI
SimpliciTI
Medium range low
power wireless
communication
between devices3
Low cost
components and
wide choice
Low power
consumption and
duty cycle;
Low system
requirements
TI devices to be used
Low data rate
Non customizable
protocol
Sub 1 GHz;
2.4 GHz;
custom Purpose built: Very low cost Time to develop Any ISM BAND
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 137
bidirectional peer-to-
peer communication
link
hardware
Highly efficient
data rate
Low power
consumption
Robust to channel
interferences
Able to coexist
with other wireless
transmission
Wide choice of low
cost components
Network not
interoperable with
other wireless
standards
Table 2: Network protocols characteristics
4. High Level Design
4.1 Transmission System Overview
The transmission system will have to be able to receive data from the digital processing
unit in the sound masking board, process it to apply the network protocol and hand it over
to the transceiver, which will send the bitstream to the antenna for transmission. Vice versa
the signals received from the antenna will have to be converted into logic signals by the
transceiver, processed by the microcontroller to extract the data and then handed over to
the sound masking board.
Therefore the system will require an adequate processing unit, that supplies enough
computational power to handle the bit rate requested and the complexity of the network
protocol.
Those tasks can be adequately handled by a microcontroller unit, which once programmed
with the network protocol will manage all the data received from the sound masking unit.
In particular, the sound masking board will communicate with the microcontroller through
some kind of interface, fast enough to handle the bitstream.
It is requested by Apple Dynamics that the microcontroller is chosen from the PIC-32
family, communicating with the DSP board through the SPI interface.
Both requirements perfectly suit the task as the SPI interface can easily handle the
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 138
maximum bitstream declared in the requirements and the PIC-32 has enough
computational power to acquire and manage the data, applying the custom protocol.
Once the data have been processed, they are sent to transceiver which is transforms the
logic signals into RF signals ready to be sent for transmission. Furthermore the transceiver
will be required to apply the required frequency hopping spread spectrum technique,
changing its transmission frequency at the pace requested by the protocol in the
microcontroller unit. Once the RF signals have been produced are sent from the transceiver
unit to the antenna. Nevertheless the transceiver will also transform the RF signal received
from the antenna into logic signals to be handed the microcontroller. Figure 6 shows the
transmission system schematic view.
Figure 6: Transmission System High Level Design
4.2 Transceiver ISM Band Selection
As mentioned in the technical requirements section the transceiver hardware has to able to
operate within an ISM band common into all ITU regions and, more specifically, the 2.4
GHz and 5 GHz band have been found to suit the application the most due to the smaller
antenna size required. Since the 2.4 GHz band has been used for longer, currently the
choice available for components in this band is far greater compared to the 5 GHz band. In
fact, as this document is produced, is quite hard to find a cheap 5 GHz transceiver capable
of implementing all the requirements imposed by the project. Therefore, due to
components availability, the band of choice is the 2.4 GHz, which is also preferred by the
Apple Dynamics company. Yet, if in the future the range of components in the 5 GHz band
will broaden, the transceiver unit could be updated without drastic changes in the
transmission system protocol. The communication protocol between the transceiver unit
and the microcontroller wasn‟t dictated in the project requirements and various options are
supported by both the microcontroller and the transceiver unit –such as UART, SPI and
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 139
I2C. Though, this was chosen to be the SPI protocol as it represents a reliable and
consistent solution. As the distance between nodes declared in the project specification is
in the order of meters, the transmission system could not need a RF front end –such front
end would be a power amplifier to boost the signals to achieve a greater range (the
transmission power however has to be within the maximum imposed by the ITU and
country regulation for the 2.4 GHz band) and a low noise amplifier to recover and amplify
very weak signal received. The choice of adding in cascade between the transceiver and
the antenna such a RF front end will be evaluated during the final components selection.
The actual signals transmission is relegated to an antenna, which, to achieve maximum
efficiency in both transmission and reception pattern has to be at least 6 cm long for the
operation in the 2.4 GHz range. Due to the ring network configuration, to achieve the best
link with all the nodes in the network the antenna is chosen to be isotropic, which radiates
equally in all directions along it‟s orthogonal axis. Such types of antenna are readily found
in the market at a reasonably price, and since they radiate equally in all direction, don‟t
require special positioning when installed.
4.3 Component Selection and Network Protocol
As mentioned above the microcontroller choice has been fixed in the Microchip PIC-32
family. Such microcontroller delivers a 32-bit performance with a clock frequency of 80
MHz, capable of complex embedded designs18
. It supports various standards connection
protocols such as UART, SPI and I2C. In particular it supports 2 SPI connections, which
allows to use this protocol for the connection with both the DSP board and the transceiver.
The custom built network protocol will be developed with a programming language and,
once compiled, downloaded into the device. This will take control of the device processing
power and drive/read its pins.
The transceiver unit can be chosen from a selection available to the public market, and the
final selection will be made during the project development.
Fundamental requirements for this unit are compliance with the 2.4 GHz band, FHSS
capability, low noise amplification, the possibility to attach an isotropic antenna and the
possibility to reach the maximum transmission level allowed in the ITU regions for the
chosen ISM band.
Such requirements can be found on components like the Texas Instruments-Chipcon
CC2400, CC2420, CC2520, CC2430, CC2431, CC2510, CC2511, CC2591; or in the
Microlinear models ML2724 and 5805. All this devices are compatible with the
application and are relatively low cost.
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 140
Better performances in terms of longer range and lower noise can be achieved with the
CC2591 and ML5805 which implement a built in RF front end, however these chips have a
slightly higher price.
The protocol will manage the communication with the DSP board and drive the transceiver
through the microcontroller. Furthermore it will manage the transmission frequency and
power levels in the transceiver adjusting its internal registers.
5. Methodology
The project aim to establish a wireless network within an ISM band that interconnects tens
of independent sound processing units requires different aspects to be taken into account.
As showed in the component selection paragraph both the microcontroller and the
transceiver frequency of operation have been decided during the project feasibility stage.
These choices have been made considering several aspects such as system performance,
flexibility and cost. Taking into account that the operation frequency has been selected in
one of the most common and used ISM bands and that the transmission system has to
coexist with other wireless standard present in the area, the project will be developed
around transmission efficiency and focusing on low interference. Once the transceiver
model has been selected and the hardware assembled, the project development will follow
the following steps.
5.1 Peer-to-Peer Link
The first step will be establishing a wireless connection between two nodes at a fixed
transmission frequency. This kind of transmission will ensure that a peer-to-peer link
between two independent nodes, at the required distance range, is established. Making
possible data transfer between two nodes.
Such operation represents the first step because, to be successful, requires several different
aspects to work simultaneously: it requires a correct hardware assemblage, a correct peer-
to-peer protocol to be installed into the microcontroller and a correct transceiver setup. All
these aspects are fundamental for the project development and no further progress could be
made without successfully completing such a step.
To verify the completion of this stage a data comparison between the transmitter and the
receiver node will be made, verifying transmission speed, range, modulation scheme and
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 141
bit error rate. Additionally a spectrum analyzer can be used to confirm whether the actual
transmission frequency used is accurate with the one set in the protocol.
5.2 Fixed Frequency Hopped Spread Spectrum Token Ring Network
Once a fixed frequency transmission is established between two nodes the project
development shall move toward a frequency hopped transmission. Frequency Hopped
Spread Spectrum technique consists of continuously changing the transmission frequency,
the change in frequency is conceded between transmitter and receiver, which follow the
same frequency pattern. As interference and coexistence are key issues in this project,
implementing such a technique is vital. In fact constantly changing the transmission
frequency allows to use the entire ISM spectrum one little portion at the time, avoiding
possible busy frequencies. The frequency pattern will in effect avoid those frequencies
used by common standards such as Bluetooth or Wi-Fi.
Furthermore if the transmission happens to be at a frequency already occupied by another
wireless protocol (hence the transmission will be corrupted) thanks to the FHSS technique,
the unsuccessful transmission will be repeated at the next frequency in the pattern, until the
data is correctly transmitted.
As a matter of fact at this point in the project some kind of error detection technique will
be developed, verifying the correct data transmission. Furthermore, once the data
transmission between two nodes is successful, other nodes can be added following the
same frequency pattern. This will build up a network of nodes transmitting and receiving
round-robin along a fixed frequency pattern.
Such kind of network already represents a valuable solution to the issues faced in a
electromagnetically busy ISM band, therefore meeting the system requirements.
It is believed that a fixed frequency hopped spread spectrum token ring network meets the
technical requirements imposed by Apple Dynamics and, in the given project time, it is a
feasible solution.
5.3 Adaptive Frequency Hopped Spread Spectrum Token Ring Network
A further development for the transmission system can be the implementation of an
adaptive frequency hopped spread spectrum protocol. The adaptive system differs from the
fixed as the transmission frequency pattern followed by the network is not fixed, but
dynamically selected depending on the surrounding environment. In fact an adaptive
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 142
system would sense the spectrum to acknowledge what frequencies are being used,
allowing the transmission only in those portions of the spectrum unused by nearby wireless
systems. Such a solution increases the transmission efficiency and decreases the bit error
rate, however requires a more complex network protocol. The feasibility to implement an
adaptive frequency hopped spread spectrum transmission system is not assured in the given
project time, however if the project development would finish ahead of schedule the
adaptive protocol could be implemented.
6. Project Management
As shown by the Gantt chart attached in the appendix, the project development will start
during the second half of may; the first task is going to be the component selection and the
consequent hardware setup and testing. This task has to be completed by the end of the
month. The second step will be establish a peer-to-peer communication between two
boards, at a fixed transmission frequency. As this task is comprehensive of several aspects,
it will require the whole month of June, and possibly even the first week of July. Afterward
a fixed FHSS communication will be developed during the month of July and then a token
ring network will be built up between the end of July and the first week of August. If the
project development will be ahead of this schedule, and adaptive FHSS system will be
developed during the first two weeks of August. Certainly the last two weeks of August
will be left for the dissertation project writing up.
As the deadline for the dissertation submission has been set to September 7th, a week time
is left for possible delays throughout the project time.
7. Conclusions
In this feasibility study report the key aspects involved in designing a wireless transmission
system have been discussed and analyzed. The actual project development will follow the
guidelines showed in this report, following the given timescale.
At the end of the project development the transmission system will have to meet those
requirements imposed by the Apple Dynamics company, both in terms of performances
and coexistence.
These requirements are going to be met following the methodology and planning discussed
in this report.
8. References
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 143
1: Apple Dynamics -company website, http://www.appledynamics.com/ [accessed on
20/04/09];
2: Apple Dynamics -ism®, http://www.appledynamics.com/toplevel_pages/-ism.html
[accessed on 20/04/09];
3: ISM Band, http://en.wikipedia.org/wiki/ISM_band [accessed on 07/05/09];
4: SRD –Low Power Communication Devices, http://en.wikipedia.org/wiki/SRD [accessed
on 08/05/09];
5: IEEE 802.11, http://en.wikipedia.org/wiki/IEEE_802.11 [accessed on 06/05/09];
6:IEEE 802.15.1, http://en.wikipedia.org/wiki/IEEE_802.15.1#Bluetooth_1.1 [accessed on
06/05/09];
7: ITU –Radio communication Sector, http://www.itu.int/ITU-
R/index.asp?category=information&rlink=rhome&lang=en [accessed on 01/05/09];
8: International Telecommunication Union region,
http://en.wikipedia.org/wiki/International_Telecommunication_Union_region [accessed on
05/05/09];
9: Office of Communications -Ofcom , http://www.ofcom.org.uk/ [accessed on 03/05/09];
10: Unlicensed Spectrum | ICT Regulation,
http://www.ictregulationtoolkit.org/en/Section.2843.html [accessed on 08/05/09] ;
11: IEEE 802.15.4-2006, http://en.wikipedia.org/wiki/IEEE_802.15.4-2003 [accessed on
01/05/09];
12: SimpliciTI Network Protocol,
http://focus.ti.com/docs/toolsw/folders/print/simpliciti.html [accessed on 1/03/09] ;
13: 802.11n: Next-Generation Wireless LAN Technology,
http://www.broadcom.com/collateral/wp/802_11n-WP100-R.pdf, page 4 [accessed on
9/05/09] ;
14: List of WLAN channels, http://en.wikipedia.org/wiki/List_of_WLAN_channels
[accessed on 10/05/09] ;
15: Wireless Networking in the Developing World,
http://upload.wikimedia.org/wikipedia/commons/c/c6/Wireless_Networking_in_the_Developing_World.pdf , page 25 [accessed on 10/05/09];
16: Jin-Shyan Lee, Yu-Wei Su, and Chung-Chou Shen, “A Comparative Study of
Wireless Protocols: Bluetooth, UWB, Zigbee, and Wi-Fi”, Industrial Technology Research
Institute (ITRI) Hsinchu, Taiwan, 2007, page 2;
17: SimpliciTI Network Protocol,
http://focus.ti.com/docs/toolsw/folders/print/simpliciti.html, [accessed on 10/05/09]
18: Product Overview, Microchip,
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2607,
[accessed on 10/05/09]
19: European Frequency Information System –ERO, document: EN 300440,
http://www.efis.dk/views2/search-
“The Application of Low-Power Wireless Networks to Wide-Area Distributed Audio Systems”
Flavio Felici
University of Manchester 144
documents.jsp?action=search&low=2&high=3&unit=GHz&applicationterm=-
1&user=1&documenttype=-1&sortingcolumn=0&submitSearch=Search [accessed on
28/04/09];
20: European Frequency Information System –ERO, document: EN 301893,
http://www.efis.dk/views2/search-
documents.jsp?action=search&low=5&high=6&unit=GHz&applicationterm=-
1&user=1&documenttype=-1&sortingcolumn=0&submitSearch=Search [accessed on
28/04/09];
21: Apple Dynamics, Project Technical Requirements Paper, Dr. Roger Brassington,
26/03/09;
Appendix C
Datasheets Front Sheets