RFM69 output power


As I was mentioning in my 1000.1000 Hardware selection, I have opted for the cool RFM69HW radio module. Weirdly enough, in quite a few sources (big distributor and ebay) the higher power HW module is cheaper. So there ie no reason not to get the higher power module, given quantity discounts. But I want it to operate at lower power most of times. The datasheet does not show any differences at lower power, so I had no reason not to go for the higher power module. It even says so on the features list on the front page, I can turn the power down to -18dBm.

What happens?

Unaware of the full details, frustration emerged when I started mixing in both types of modules. The Radiohead implementation I am using (1.71) makes sure no single power value will work for both module types: over 13 dBm and a W module will not work, under 14 dBm and a HW module will not work.  Digging through the code shows no problems, it does not really work as expected, but it should. The datasheet makes things more clear which power amplifier to enable based on the level and the library implements it properly. We can see there is some overlapping in the ranges as well.

A nice graph shows the power levels, from which we can see that the power ranges in the middle are achievable with different configurations.

So doing some digging around the datasheet of the IC, same one present on both modules, we learn that the IC contains 2 types of amplifiers. PA0 is the lower power one and is always directly connected to the LNA input and both to the antenna. For higher power, one has to use additionally the PA1 and PA2 and optionally a BOOST setting to squeeze out the last couple of dB. So how are these connected on the actual module. The RF69 datasheet shows a blurry picture of the module schematic for up to 13dBm output power, on page 76/77. We see that PA1 and PA2 never reach the antenna, just PA0.

Compared to that, the high power RFM69HW uses a switch which is driven by RX/TX pin, after some module reverse engineering. This means that only PA1 and PA2 reach the antenna, and never PA0, during transmission.

Fixing it

The fix lies in understanding how the modules work. Because it uses only PA0,  the RFM69W can only have PA0 turned on and the output power ca be adjusted between -18 and +13 dBm. The high power RFM69HW can only use PA1 or PA2 or both, but never PA0, so the output power range is -2 to +20 dBm. Now the curves on the graph above make sense: the blue one works for RFM69W and the other colors are valid for RFM69HW!

This means that the code used to configure the modules needs to know which type I am using in order to configure the power output within the overlapping range. I fixed the function controlling the output power and will suggest the changes to the Radiohead developers.

With the power setting correctly implemented, the library can properly set a power level, within the limits, for either module. A quick test shows that knowing which module is attached, any power between -18 and +20 dBm can correctly set each module within the appropriate limits. Measuring the RSSI at a nearby node, we can observe that the RFM69HW is capped down below -2 dBm and the RFM69W is capped up above +13 dBm. The measurements were quick and dirty, so take them with a grain of salt.

Hardware  fix

There is a posibile hardware fix: the RF69 IC should make sure not to switch the antenna to PA_BOOST when the power level is set low, but that might require a new chip revision.

The software fix can get the RFM69HW down to -2 dB, with few users wanting to go lower as reducing the output power does not bring much benefit in power consumption.

Code fix for power setting function

Use for whatever other library driving the RFM69, original implementation coming from Radiohead library.

void RH_RF69::setTxPower(int8_t power)
 _power = power;
 uint8_t palevel;
 #ifndef RFM69_HW
 if (_power < -18) _power = -18;
 if (_power > 13) _power = 13; //limit for RFM69W
 palevel = RH_RF69_PALEVEL_PA0ON | ((_power + 18) & RH_RF69_PALEVEL_OUTPUTPOWER);
 if (_power < -2) _power = -2; //RFM69HW only works down to -2.

if (_power <= 13)
 // -2dBm to +13dBm
 //Need PA1 exclusivelly on RFM69HW
 palevel = RH_RF69_PALEVEL_PA1ON | ((_power + 18) & RH_RF69_PALEVEL_OUTPUTPOWER);
 else if (_power >= 18)
 // +18dBm to +20dBm
 // Need PA1+PA2
 // Also need PA boost settings change when tx is turned on and off, see setModeTx()
 palevel = RH_RF69_PALEVEL_PA1ON | RH_RF69_PALEVEL_PA2ON | ((_power + 11) & RH_RF69_PALEVEL_OUTPUTPOWER);
 // +14dBm to +17dBm
 // Need PA1+PA2
 palevel = RH_RF69_PALEVEL_PA1ON | RH_RF69_PALEVEL_PA2ON | ((_power + 14) & RH_RF69_PALEVEL_OUTPUTPOWER);
 spiWrite(RH_RF69_REG_11_PALEVEL, palevel);
Be Sociable, Share!
498 views since Nov 2016

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>