Lora-net/lr1110_modem_driver

Output power config values

rhssk opened this issue · 1 comments

rhssk commented

Hello,

v3.0.0 introduced a new command for setting output power configuration:

/*!
* @brief This command sets 6 blocks (at most 6 dedicated power levels) of Tx output power configurations: expected
* power, configured power, PA, Tx parameters and PA ramp time. For the Tx power levels not defined in the 6 levels with
* this command, the modem always selects automatically the appropriate PA and Tx parameters configurations.
*
* @param [in] context Chip implementation context
* @param [in] output_power_config Tx output power configuration block list, \see
* lr1110_modem_output_power_config_list_t
*
* @returns Operation status
*/
lr1110_modem_response_code_t lr1110_modem_set_output_power_config(
const void* context, const lr1110_modem_output_power_config_list_t output_power_config );

These are the default values of all 6 blocks after start-up:

expected_power: 128
configured_power: 128
pa_sel: 8
pa_supply: 0x00
pa_duty_cycle: 0x08
pa_hp_sel: 0x00
pa_ramp_time: 0x80

They don't match up with the description of lr1110_modem_output_power_config_t:

/*!
* @brief Output Power Config structure
*
* @ref pa_duty_cycle controls the duty cycle of Power Amplifier according to:
* \f$ dutycycle = 0.2 + 0.04 \times pa_duty_cycle \f$
* It can be used to adapt the TX multi-band operation using a single-matching network.
*
* The allowed duty cycle values for LPA are from 0.2 to 0.48 (by step of 0.04). Therefore possible values for
* pa_duty_cycle go from 0 to 7.
*
* The allowed duty cycle values for HPA go from 0.2 to 0.36 (by step of 0.04). Therefore in this case, the possible
* values for pa_duty_cycle go from 0 to 4.
*
* @ref pa_hp_sel controls the number of slices for HPA according to: \f$ \#slices = pa_hp_sel + 1 \f$
*/
typedef struct
{
uint8_t expected_power; //!< Expected power in dBm
uint8_t configured_power; //!< Configured power in dBm
uint8_t pa_sel; //!< Power Amplifier selection
lr1110_modem_pa_reg_supply_t pa_supply; //!< Power Amplifier regulator supply source
uint8_t pa_duty_cycle; //!< Power Amplifier duty cycle (Default 0x04)
uint8_t pa_hp_sel; //!< Number of slices for HPA (Default 0x07)
lr1110_modem_ramp_time_t pa_ramp_time; //!< Power amplifier ramp time
} lr1110_modem_output_power_config_t;

  • expected_power and configured_power have unrealistic values (also, shouldn't they be int8_t instead of uint8_t?).
  • pa_duty cycle is supposed to only range from 0 to 7 (LPA) or from 0 to 4 (HPA).
  • pa_hp_sel should have a default of 0x07.
  • pa_ramp_time doesn't match any value in lr1110_modem_ramp_time_t.
  • isn't pa_sel supposed to have a value from from lr1110_modem_radio_pa_selection_t?

Also, it's not clear how the modem chooses which of the 6 blocks from lr1110_modem_output_power_config_list_t to use. Are the blocks somehow matched with the configured Tx power offset value (lr1110_modem_set_tx_power_offset ) via the expected_power or configured_power members?

Firmware info for reference:

type: modem
bootloader: hw: 0x22 type: 0xdf fw: 0x6500
functionality: Wi-Fi/GPS/BeiDou
firmware: 1.1.7
LoRaWAN: 1.0.3
driver: 3.0.1

Thank you for your inquiry.

Customers are encouraged to submit technical questions via our dedicated support portal at https://semtech.force.com/ldp/ldp_support.

We invite all users to visit the LoRa Developer Portal Forum at https://forum.lora-developers.semtech.com and to join the thriving LoRa development community!