Author Topic: Standardise Mote configuration using RFM69HW only  (Read 1343 times)

Robert

  • Jr. Member
  • **
  • Posts: 56
  • Country: be
Standardise Mote configuration using RFM69HW only
« on: April 02, 2017, 05:29:34 AM »
Edit by Felix: For completeness sake, this excellent guide to RFM69 power options should also be considered.
See also:
https://lowpowerlab.com/forum/low-power-techniques/using-an-rfm69hw-in-low-power-mode-as-rfm69w/msg16410/#msg16410
https://lowpowerlab.com/forum/moteino/standardize-on-rfm69hw-radio/msg6466/#msg6466

Mixing RFM69W and RFM69HW transceivers in a single network makes the mote hardware / software configuration cumbersome.
So for a few extra cents the idea is to standardise the usage of RFM69HW hardware for all motes. However some motes may have less power than the one required by RFM69HW transceivers, typically because they are running on battery in a low power mode, it is therefore important to understand how to set RFM69HW to be power equivalent to RFM69W.
Notes:
1. The following considerations are true for a static configuration (no ATC)
2. RFM69CW is equivalent to RFM69W but with another pin-out that fits to the footprint of a RFM12B (compatible with Moteino R4/5)
3. RFM12B is depreciated and is not considered
4. RFM69HCW is equivalent to RFM69HW but with another pin-out than the RFM69CW or RFM12B, so it can’t be used on a Moteino R4/5 (see MoteinoLR).
4. RFM69HCW is equivalent to RFM69HW but with another pin-out than the RFM69CW or RFM12B, so it can’t be used on a Moteino R4 (see MoteinoR5/6).
The difference between the RFM69W and RFM69HW resides in the transmission power by usage of a power amplifier and a power boost mode (see Table 10 of  the RFM69HW data sheets):
The difference between the RFM69W (RFM69CW) and RFM69HW (RFM69HCW) resides in the transmission power by usage of a power amplifier and a power boost mode (see Table 10 of  the RFM69HW(RFMHCW) data sheets):
For RFM69HW (RFM69HCW) power; only one mode is foreseen:
  from -18dBm to +13dBm (or max 45mA)  or mode 0

