nRF21540 custom gain with MPSL

Hello,

To follow the talk we add on this ticket.

 How can I configure a custom TX gain with the MPSL library ?

I want to have an output power of 8 dBm on the nRF21540.

I tried to change the MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA and set CONFIG_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL configs but the signal on a analyzer was -23dBm and not near 8 dBm as I wanted.

When I just use the default value of 10 dBm, the analyzer get a power near 10 dBm as wanted.

Regards,

Andrew

Parents
  • Hi, 

    Please kindly share the whole content of the conf file. Thanks. 

    Regards,
    Amanda H. 

  • Here is the conf file used with the radio_test project for the nrf21540dk_nrf52840 board:

    #
    # Copyright (c) 2020 Nordic Semiconductor
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    CONFIG_CONSOLE=y
    CONFIG_CONSOLE_HANDLER=y
    CONFIG_SHELL=y
    
    CONFIG_DYNAMIC_INTERRUPTS=y
    
    CONFIG_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL=y
    CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y
    CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA=8
    
    CONFIG_NRFX_TIMER0=y
    
    CONFIG_ENTROPY_GENERATOR=y
    
    CONFIG_SHELL_BACKEND_RTT=y
    CONFIG_SENSOR=y

    WIth this one, when I use the command "total_output_power 8" and then "start_tx_modulated_carrier" I have -23dBm on the analyzer.

    Regards,

    Andrew

  • Hi,

    Yes the problem is on both cards...

    Regards,

    Andrew

  • Hi,

    AndrewSafehear said:

    Here is the configs for those tests with both projects:

    - MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA = 20
    - MPSL_FEM_NRF21540_TX_GAIN_DB_POUTB = 10
    - MPSL_FEM_NRF21540_TX_GAIN_DB = 10

    With my project I also set CONFIG_NET_CONFIG_IEEE802154_RADIO_TX_POWER to 10 or 8 and with the radio_test project I set total_output_power to 10 or 8. Also for the radio_test project, I set data_rate to 
    ieee802154_250Kbit.

    Is it possible for you to test this part with NCS v2.3.0 which got released yesterday? Thanks. 

    -Amanda H. 

  • Hi,

    I tested it with NCS v2.3.0 and a sniffer.

    - MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL=y
    - MPSL_FEM_NRF21540_GPIO_SPI=y
    - MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA=20
    - MPSL_FEM_NRF21540_TX_GAIN_DB_POUTB = 10

    With all default values I got RSSI values near -19dBm for an output power set at 10dBm.

    - MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL=y
    - MPSL_FEM_NRF21540_GPIO_SPI=y
    - MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA=8
    - MPSL_FEM_NRF21540_TX_GAIN_DB_POUTB = 10

    With custom values, I got RSSI near -37dBm for an output power set at 10dBm.

    Regards,

    Andrew

  • Hi, 

    AndrewSafehear said:
    When I use default values, change MPSL_FEM_NRF21540_TX_GAIN_DB to 10dBm and I want 10 dBm, I get it on both project.

    Seems v2.2.0 can work as expected while setting to gain 10dBm. 

    AndrewSafehear said:
    With all default values I got RSSI values near -19dBm for an output power set at 10dBm.

    Does that mean it doesn't work as expected in v2.3.0 while setting to gain 10dBm? Are you running with radio_test? 

    -Amanda H.

  • Hi,

    With both version of the SDK and default values, it work. I was just using a sniffer and not a spectrum analyzer that's why thoses values where differents.

    During my analysis, I found that the 802.15.4 drivers of nrfxlib are splitting the power between the nRF52840 and nRF21540 with a formula inside MPSL.

    Here are my findings when I checked the values sent by SPI with the built in power model (temperature got by the nrf temp sensor).

    • inputs values for the power model: 3V, 24°C, 2405MHz, 10dBm
      • nRF52840: 0dBm
      • nRF21540: gain_db=10 / private=8
      • SPI CONFREG0: 0x3F
    • inputs values for the power model: 3V, 24°C, 2480MHz, 10dBm
      • nRF52840: 0dBm
      • nRF21540: gain_db=10 / private=6
      • SPI CONFREG0: 0x1F

    Even when I activate CONFIG_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL, the nRF21540 keep default values.

    For example, if I want 8dBm of transmit power, the function nrf_802154_fal_tx_power_split() will split the power with RADIO_TXPOWER_TXPOWER_Neg4dBm and 10dBm for the nRF21540. So at the end I will get 6dBm and not 8dBm as wanted...

    Is there a way to make the splitting function output 8dBm for the nRF21540 ?

    Kind regards,

    Andrew

Reply
  • Hi,

    With both version of the SDK and default values, it work. I was just using a sniffer and not a spectrum analyzer that's why thoses values where differents.

    During my analysis, I found that the 802.15.4 drivers of nrfxlib are splitting the power between the nRF52840 and nRF21540 with a formula inside MPSL.

    Here are my findings when I checked the values sent by SPI with the built in power model (temperature got by the nrf temp sensor).

    • inputs values for the power model: 3V, 24°C, 2405MHz, 10dBm
      • nRF52840: 0dBm
      • nRF21540: gain_db=10 / private=8
      • SPI CONFREG0: 0x3F
    • inputs values for the power model: 3V, 24°C, 2480MHz, 10dBm
      • nRF52840: 0dBm
      • nRF21540: gain_db=10 / private=6
      • SPI CONFREG0: 0x1F

    Even when I activate CONFIG_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL, the nRF21540 keep default values.

    For example, if I want 8dBm of transmit power, the function nrf_802154_fal_tx_power_split() will split the power with RADIO_TXPOWER_TXPOWER_Neg4dBm and 10dBm for the nRF21540. So at the end I will get 6dBm and not 8dBm as wanted...

    Is there a way to make the splitting function output 8dBm for the nRF21540 ?

    Kind regards,

    Andrew

Children
Related