Other Parts Discussed in Thread: CC2592, Z-STACK, CC2591
Hi all,
So, my workplace has come up with a design that is based around a CC2538+CC2592 combination chipset for wireless communications, running the OpenThread stack, and for the most part it works reasonably well. However, at a few sites we've suffered issues where a node has been seemingly "jammed", prevented from transmission, and we're wondering if maybe, it's a clear channel assessment related issue.
Our radio driver is more-or-less the standard OpenThread CC2538 driver: I actually contributed a lot of the CC2592 integration work upstream.
Reading the user manual for the CC2538, I see the CCA threshold is set in RFCORE_XREG_CCACTRL0; the least significant 8-bits is a signed integer representing the CCA threshold in dBm; with an offset of 73dBm applied. It also later on discusses RSSI as having the same 73dBm offset.
The CC2538 datasheet talks about the power-on reset being inappropriate and suggesting a value of 0xf8 (which oddly enough, matches the "reset value" documented on that very page) which equates to around -81dBm. This is 7dB above the supposed -88dBm receiver sensitivity described in the CC2538 datasheet. I guess there needs to be some margin, but why 7dB margin?
On the CC2592 datasheet, it discusses the relative gain achieved with different HGM settings; nominally 11dB if turned on or 6dB if turned off. In our application we're running from a fairly stable regulated power supply, and the temperature won't be changing wildly from typical room temperature, but we could be almost anywhere on the 2.4GHz band, so the ±2dB gain variation by frequency needs to be considered. Apparently that variation assumes HGM=1, so 11dB gain could in fact be between 9dB and 13dB. I'm not sure how the CC2592 behaves in this regard with HGM=0.
Now, AN130 (SWRA447) talks about how to get the CC2538 to play nice with a CC2592. In it, it discusses the effect the LNA has on the RSSI values: if high-gain mode is enabled, the offset changes to 85dBm, whereas with it turned off, the value should be 81dBm. I took care of that in this commit.
There's no discussion in this document about how CCA thresholds should be adjusted. if at all. I've tried fiddling with some numbers with pen and paper, but gotten nowhere.
According to AN130, the CC2592 can add anywhere between 9dB and 13dB of gain, depending on frequency, voltage and ambient temperature. Sensitivity apparently gets down to -99dBm (so ~11dB improvement on a "barefoot" CC2538) with high-gain mode off, or down to -101dBm (~13dBm improvement; the "best case"). I can see where the -101dBm (HGM=1) figure comes from, but not the -99dBm (HGM=0) figure. From where I sit, there's a few possible options:
- I could just reduce the thresholds by 13dB when HGM=1 or 6dB(?) when HGM=0… so -8 (0xf8) becomes -21 (0xeb) when HGM=1 or -14 (0xf2) with HGM=0
- I could apply the offsets used with RSSI to the CCA thresholds and leave the "sensitivity" where it is; so -81 + 85 = 4 (0x04) with HGM=1 or -81 + 81 = 0 (0x00) with HGM=0
- I could just substitute the -81dBm sensitivity with the value from AN130; so -101 + 73 = -28 (0xe4) for HGM=1 or -99 + 73 = -26 (0xe6) with HGM=0
Or do combinations of the three above. Question is, what is the correct approach here? Or are we barking up the wrong tree and should be looking elsewhere for our comms issues?