For RFM69HW (RFM69HCW) power four modes are foreseen
  from -18dBm to +13dBm (or max 45mA)  - RFM69HW(HCW) mode 0
  from -2dBm to +13dBm (or max 45mA)   - RFM69HW(HCW) Boost mode 1
  from +2dBm to +17dBm (or max 95mA)   - RFM69HW(HCW) Boost mode 2
  from +5dBm to +20dBm (or max 130mA   - RFM69HW(HCW) Boost mode 3

Notes:
1. There is no software way to detect if the transceiver is a RFM69W(CW) or RFM69HW(HCW).
    Only visual inspections shows 2 extra chips
2. The voltage required for a RFM69HW(HCW) is:
   2.4V for 17dBm (mode 2) and 3.6V for 20dBm (mode 3)

Actually 4 registers are driving the transmitter power configuration.
Transmit amplifiers            - RegPaLevel     address      0x11
Overload protection           - RegOcp          address      0x13
Power Amplifier Boost PA1  - RegTestPa1    address      0x5A (only for RFM69HW(HCW))
Power Amplifier Boost PA2  - RegTestPa2    address      0x5C (only for RFM69HW(HCW))

The power amplifier activation is function of the PA0,PA1 and PA2 bits of the RegPaLevel, respectively bits 7,6 and 5.
The power level itself is function of the 5 lower bits of the RegPaLevel (bits 0 to 4).
RFM69W uses only PA0, while RFM69HW uses PA0, PA1 and PA2.
See Table 10 of the RFM69HW data sheet for bit settings.

However with the implementation of the RF69 chip on the RFM69HW(HCW) hardware, activation PA0 is not possible, making the straight forward configuration of an RFM69HW(HCW) as an RFM69W(CW) impossible.

Also the RFM69Library simplifies the RFM69 configuration to only two modes, normal (0) or high-power (3).
The normal or default mode configures the RF69 registers as for an RFM69W(CW), while the high-power mode configures the transceiver as an RFM69HW(HCW) in Boost mode 3 ONLY.

It is important to note that there are 2 ways to configure an RFM69HW(HCW):
1. Using the instance declaration:
RFM69(uint8_t slaveSelectPin=RF69_SPI_CS, uint8_t interruptPin=RF69_IRQ_PIN, bool isRFM69HW=false, uint8_t interruptNum=RF69_IRQ_NUM)
With:
 RF69_SPI_CS = SPI Slave Select pin
 RF69_IRQ_PIN = Interrupt pin
 isRFM69HW = true for a RFM69HW transceiver
 RF69_IRQ_NUM = interrupt number corresponding to the interrupt pin
2. Using the function RFM69::setHighPower(true)
Both are mutually exclusive so setting “isRFM69HW true ” in the declaration and setHighPower(false) will set the transceiver as a RFM69W transceiver! which of course will not work with a RFM69HW.

Through the library the register configuration are the following:
                        Address   RFM69W(CW)   RFM69HW(HCW)
RegPaLevel        0x11        0x9F              0x7F (mode 3 +20dBm)
RegOcp             0x13        0x1A              0x0F (no overload protection)
RegTestPa1        0x5A        0x55              0x55 (Receive)   0x5D (Transmit)
RegTestPa2        0x5C        0x70              0x70 (Receive)   0x7C (Transmit)

One way to adapt the power of the RFM69HW(HCW) to be compatible with the RFM69W(CW) is to adjust the power level RFM69::setPowerLevel(uint8_t powerLevel) to be in the range of the power of the RFM69W(CW).
The actual power used is determined by the values of RegPaLevel bits 0-4.
For RFM69W the 4 bits are used, giving 32 possibilities, while for the RFM69HW, only 3 bits are uses giving only 16 possibilities.
For RFM69W the 5 bits are used, giving 32 possibilities, while for the RFM69HW, only 4 bits are uses giving only 16 possibilities.
So with the present library, the compatible range between an RFM69W(CW) and RFM69HW(HCW) is between +5 and +13dBm or 9 possibilities
Also the power level defined for a RFM69HW(HCW) module is DIVIDED BY 2 through the library function, so the actual values for an RFM69HW(HCW) module are from 0 to 15 but programmed by steps of 2 values (e.g, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30).
Obviously setting the value to 0 and 1 gives 0, 2 and 3 gives 1, etc…

Only the first 9 values are compatibles with the RFM69W(CW), actual values 0 to 8. Practically to take account of the division by 2, from 0 to 16  (+5dBm to +13dBm) by steps of 2 (0,2,4,6,8,10,12,14,16)
For default value, a RFM69HW(HCW) power value of 16 correspond to a +13dBm, the maximum power o a RFM69W(CW)
IMPORTANT to note the set power level should be done AFTER the High-power setting.

However even with this configuration, the RegTesPa1 and RegTestPa2 are still modified in transmit through library functions, and the over current protection is disabled (as recommend by HopeRf for power > 17dBm). This as an unknown effect to the actual power consumption (I do not have the equipment to actually measure the power consumption with this setting and for power > 17dBm). Therefore the configuration above should not be recommended.

There are two solutions:
1. Modify the library to offer a compatible mode; this solution is probably too cumbersome
2. Script some extra steps to configure the appropriate registers.

Here are the proposed settings:
The most appropriate power mode that is compatible with the RFM69W is the mode 1.
To achieve this configuration, the following register should be set as:

                                        RFM69HW(HCW)
RegPaLevel       0x11        0x5F (+13dBm)
RegOcp            0x13        0x1A (95mA overload protection)
RegTestPa1       0x5A        0x55 (no 20dBm PA_BOOST on PA1)
RegTestPa2       0x5C        0x70 (no 20bBm PA_BOOST on PA2)

Note that the power may be adjusted by the set RFM69::setPowerLevel(uint8_t powerLevel), no division by 2 is done (because the transceiver is not declared as RFM69HW(HCW)) leaving the possible values from 0 to 16 (-2 to +13dBm). The following example gives a practical configuration:

Code: [Select]
RFM DEFINITIONS
#define RFM69HW            // Indicate the use of a RFM69HW or a RFM69HCW transceiver
#define MODE_RFM69W         // Indicate that it should be configured as a RFM69W or RFM69CW power consumer   
#define NODEID      99
#define NETWORKID   100
#define FREQUENCY   RF69_433MHZ

RFM69 radio();

void setup ()
{
...
radio.initialize(FREQUENCY,NODEID,NETWORKID);
//Check for the appropriate RFM settings (type if transceiver and power mode
#if defined (RFM69HW) && defined (MODE_RFM69W) 
{
  radio.writeReg (0x11, 0x5F);      // Configure the RegPaLevel mode 1 +13dBm
  radio.writeReg (0x13, 0x1A);      // Configure the RegOcp For overlaid protection 95mA
                              // Note that RegTestPa1 and RegTestPa2 are using default values (0x55 and 0x70)
}
#else
  #ifdef RFM69HW
  radio.setHighPower();             // Set default High-Power Mode 3 (+20dBm)
  #endif
#endif
...
}
« Last Edit: April 04, 2017, 04:32:18 PM by Felix »

Robert

  • Jr. Member
  • **
  • Posts: 56
  • Country: be
Re: Standardise Mote configuration using RFM69HW only
« Reply #1 on: April 03, 2017, 01:57:56 PM »
I just realised that this topic is out of scope, Moteino R5 doesn't support RFM69HW anymore  :(

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5959
  • Country: us
    • LowPowerLab
Re: Standardise Mote configuration using RFM69HW only
« Reply #2 on: April 03, 2017, 02:13:12 PM »
Robert, I need to reply to your other thread. BUT R5 does support HCW which is equivalent to HW :)
The only difference is in board format/layout/pinout. Otherwise it's identical in use from the sketch side. That's not to say that a future batch or revision will not also support the W/CW variants. It's something I need to weigh in. The last thing I will add here is that the HW/HCW is the same as a W/CW, with the added extra power of 7dBm (ie total of 20dBm vs just 13dBm). That is about 4 times greater transmit power. The other difference would be in that HW/HCW don't go as low transmit power as the W/CW but generally that's not an issue even with battery powered motes.
More in a bit, your voice is heard for sure, thanks for the patience.
« Last Edit: April 03, 2017, 11:30:23 PM by Felix »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5959
  • Country: us
    • LowPowerLab
