nrf21540 gain control

Hi All!

Hope you are doing well. I am using NCS 2.0.2 and VSCODE studio. Radio Test example using nrf52833+nrf21540(custom HW) . I want to ask a question how to control the gain of nrf21540 ? 

How to enable it in the radio test example and what will be the sequence of commands for that?

I am using a sequence of commands with only nrf52833DK to ensure FW is working. And output RSSI value is increasing.

output_power pos0dB  /3db /8db

 start_channel 20
 end_channel 60
 start_tx_carrier
 start_tx_sweep

Thanks & Regards,

Parents
  • Hi Muhammad,

    You can find the guide to use the FEM together with the Radio Test in the Radio Test documentation:
    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/nrf/samples/peripheral/radio_test/README.html

    Regards,

    Hieu

  • Hi Hieu

    thank you for the response! I read this. The issue I am facing is that how to add the MPSL library into the NCS vs code. studio.Because its required to set the gain of nrf21540. Can you please refer to some examples available for that?

    Thanks & Regards,

    Muhammad Usman

  • Hi Muhammad,

    If you just build the project and examine the Kconfig output, you will see that the MPSL library is already enabled.

    Update: The library is not included by default. See my next reply

    Without building, you can find how to include the MPSL library with one of these two approaches.

    The first one is you can see that the sample folder contains a Kconfig file. This adds Kconfig options unique to the sample that you can build with.

    In that Kconfig file, you can see that it also "includes" another Kconfig file with the rsource line, which include another one... Overall, the sample will add Kconfig defined in the following files:
    \<ncs_sdk_folder>\nrf\samples\bluetooth\direct_test_mode\src\fem\Kconfig
    \<ncs_sdk_folder>\nrf\samples\bluetooth\direct_test_mode\Kconfig
    \<ncs_sdk_folder>\nrf\samples\peripheral\radio_test\Kconfig

    Going over all the configuration, you can see that you it has the Kconfig CONFIG_FEM, which is on by default, and will include the MPSL in FEM only mode for you.

    Update: CONFIG_FEM is not enabled by default. See my next reply.


    The second approach is to follow the guide linked below and add enable the following Kconfig
    CONFIG_MPSL
    CONFIG_MPSL_FEM_ONLY
    Guide referred: Working with RF front-end modules — nRF Connect SDK 2.3.0 documentation (nordicsemi.com)

    But as we see from the first approach, those configurations are turned on by default due to the project's setup.

  • I just realized my already built project had options changed, and double checked with a fresh unmodified default build.
    There I see that CONFIG_FEM is not enabled by default. I am not sure why since it is supposed to default to n.

    CONFIG_FEM=y
    CONFIG_NRF21540_FEM=y

    The second option from my previous reply would successfully get the MPSL library into your Radio Test build. But the code relies on CONFIG_FEM to work correctly, so please use this option.

    Sorry for the inaccuracies in my previous reply.

Reply
  • I just realized my already built project had options changed, and double checked with a fresh unmodified default build.
    There I see that CONFIG_FEM is not enabled by default. I am not sure why since it is supposed to default to n.

    CONFIG_FEM=y
    CONFIG_NRF21540_FEM=y

    The second option from my previous reply would successfully get the MPSL library into your Radio Test build. But the code relies on CONFIG_FEM to work correctly, so please use this option.

    Sorry for the inaccuracies in my previous reply.

Children
Related