Desired TX power is not consistent with exact TXP when using nRF21540

Hi

I am using HCI Power Control sample to dynamically control TX power. I found that the TX side's connection RSSI and RX side's are diferent, at some point it even has 20 db difference!  Which one is the correct one?

My TX code:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* main.c - Application main entry point */
/*
* Copyright (c) 2019 Andrei Stoica
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/types.h>
#include <stddef.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_vs.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/uuid.h>
#include <zephyr/bluetooth/gatt.h>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

My RX code:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
* Copyright (c) 2018 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/
/** @file
* @brief Nordic UART Service Client sample
*/
#include <errno.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/printk.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/uuid.h>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Thank you so much for your time!

Parents
  • Another problem is that the granularity of adjustment does not seem to be very high. I used my method to select a new TX power each time, but it could not be configured successfully. It seems that the system can only work at a few discrete values. (I am using nrf21540 EK and have add the related stuff)

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    00> Adaptive Tx power selected = -13
    00> Actual Tx Power: -20
    00> Adaptive Tx power selected = -14
    00> Actual Tx Power: -20
    00> Adaptive Tx power selected = 7
    00> Actual Tx Power: 4
    00> Adaptive Tx power selected = 3
    00> Actual Tx Power: 0
    00> Adaptive Tx power selected = 1
    00> Actual Tx Power: 0
    00> Adaptive Tx power selected = -5
    00> Actual Tx Power: -20
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Thank you so much

  • Hi,

    How are you building the project? If you are building for the nRF21540 FEM, the output power is configurable with high resolution. However, when building withotu the FEM, the output power is limited to the steps that are supported in HW (see TXPOWER in the product specification), and if you specify an unsupported value, the closest lower output power is used.

    Regarding the measured RSSI that depend on many factors, one is real factors and only give a ball park number. The RSSI measurment itself is specified to be +-1 2 dBm, but there are other factors such as antenna, sampling time, perhaps the devices are not transmitting with the same power, etc. 

  • Hi,

    From what I understand the get_tx_power() function may not represent the actuall configuation when using the nRF21540 FEM with dynamic power control. Have you measured the actual Tx power out of the FEM? There you should see values that are closer to what you configure.

  • Hi,

    I will test the Txpower when I get my power meter : ) will let you know in the future, Thank you so much

  • Hi

    My power meter is still on the way. However, I have done a test regarding the desired TXP and exact TXP getting from the software.

    I have already use your config, enabled the power model to have a precise gain control. Is this the expected result when using the nRF21540?

    By the way, I noticed that nRF54L15 is not compatible with nRF21540. Does that mean it is only compatible with the unlisted nRF2220 RF?

  • Hi,

    Yes, in the lower end this is expected, as there are few Tx power steps from the nRF52833 in that range. See TXPOWER.

  • Hi, I have got the RF amplifier and this is the result.Blue one is the set_tx_power input and orange one is the output by get_tx_power. The gray one is the one I use RF power meter to measure. Do you think this make sense?

Reply
  • Hi, I have got the RF amplifier and this is the result.Blue one is the set_tx_power input and orange one is the output by get_tx_power. The gray one is the one I use RF power meter to measure. Do you think this make sense?

Children
  • Hi,

    I would expect some losses, but that you measure significantly highe rpower than what is configured is not expected. Could there be an issue with you rmeasurement setup?

    Other than that, the steps are as expected with GPIO control of the FEM.

  • Thank you for your information. I guess my RF meter range is only to 5dbm. So when I measure signal higher than 0dbm, I use a 20db antenuater.

    However, I notice there is a fluctuation at around 10 dbm. And also if I set to be 0, the ble stack will return -2dbm, that means I cannot get 0dbm if I use FEM?

    I have already use the power model

  • Hi,

    I see. You should be able to get 0 dBm as well, but that requiers SPI control of the FEM (not just GPIO control)

  • I think I have use SPI, as I am using power model

  • Hi,

    I am sorry for the late update. I have been testing this on my end and lookin into this internally, and I was initially mistaken. It turns out that even with SPI control, the grantularity is dictated by the SoC. The 
    SPI interface is used to calibrate the 10 dB and 20 dB gains of the PA, but cannot be used to select other gains than that. So the resulting gain is a combination of the SoC gains and added either 10 or 20 dB.