jgromes / RadioLib

Universal wireless communication library for embedded devices
https://jgromes.github.io/RadioLib/
MIT License
1.48k stars 373 forks source link

Allow use of low power PA for SX1262/SX1268, perhaps SX1261 #880

Closed S5NC closed 9 months ago

S5NC commented 9 months ago

See 13.4.4 SetTxParams in the SX1261/2 and SX1268 datasheet. Use case: The SX1262's low power PA is assumed to have less noise than the higher power PA. A 9 dBm input is needed to reach the P1dB of an external PA. 9 dBm can be provided via the SX1262's high or low power PA, in this case it is best to provide it via the low power PA.

The output power is defined as power in dBm in a range of • - 17 (0xEF) to +14 (0x0E) dBm by step of 1 dB if low power PA is selected • - 9 (0xF7) to +22 (0x16) dBm by step of 1 dB if high power PA is selected

jgromes commented 9 months ago

Let's take a look at the relevant datasheet sections (taken from DS.SX1261-2.W.APP, Rev. 1.2):

Screenshot_74

This references the SetPaConfig command:

Screenshot_75

The description of that command claims that deviceSel should be used to selected between the SX1261 and SX1262 devices. So, does SX1262 really implement both a low power and a high power PA? I was not able to find that information in the datasheet.

S5NC commented 9 months ago

That's really interesting, I hadn't thought of that. Maybe they meant to say "if high power PA model is selected" meaning SX1262. On https://www.semtech.com/design-support/lora-calculator if you select SX1262, your TX power options are limited to the range -9 to +22 dBm, but if you select the SX1261, you are limited from -17 to +14 dBm, this would be in line with this theory. The wording below also increased my suspicions:

image

And the below seems to imply that the range for both radios is having 32 options for power, for the SX1262 this would be 22 dBm to -9 dBm

image

image

However, an indication that there is both a high and low power PA in the SX1262 is the line, or maybe it is just because the PAs used are different?:

hpMax selects the size of the PA in the SX1262, this value has no influence on the SX1261

There are 8 possible values (inclusive, inclusive) from 0x00 to 0x07. -9 (high power mode minimum power), but lowering the power by 7 intervals using this would result in a minimum power of -16 dBm, not -17 dBm, besides one would expect an on/off toggle between a low or high power PA if there were two of them.

Now I check, it seems this may be you last year: https://forum.lora-developers.semtech.com/t/sx1262-tx-power-less-than-10-dbm/1354 I agree that it is ambiguous wording on their datasheet, but I am glad you could get a response from an official Semtech rep.

jgromes commented 9 months ago

Honestly, I was always confused about the SX126x power configuration, there's just way too many magic parameters for me to like. I think that the reference about hpMax is just because the PA is different, though I never got too deep into that. And you are right, that is me from one year ago.

I think at some point the Semtech support guys mentioned a new release for the datasheet with some more information about previously undocumented features, so we'll see.