Re: Standardise Mote configuration using RFM69HW only
« Reply #3 on: April 03, 2017, 11:31:00 PM »
Good news : I just added the CW footprint to the barely released R5 so ... technically this would be an R6 that takes: RFM69CW/HCW, RFM92-98, RFM12B... anyone not satisfied with the possibilities?

Robert

  • Jr. Member
  • **
  • Posts: 56
  • Country: be
Re: Standardise Mote configuration using RFM69HW only
« Reply #4 on: April 04, 2017, 04:10:38 AM »
Felix,

Great to hear that the RFM69CW will be supported in the future (however I still have an issue with my RFM69HW modules that I have in stock, that will not fit to the new Moetino’s, anyway that's live ::)).
I did check with dealers that still refer to Moteino R4, but there is no way to buy a bare version

I also have modified the topic above to cover the RFM69HCW transceiver.

Note: about low power; may experience (in house) with RFM69W is that power below +13dBm decreases drastically the coverage, however +13dBm with a current of 45mA is a lot for a battery powered module. So yes configuring a RFM69HW with a power range between -2 to +17dBm is OK for low power configuration, of which the power should be tuned according the environment.

Robert
 

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5959
  • Country: us
    • LowPowerLab
Re: Standardise Mote configuration using RFM69HW only
« Reply #5 on: April 04, 2017, 08:15:34 AM »
Robert,
The yellow Moteinos with trace antenna will take W/HWs. The price is the same and you can even remove the trace antenna side if you dont want it - score it with a utility knife on both sides and snap it off. Then you would have a yellow R4 :)
Also I still have MoteinoMEGAs that take W/HW, as well as yellow MoteinoMEGAs with trace antenna. So ... there's a few options for you if you really want to use those HWs. I'm sure you can use them in other ways as well.
I think I may standardise on the HCW and CW footprints since they both fit together. I will make some prototypes and if all goes well that will be the next release.

ChemE

  • Sr. Member
  • ****
  • Posts: 402
  • Country: us
Re: Standardise Mote configuration using RFM69HW only
« Reply #6 on: April 04, 2017, 10:00:40 AM »
Good news : I just added the CW footprint to the barely released R5 so ... technically this would be an R6 that takes: RFM69CW/HCW, RFM92-98, RFM12B... anyone not satisfied with the possibilities?

WOOT!  Thanks for keeping that feature Felix!