LMIC Library Power levels

I was following the guide and program for a simple TTN node that Andreas Spiess presented a video. The program uses the LMIC library.

The program works fine and the packets show up in the TTN device console.

I added some of my own diagnostics, I read back the LoRa device registers after a packet send and display, frequency, bandwidth, spreading factor, coding rate and power level.

I had assumed the power level would be set for 14dBm/25mW, but LoRa device is reporting its set to 16dBm/40mW .

Now the appropriate register for power level is RegPaConfig and its set in radio.c

static void configPower () {
#ifdef CFG_sx1276_radio
// no boost used for now
s1_t pw = (s1_t)LMIC.txpow;
if(pw >= 17) {
pw = 15;
} else if(pw < 2) {
pw = 2;
}
// check board type for BOOST pin
writeReg(RegPaConfig, (u1_t)(0x80|(pw&0xf)));
writeReg(RegPaDac, readReg(RegPaDac)|0x4);

#elif CFG_sx1272_radio
// set PA config (2-17 dBm using PA_BOOST)
s1_t pw = (s1_t)LMIC.txpow;
if(pw > 17) {
pw = 17;
} else if(pw < 2) {
pw = 2;
}
writeReg(RegPaConfig, (u1_t)(0x80|(pw-2)));
#else
#error Missing CFG_sx1272_radio/CFG_sx1276_radio
#endif /* CFG_sx1272_radio */
}

I have CFG_sx1276_radio selected so the power level is set by;

writeReg(RegPaConfig, (u1_t)(0x80|(pw&0xf)));

Which writes the pw variable into the register.

Now if pw is 14 (for 14dBm) the power level of the device is according to the datasheet;

Pout=17-(15-OutputPower)

Now ‘OutputPower’ is what is written to bits 3-0 of RegPaConfig and if its 14 the actual power level selected appears to be;

Pout=17-(15-14) = 16dBm.

Which is in line with my diagnostic print, which suggested the power level is being set to 16dBm when 14dbm is expected.

Is it possible the LMIC code should be;

writeReg(RegPaConfig, (u1_t)(0x80|(pw&0xf)-2));

Or is there some deliberate compensation going on ?

When the LMIC CFG_eu868 setting are in use (Europe) for the frequencies concerned, 868.1Mhz, 868.3Mhz and 868.5Mhz for instance, what is the maximum radiated power limit ?

just fyi

Indeed, if you want the 20dBm output, you have to program for 17dBm and set the correct value in RegPaDac