Texas Instruments | AN085 -- Implementing Diversity Using Low Power Radios | Application notes | Texas Instruments AN085 -- Implementing Diversity Using Low Power Radios Application notes

Texas Instruments AN085 -- Implementing Diversity Using Low Power Radios Application notes
Application Note AN085
Implementing ‘Diversity’ Using Low Power Radios
By Mike Burns and Tim Starr
Keywords
•
•
•
•
•
1
•
•
•
•
Antenna Diversity
Amplitude Diversity
Frequency Diversity
CC1100
CC1101
CC1110
CC1111
CC1100E
CC430
Introduction
In this context, the term diversity is used to
describe various strategies for choosing
the best of two (or more) paths (or
channels) for transmitting and/or receiving
an RF signal in order to maximize the
likelihood that a packet will be correctly
received. This note describes techniques
for implementing ‘Single Radio Amplitude
Based Antenna Diversity’ (two antennas,
one radio), ‘Dual Radio Antenna Diversity’
(two antennas, each connected to a
radio), and ‘Single Radio Frequency
SWRA317
Diversity’ (one antenna, one radio, two
frequencies). All of these techniques can
be implemented using one or two low
power
radio(s),
a
low
power
microcontroller, and, if required, an
external RF switch.
This design note uses CC1101 as an
example, but it is also applicable for
CC1100, CC1100E, CC1110, CC1111,
and CC430.
Page 1 of 16
Application Note AN085
Table of Contents
KEYWORDS.............................................................................................................................. 1
1
INTRODUCTION............................................................................................................. 1
2
ABBREVIATIONS........................................................................................................... 2
3
MULTIPATH EFFECTS .................................................................................................. 3
4
SINGLE RADIO AMPLITUDE-BASED ANTENNA DIVERSITY ................................... 3
5
SINGLE RADIO FREQUENCY DIVERSITY .................................................................. 4
6
DUAL RADIO TWO ANTENNA DIVERSITY ................................................................. 4
7
EXPERIMENTAL RESULTS .......................................................................................... 5
7.1
AMPLITUDE BASED ANTENNA DIVERSITY MODE ........................................................... 5
7.2
ONE RADIO, ONE ANTENNA, FREQUENCY DIVERSITY MODE ......................................... 7
7.3
DUAL RADIO ANTENNA DIVERSITY MODE .................................................................. 10
8
QUALIFICATIONS........................................................................................................ 12
9
CONCLUSIONS............................................................................................................ 12
10
REFERENCES.............................................................................................................. 12
11
APPENDIX .................................................................................................................... 13
12
DOCUMENT HISTORY ................................................................................................ 16
2
Abbreviations
AGC
CRC
dB
dBm
EVM
kbps
MHz
mW
PER
RF
RSSI
µs
Automatic Gain Control
Cyclic Redundancy Check
Decibel
Decibel (referenced to one milliWatt)
Evaluation Module
kilo bits per second
Megahertz
milliWatt
Packet Error Rate
Radio Frequency
Received Signal Strength Indication (usually in dB)
Microseconds
SWRA317
Page 2 of 16
Application Note AN085
3
Multipath Effects
Multipath is a phenomenon which occurs when electromagnetic waves bounce off of surfaces
and arrive either in phase (constructive) or out of phase (destructive interference). See Figure
1. This can be problem for stationary transmitters and receivers, but is nearly always an issue
for moving radios, which will experience areas of good reception and bad reception as they
move in an echoic environment. Since the earth is itself a reflector, most ‘real world’
environments are echoic.
Multipath Effects (destructive)
Arriving
180 degrees
out of phase
From direct
signal
Reflective surface
Transmitter
Receiver
Reflective surface
Source: Wikipedia
Figure 1 - Multipath Effects
4
Single Radio Amplitude-Based Antenna Diversity
In this approach, a single radio is used to receive from 2 or more antennas. These antennas
can be placed at right angles to one another to hedge against polarization effects for a given
position, or they can be physically separated, such that as one antenna is experiencing
destructive interference, the other is likely to be experiencing constructive interference. See
Figure 2.
900 MHz
t=0
CONTROL
Antenna 1
MSP430
MicroController
Low Power
Radio
RF
BALUN
900 MHz
t = 4 usec
Antenna 2
SPDT
RF SWITCH
CARRIER SENSE
Figure 2 - Single Radio Amplitude-Based Antenna Diversity
SWRA317
Page 3 of 16
Application Note AN085
Selection of the antenna to be used for reception of a packet is based on the signal strength
observed during the ‘preamble’ portion of a packet. During the preamble, the Received Signal
Strength Indication (RSSI) value is measured using one of the two antennas. The
measurement is then repeated using the other antenna. The antenna giving the larger RSSI
value is then used for reception of the remainder of the packet.
The difficult part of this algorithm is deciding which antenna to select first (before carrier is
sensed). Several possibilities exist, including:
1.
2.
3.
Always use the same antenna
Use the antenna that had the higher signal level (RSSI) during the last received
packet
Alternate between the two antennas until carrier is sensed
Experimentally, approach 2 gives the best results, especially when the signal levels approach
the lower limit of detection. Approach 3 is not practical when using a CC1101 transceiver, due
to the length of time required for the signal strength value (RSSI) to stabilize.
In order to implement this algorithm, the preamble needs to be long enough so that the RSSI
value has time to be read and evaluated by the microcontroller. The time required is
dependent upon several variables, including data rate, receiver bandwidth, and the AGC time
constants. Refer to Application Note DN505 for details [2].
5
Single Radio Frequency Diversity
In this approach, the packet is transmitted at one frequency and then repeated at a different
frequency immediately afterwards. The idea is that if destructive interference is occurring for
the first frequency, constructive interference is possible (or even likely) at the other. Refer to
Figure 3.
900 MHz
t=0
MSP430
MicroController
Low Power
Radio
RF
BALUN
908 MHz
t = 4 msec
Figure 3 - Single Radio Frequency Diversity
Frequency diversity is actually a degenerate form of frequency hopping, or, when done at a
slow rate, frequency agility. More than 2 frequencies can be used, and the criteria for hopping
can differ from system to system. This technique has the added advantage of being less
susceptible to interference from other transmitters, assuming that the interference occurs on
only one of the frequencies in use.
6
Dual Radio Two Antenna Diversity
In this approach, each antenna is connected to a radio. This allows each path to be evaluated
independently and at the same time. This removes the need to retransmit the packet, or to
extend the preamble, as was the case when a single radio is shared between the antennas. It
also avoids the need for an RF switch, but at the cost of an additional radio. Refer to Figure 4.
SWRA317
Page 4 of 16
Application Note AN085
RF
BALUN
Low Power
Radio
900 MHz
t=0
MSP430
MicroController
RF
BALUN
Low Power
Radio
900 MHz
t=0
Figure 4 - Dual Radio Two Antenna Diversity
7
Experimental Results
Experiments were performed to analyze the effectiveness of the three approaches to antenna
diversity described above. In the experiment, the transmitter was placed in the main hallway
of the Texas Instruments office located in Rochester, Minnesota. The receiver was placed
approximately 150 feet away, behind a 6 foot high cubicle wall. There are multiple ‘dry wall’
style walls, metal studs, metal doors, cubicle walls, etc, in the path between the transmitter
and receiver.
The receiver is mounted to the moving platform of a 60 inch linear actuator. The speed of the
actuator is set such that the receiver will move 60 inches in the time it takes to transmit 1000
data packets. In Dual Radio and Amplitude Based Antenna Diversity modes, 1000 packets
are transmitted in 10 seconds, and the receiver is moved at a rate of 6 inches per second. In
Frequency Diversity mode, 1000 packets are transmitted in 20 seconds, and the receiver is
moved at a rate of 3 inches per second.
Figure 5 - 60 inch Linear Actuator with EVM
In the photo, the EVM is located at the ‘zero’ (leftmost) position.
7.1
Amplitude Based Antenna Diversity Mode
The following data was taken using a single radio and two antennas, at a frequency of 900
MHz. The antennas are oriented at an approximate 45 degree angle with respect to the EVM
card, and 90 degrees with respect to each other. They are spaced 3.5 inches apart
(approximately ¼ wave length) at their bases.
SWRA317
Page 5 of 16
Application Note AN085
Figure 6 - Antenna Diversity EVM, Rev B. One Radio Amplitude Based Antenna Diversity
Mode
Test results are shown in Figure 7, below.
Amplitude Based Antenna Diversity - 900.0 MHz 76.8 kbps
-70
RSSI - dB
-80
-90
-100
-110
Ant 1
Ant 2
0
10
20
30
Position in inches
40
50
60
40
50
60
Status
Antenna 2
Antenna 1
Bad Packet
Good Packet
0
10
20
30
Position in inches
Figure 7 - Amplitude Based Antenna Diversity, 900 MHz, 76.8 kbps
SWRA317
Page 6 of 16
Application Note AN085
Packets Received
Packets Lost
Packets Received with No
Errors
Packet Error Rate (PER)
Antenna Used
Errors
1000
0
1000
0.0%
Antenna
Antenna
1
2
565
434
CRC
Other
0
0
Table 1 - Amplitude Based Antenna Diversity Test Results (76.8 kbps)
In the top plot of Figure 7, the blue trace shows the signal strength received by the rightmost
antenna (Ant 1) as a function of position along the linear actuator. The green trace shows the
signal strength received by the leftmost antenna (Ant 2).
Notice how the RSSI value varies by over 15 dB as the radios are moved along the actuator,
and that the two amplitude plots are more or less out of phase. That is, while the amplitude
received from Antenna 1 is decreasing, that received from Antenna 2 is increasing. This is
partially due to the choice of antenna spacing (approximately ¼ wavelength apart), but is
highly dependent upon the environment in which the radios are operating. From this plot it is
a clear that amplitude based antenna diversity should significantly improve PER.
In the bottom plot, the red trace shows whether or not a packet was successfully received.
The green trace shows which antenna was selected. The data presented here was developed
using a CC1101 and a software based antenna selection algorithm. See Appendix.
7.2
One Radio, One Antenna, Frequency Diversity Mode
Figure 8 - Antenna Diversity EVM, Rev B. One Radio. One Antenna, Frequency Diversity
Mode
Results using Frequency Diversity are dependent upon the difference in frequency at which
the two repeated transmissions are made. In the following figure, frequencies of 900 MHz
and 908 MHz were chosen, in part because 908 MHz was less ‘busy’ in the Rochester office.
We are located about 1/4 mile away from a USPS (US Postal Service) distribution center,
SWRA317
Page 7 of 16
Application Note AN085
which apparently uses two way radios operating in the 915 MHz ISM band. Even though the
signal level of this interference is very low (between -80 and -90 dBm), it’s enough to affect
the accuracy and repeatability of measurement results.
Frequency Diversity - f1 = 900.0 MHz f2 = 908.0 MHz Data Rate = 100.0 kbps
RSSI - dB
-70
-80
-90
-100
-110
Frequency 1
Frequency 2
0
10
20
30
Position in inches
40
50
60
40
50
60
Packet Errors
Both
Freq 2
Freq 1
Neither
0
10
20
30
Position in inches
Figure 9 - Frequency Diversity, 900\908 MHz, 100 kbps
Good Packets
Either
1000
Packet Error Rate
(PER)
CRC Errors
Other Errors
Average RSSI
900
MHz
918
0.00%
900 MHz
7
900 MHz
75
900 MHz
-82.7 dBm
908
MHz
985
908 MHz
8
908 MHz
7
908 MHz
-80.4 dBm
Table 2 - Frequency Diversity Test Results (100 kbps)
In the top plot of Figure 9, the blue trace shows the signal strength received at Frequency 1
(900 MHz) as a function of position along the linear actuator. The green trace shows the
signal strength received at Frequency 2 (908 MHz). In the bottom plot, the red trace shows
SWRA317
Page 8 of 16
Application Note AN085
packet errors, and has a value of ‘Freq 1’ when the packet received by on Frequency 1 was
in error (lost or contained a CRC or length error), a value of ‘Freq 2’ when the packet received
on Frequency 2 was in error, and a value of ‘Both’ if packet could not be successfully
received on either frequency. Note that RSSI fell below -95 dBm at 900 MHz when the
receiver was located near its rightmost position (greater than 55 inches), while that at 908
MHz approached its maximum value.
Results at a data rate of 250 kbps are similar; again, all 1000 packets were successfully
received, despite changes in amplitude of more than 20 dB over the length of the actuator.
Frequency Diversity - f1 = 900.0 MHz f2 = 908.0 MHz Data Rate = 250.0 kbps
-60
RSSI - dB
-70
-80
-90
-100
Frequency 1
Frequency 2
0
10
20
30
Position in inches
40
50
60
40
50
60
Packet Errors
Both
Freq 2
Freq 1
Neither
0
10
20
30
Position in inches
Figure 10 - Frequency Diversity, 900\908 MHz, 250 kbps
SWRA317
Page 9 of 16
Application Note AN085
Good Packets
Either
1000
Packet Error Rate
(PER)
CRC Errors
900
MHz
999
0.00%
900 MHz
1
900 MHz
0
900 MHz
-75.2 dBm
Other Errors
Average RSSI
908
MHz
993
908 MHz
2
908 MHz
4
908 MHz
-74.3 dBm
Table 3 - Frequency Diversity Test Results (250 kbps)
7.3
Dual Radio Antenna Diversity Mode
The following data was taken using ‘dual radios’ at a frequency of 900 MHz. Both antennas
are vertically oriented and spaced 3.5 inches apart (approximately ¼ wave length).
Figure 11 - Antenna Diversity EVM, Rev B. Dual Radio Mode
SWRA317
Page 10 of 16
Application Note AN085
Dual Radios - f = 900.0 MHz Data Rate = 100.0 kbps
-70
RSSI - dB
-80
-90
-100
-110
Radio 1
Radio 2
0
10
20
30
Position in inches
40
50
60
40
50
60
Packet Errors
Both
Radio 2
Radio 1
Neither
0
10
20
30
Position in inches
Figure 12 - Dual Radios, 900 MHz, 100 kbps
Good Packets
Either
1000
Packet Error Rate
(PER)
Lost Packets
CRC Errors
Other Errors
Average RSSI
Radio
1
967
0.00%
Radio 1
8
Radio 1
21
Radio 1
4
Radio 1
-82.8 dBm
Radio
2
906
Radio 2
59
Radio 2
35
Radio 2
0
Radio 2
-83.1 dBm
Table 4 - Dual Radio Test Results (100 kbps)
In the top plot of Figure 12, the blue trace shows the signal strength received by the rightmost
radio (Radio 1) as a function of position along the linear actuator. The green trace shows the
signal strength received by the leftmost radio (Radio 2). In the bottom plot, the red trace
shows packet errors, and has a value of ‘Radio 1’ when the packet received by Radio 1 is in
error (lost or contained a CRC or length error), a value of ‘Radio 2’ when the packet received
by Radio 2 is in error, and a value of ‘Both’ if both radios were unable to successfully receive
SWRA317
Page 11 of 16
Application Note AN085
the packet. In this case, this never occurred, even though both radios experienced ‘dropouts’
at some position along the actuator.
8
Qualifications
Please consider the results presented here as typical – in other words, your results will vary!
Results are highly dependent upon the environment in which the tests are performed. For
example, moving the location of the transmitter by as little as a few feet can change results
substantially. The number, composition, and spacing of interior walls in the path between
transmitter and receiver(s) greatly affects signal strength and the phase of reflections, as
evidenced in the RSSI plots.
9
Conclusions
Several techniques for implementing diversity using one or two radios and one or two
antennas have been described. All have been shown to be effective at minimizing multipath
effects. Table 5 compares the pros and cons of the techniques.
Diversity Technique
HW implemented
amplitude based one
radio two antennas
(Amplitude Diversity)
SW implemented
amplitude based one
radio two antennas
(Amplitude Diversity)
Cost/Size
medium
Pros
No impact on data rate or
packet length.
Cons
Requires two
antennas and an
external RF switch.
medium
No impact on data rate or
packet length. Algorithm
easily changed in software.
Two radio two
antenna (Dual Radio
Antenna Diversity)
high
No impact on data rate or
packet length. No external RF
switch required.
One radio, one
antenna, dual
frequency
(Frequency Diversity)
low
Only a single antenna is
required. Can be less
sensitive to interference from
other devices.
Requires two
antennas and an
external RF switch.
Requires a relatively
long preamble1.
Higher power
consumption than
Amplitude Diversity
due to simultaneous
use of two radios.
Requires two
antennas.
Effective data rate is
50% of set rate, since
each packet must be
sent twice. Higher
power consumption
than Amplitude
Diversity due to
packet repeat.
Table 5 - Diversity Techniques Comparisons
10 References
1
The length of the preamble must exceed twice the time required for the RSSI value
to stabilize, which depends upon signal amplitude, data rate, RX filter Bandwidth and
AGC settings, plus approximately 50 usec (algorithm overhead). Maximum preamble
length is 24 bytes for the CC1101. This is sufficient for the single radio amplitudebased antenna diversity algorithm.
SWRA317
Page 12 of 16
Application Note AN085
[1]
Design Note DN500 “Packet Transmission Basics” (http://www.ti.com/lit/swra109)
[2]
Design Note DN505 “RSSI Interpretation and Timing” (http://www.ti.com/lit/swra114)
[3] CC1101 Data Sheet (http://www.ti.com/lit/swrs061)
11 Appendix
A code segment implementing one radio two antenna amplitude based antenna diversity
using the MSP430 is provided below.
For this example, a data rate of 76.8 kbps was chosen, with a 12 byte preamble. Using
values recommended by Texas Instrument’s SmartRF Studio for the CC1101 for this baud
rate, the receiver bandwidth (232.1 kHz), AGC Filter Length (2), and Wait Time (3), the
CC1101 device requires approximately 310 microseconds to obtain a valid RSSI value after
an antenna is selected and the carrier is sensed.
#define RF1 0
#define RF2 1
001
002
003
004
005
006
007
pktslost = csensed = 0;
usingRF1 = usingRF2 = 0;
no_errors = crc_errors = other_errors = 0;
rssisum[RF1] = rssisum[RF2] = 0;
ant = RF1;
// default to antenna 1 (RF1)
P1OUT &= ~SW_RF2;
P1OUT |= SW_RF1;
008 for (pktattempts = 0; pktattempts < 2000; pktattempts++) {
009
Strobe_Radio1_Reg(TI_CCxxx0_SRX); // Change state to RX
010
011
012
013
014
TBCTL &=
TBCCR0 =
TBCTL |=
TBCTL |=
csense =
~0x0030;
10000;
TBCLR;
MC_1;
0;
//
//
//
//
Stop Timer B
Set stop count (10 msec)
Clear Timer B
Set mode to UP
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
while (1) {
// Loop until either SYNC is detected or Timer B exceeds 9 msec
if (TBR > 9000) {
Strobe_Radio1_Reg(TI_CCxxx0_SIDLE);
// Exit RX state (go to IDLE)
Strobe_Radio1_Reg(TI_CCxxx0_SFRX);
// Flush the RX FIFO
pktslost++;
syncdetected = 0;
break;
// beak out of ‘while’ loop (to line 073)
}
if (csense == 0) {
// if carrier has been sensed, skip this code segment
if ((GDO2_Radio1_PxIN & GDO2_Radio1_PIN) > 0) {
// if Carrier sensed
csense = TBR;
// Mark the time
do {
// See if CS remains high for 400 usec
if ((P3IN & GDO0_Radio1_PIN) > 0) {
// if SYNC has been detected
csense = 0;
// abort this code segment
break;
// beak out of ‘do’ loop (to line 036)
}
if ((P3IN & GDO2_Radio1_PIN) == 0) { // if Carrier Sense drops
csense = 0;
// abort this code segment
break;
// beak out of ‘do’ loop (to line 036)
}
} while (TBR < (csense + 400));
036
037
038
039
040
041
042
043
044
045
046
047
048
if (csense > 0) {
// If CS has remained high for 400 usec
rssi = (signed char) Read_Radio1_Status(0x34);
rssidb1st = (rssi / 2) - 74;
rssisum[ant] += rssidbfirst;
csensed++;
ant^= 0x01;
// Swap antennas
if (ant == RF1) {
P1OUT &= ~SW_RF2;
// Select Antenna 'RF2'
P1OUT |= SW_RF1;
}
else {
P1OUT &= ~SW_RF1;
// Select Antenna 'RF2'
P1OUT |= SW_RF2;
SWRA317
Page 13 of 16
Application Note AN085
049
050
051
052
053
054
055
}
csense = TBR;
// Mark the time
while (TBR < (csense + 400)); // wait 400 usec
rssi = (signed char) Read_Radio1_Status(0x34);
rssidb2nd = (rssi / 2) - 74;
rssisum[ant] += rssidb2nd];
if (rssidb1st > rssidb2nd)
// if the RSSI from the antenna selected
// first is greater than that from the
// antenna selected second
ant^= 0x01;
// Swap antennas
if (ant == RF1) {
P1OUT &= ~SW_RF2;
// Select Antenna 'RF1'
P1OUT |= SW_RF1;
usingRF1++;
}
else {
P1OUT &= ~SW_RF1;
// Select Antenna 'RF2'
P1OUT |= SW_RF2;
usingRF2++;
}
056
057
058
059
060
061
062
063
064
065
066
067
068
069
}
070
if ((P3IN & GDO0_Radio1_PIN) > 0) {
}
}
// end of ‘csense > 0’ if
// end of ‘csense == 0’ if
071
072
073
074
}
075
076
if (syncdetected == 0)
continue;
// if no packet was detected
// go to end of ‘for’ loop
077
078
079
TBCTL &= ~0x0030;
TBCTL |= TBCLR;
TBCTL |= MC_1;
// SYNC has been detected - Stop Timer B
// Clear Timer B
// Set mode to UP
080
while (1) {
}
syncdetected = 1;
break;
// If GDO0 of Radio 1 goes high
// (SYNC detected)
// beak out of ‘while’ loop (to line 075)
// end of first ‘while (1)’ loop
081
082
083
084
085
086
087
088
089
090
091
092
093
094
// loop until either GDO0 drops or Timer B exceeds
// SLAVE_RX_TIMEOUT_PER
if ((P3IN & GDO0_Radio1_PIN) == 0) {
// If GDO0 subsequently drops ...
pktrcvd |= PKT_RCVD_Radio1;
// A packet was received
rc = RFReceivePacket_Radio1((char *) &rxbufrp, &pktlen);
switch (rc) {
case 0:
// Good Packet
no_errors++;
break;
case 1:
// CRC error
crc_errors++;
break;
default:
// All other errors
other_errors++;
break;
} // end of ‘switch’ statement
095
096
}
097
098
099
100
101
102
103
TBCTL &= ~0x0030;
// end of GDO0 dropped ‘if’
// Stop Timer B
if (TBR > slavetimeout[datarate]) {
Strobe_Radio1_Reg(TI_CCxxx0_SIDLE);
// Abort RX
Strobe_Radio1_Reg(TI_CCxxx0_SFRX);
// Flush the RX buffer
break;
// beak out of ‘while’ loop (to line 103)
}
// end of timeout ‘if’
}
// end of second 'while (1)' loop
}
// end of ‘for’ loop
The algorithm makes use of the CC1101’s ‘Carrier Sense’ and ‘Sync Word Found’ flags.
These signals can be made available on the GDO0 and GDO2 pins through the IOCFG0 and
IOCFG2 radio registers. See the ‘Configuration Registers’ section of the CC1101 Data Sheet.
The CC1101’s ‘GDO0’ pin is connected to a DI pin on the controlling MSP430, and the
IOCFG0 register is set such that the pin goes high after a valid SYNC field is detected and
low after the packet is entirely received (IOCFG0 set to 0x06). Similarly, the CC1101’s
‘GDO2’ pin is connected to another DI pin, and the IOCFG2 register is set (to 0x0E) such that
the pin goes high when carrier is sensed (RSSI level is above a programmable threshold).
SWRA317
Page 14 of 16
Application Note AN085
Note that the amplitude at which the ‘Carrier Sense’ flag is raised is dependent upon the
settings
in
CC1101
registers
AGCCTRL2.MAX_DVGA_GAIN
and
AGCCTRL2.MAX_LNA_GAIN. See page 8 of DN505. For best performance in this
application both AGCCTRL2.MAX_DVGA_GAIN and AGCCTRL2.MAX_LNA_GAIN should
be set to zero.
For this implementation, SPDT RF switch is used. It is controlled by two MSP430 DO bits
(bits 2 and 3 of P2).
The above code segment attempts to receive 1000 packets from a remote transmitter. The
number of ‘good’ packets is calculated, along with the number of those with CRC and ‘other’
(length, filtering) errors. In addition, the number of times the ‘RF1’ (right) and ‘RF2’ (left)
antennas were selected is calculated.
Details
Lines 6 – 7: Setting bits 2 and 3 of P2OUT to 01b selects Port ‘RF1’ of the RF Switch; setting
bits 2 and 3 of P2OUT to 10b selects Port ‘RF2’ of the RF Switch.
Line 9: Turn on the Receiver.
Lines 10 – 13: Timer B is used in ‘up’ mode as a ‘timeout’ indicator. The timer counts up one
count every usec. Register TBR holds the current ‘tic’ count.
Lines 15 – 74: Loop until one of two events occurs:
TBR exceeds a value of 9000. Lines 16 – 22. If neither Carrier nor SYNC is detected by this
time, the packet is lost. The radio is forced into the IDLE state and the RX FIFO is flushed.
SYNC is detected. Lines 70 – 73.
Lines 24 – 35: Once carrier is detected (the GDO2 line goes high), record the time (TBR) at
which carrier is first sensed (line 25). Loop for 400 usec (lines 26 – 35), but abort the loop if
SYNC is detected (GDO0 goes high) or Carrier Sense (GDO02) drops. If either of these two
events occurs during the 400 usec period, csense will be re-set to zero.
Lines 36 – 68: Once it is verified that the Carrier Sense flag has gone high and remained high
for a period of 400 usec (csense > 0), calculate ‘rssidb1st’, the RSSI value of the signal
received using the currently selected antenna (lines 37 and 38). See DN505 for an
explanation of the calculation. Swap antennas, wait an additional 400 usec to allow for the
RSSI value to stabilize, and calculate ‘rssidb2nd’, the RSSI value of the signal received using
this antenna (lines 50 - 54). If rssidb1st exceeds rssidb2nd, swap the antennas again (lines
55 - 56). Set the antenna switch and increment usingRF1 or usingRF2 as appropriate (lines
57 - 66).
Lines 75 and 76: If SYNC was never detected, jump to the ‘end of the loop’.
Lines 77 – 79: If we get to this point in the code, SYNC has been detected. Reset Timer B.
Lines 80 – 102: Loop until one of two events occurs:
SYNC (GDO0) goes low, indicating that a packet has been received (lines 81 - 96).
The Timer B tic count (TBR) has exceeded SLAVE_RX_TIMEOUT_PER. Should this
condition occur, force the receiver into the IDLE state, flush the RX FIFO, and ‘break’ out of
the loop (lines 97 – 101).
Lines 82 – 96: A packet has been received. Subroutine RFReceivePacket checks for packet
errors (CRC, Packet Length, Address) and transfers data from the CC1101’s RX buffer to
MSP430 memory. The various counts are incremented as appropriate.
SWRA317
Page 15 of 16
Application Note AN085
Line 95: Stop Timer B.
12 Document History
Revision
SWRAxxx
Date
yyyy.mm.dd
Description/Changes
Initial release.
SWRA317
Page 16 of 16
IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements,
and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should
obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are
sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.
TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard
warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where
mandated by government requirements, testing of all parameters of each product is not necessarily performed.
TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and
applications using TI components. To minimize the risks associated with customer products and applications, customers should provide
adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right,
or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information
published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a
warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual
property of the third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied
by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive
business practice. TI is not responsible or liable for such altered documentation. Information of third parties may be subject to additional
restrictions.
Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all
express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not
responsible or liable for any such statements.
TI products are not authorized for use in safety-critical applications (such as life support) where a failure of the TI product would reasonably
be expected to cause severe personal injury or death, unless officers of the parties have executed an agreement specifically governing
such use. Buyers represent that they have all necessary expertise in the safety and regulatory ramifications of their applications, and
acknowledge and agree that they are solely responsible for all legal, regulatory and safety-related requirements concerning their products
and any use of TI products in such safety-critical applications, notwithstanding any applications-related information or support that may be
provided by TI. Further, Buyers must fully indemnify TI and its representatives against any damages arising out of the use of TI products in
such safety-critical applications.
TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products are
specifically designated by TI as military-grade or "enhanced plastic." Only products designated by TI as military-grade meet military
specifications. Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-grade is solely at
the Buyer's risk, and that they are solely responsible for compliance with all legal and regulatory requirements in connection with such use.
TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI products are
designated by TI as compliant with ISO/TS 16949 requirements. Buyers acknowledge and agree that, if they use any non-designated
products in automotive applications, TI will not be responsible for any failure to meet such requirements.
Following are URLs where you can obtain information on other Texas Instruments products and application solutions:
Products
Applications
Amplifiers
amplifier.ti.com
Audio
www.ti.com/audio
Data Converters
dataconverter.ti.com
Automotive
www.ti.com/automotive
DLP® Products
www.dlp.com
Communications and
Telecom
www.ti.com/communications
DSP
dsp.ti.com
Computers and
Peripherals
www.ti.com/computers
Clocks and Timers
www.ti.com/clocks
Consumer Electronics
www.ti.com/consumer-apps
Interface
interface.ti.com
Energy
www.ti.com/energy
Logic
logic.ti.com
Industrial
www.ti.com/industrial
Power Mgmt
power.ti.com
Medical
www.ti.com/medical
Microcontrollers
microcontroller.ti.com
Security
www.ti.com/security
RFID
www.ti-rfid.com
Space, Avionics &
Defense
www.ti.com/space-avionics-defense
RF/IF and ZigBee® Solutions www.ti.com/lprf
Video and Imaging
www.ti.com/video
Wireless
www.ti.com/wireless-apps
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2010, Texas Instruments Incorporated
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising