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

  • Hello,

    Sorry for closing the ticket I clicked on the wrong button...

    For the 13dBm I put CONFIG_NET_CONFIG_IEEE802154_RADIO_TX_POWER at 13, and left all the other configs on default values. With this, the nRF21540 was configured at 10dBm and the nRF52840 at 3dBm, but at 13dBm the product can't pass the certification so I left my maximum at 10dBm.

    How do you set the desired dBm in these two tests? By setting MPSL_FEM_NRF21540_TX_GAIN_DB?

    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.

    What result would you get if using the following setting?

    Same results at -23dBm for both projects...

    I don't know if it change something but I use a custom board with the nRF52840 and nRF21540.

    Kind regards,

    Andrew

  • Hi,

    AndrewSafehear said:
    I don't know if it change something but I use a custom board with the nRF52840 and nRF21540.

    Is it possible to reproduce on nRF2140DK? If not, please create a new support case with "nRF21540 and nRF52840 custom board" as the title. 

    -Amanda H.

  • 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

Reply Children
  • 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

  • Hi, 

    The nRF52840 Product Specification states for TXPOWER register of RADIO peripheral: https://infocenter.nordicsemi.com/topic/ps_nrf52840/radio.html?cp=5_0_0_5_19_13_46#register.TXPOWER
    that there is no -2dBm power so the splitter uses achievable power setting.

    For nRF52840 there is no need to use FEM, nRF52840 can achieve +8dBm.

    If nRF52840 is used with nRF21540 to achieve +8dBm, you can try flashing the value of the internal register which corresponds to the 10 dB setting to be lower that the pre-programmed one, and achieve the lower amplification this way. The lab would be needed to actually measure the real output value of power with the adjusted internal setting, and most probably, would be needed to be performed on a per-sample basis.

    -Amanda H.

  • Hi,

    I know that the nRF52840 can go to +8dBm but my product need to have a power configurable between 0 and 10dBm, that's why I use a nRF21540.

    I don't understand what you mean here.

    you can try flashing the value of the internal register

    You mean the CONFREG0 TX_Gain value or the UICR register ?

    Regards,

    Andrew

  • Hi, 

    The CONFREG0 TX_Gain value is the value I meant, however, the nature of where the devices fetches the value is configurable, and you should select the source of this register according to your needs and possibilities. The most common way is to write the UICR register accordingly, and the device fetches the UICR register at boot time and populates the TX_Gain value with it. You can read more in chapters 5.4-5.5 of the product specification of nRF21540

    Regards,
    Amanda H.
Related