A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/mcci-catena/arduino-lmic/issues/50 below:

Incorrect calculation of power values · Issue #50 · mcci-catena/arduino-lmic · GitHub

This code looks wrong.

// 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);
  1. If pw is 16, it will pass through unchanged, but then the mask with 0xF will cause bits 3..0 of RegPaConfig to be set to zero instead of the desired 0xF.
  2. if pw is 2..15, it will be written to RegPaConfig, but since bit 7 is also set, the output power is interpreted as 17-(15-OutputPower) [or OutputPower + 2]. So pw == 2 sets output power = 4 dBm; pw == 15 or >= 17 sets 17 dBm; and pw == 16 sets 0 dBm.

It would be best to revise this code along with the fixes for #46 so that we can handle PaSelect == 0; in that case MaxPower should be set based on the region's maximum output power, allowing finest control and then OutputPower would be adjusted within the resulting range. (We could get as low as -4.2 dBm.)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4