Tx Power on custom board

Good Day.

I use nRF52840 + nRF21540 on my custom board. The FEM is controlled by GPIO+SPI and by default the Tx gain is set to +10 dBm (if I understand correctly). Connection to the board is done with a smartphone, which is located one meter away from the board.

1. I would like to ask you if my board is displaying the correct output power and RSSI level readings?

Program code responsible for these parameters:

void rssi_thread(void)
{
	int8_t txp;
	int8_t txp_get = 0;
	int8_t rssi = 0xFF;
	
	while(1){

		if (!default_conn){
			k_msleep(1000);
		}
		else{
			get_tx_power(BT_HCI_VS_LL_HANDLE_TYPE_CONN, default_conn_handle, &txp);
			LOG_INF("TxP = %d\n", txp);

			get_tx_power(BT_HCI_VS_LL_HANDLE_TYPE_ADV, 0, &txp_get);
			LOG_INF("TxP_GET = %d\n", txp_get);

			read_conn_rssi(default_conn_handle, &rssi);
			LOG_INF("RSSI level = %d\n", rssi);
		}
	k_msleep(1000);
	}
}

When CONFIG_BT_CTLR_TX_PWR_ANTENNA=0 is set, I see the following readings -->

When CONFIG_BT_CTLR_TX_PWR_ANTENNA=4 is set, I see the following readings -->

When CONFIG_BT_CTLR_TX_PWR_ANTENNA=8 is set, I see the following readings -->

When CONFIG_BT_CTLR_TX_PWR_ANTENNA=-20 (I don't know if this value can be used) is set, I see the following readings -->

2. Why does setting the power to -20 improve the RSSI value?

3. The hci_pwr_ctrl example uses the txp and txp_get variables when displaying the Tx Power value. Is there a difference between them? 

4. This TxP value does not take into account the gain from the FEM? How do I then display the transmission power taking into account the FEM? 

I hope for your help with these questions.

Thank you! 

Parents Reply
  • Hi,

    Apologies for the delay.

    1. The RSSI you are printing is the RSSI measured at the device so it is the power of the received signal not the transmitted signal.
    You will need to measure the RSSI at the other end of the connection. Since the receiving end is a phone you can use the nRF Connect application for measuring the received RSSI.

    2. The RSSI can be influenced by external noise on the receving frequency, so other devices close by can influence it. Do you repeatedly see the same RSSI, or does it fluctuate?

    3. txp is the requested TX power while txp_get is the actual TX power used. These can differ if the TX power requested isn't possible by the HW, for example if you request a TX power of 11dBm, while using the nRF21540 in fixed 10dB gain mode. The closes possible TX power in this situation is 10dBm, since the radio can't transmit at 1dBm.
    The actual TX power used will not exceed the requested power, so the closest combination of SoC TX power and FEM gain will be used.

    4. txp should take into account the FEM gain. As a sanity check you can read out the radio txpower register to see what the output power of the SoC is set to, aka the TX power without the FEM gain.

     

    Best regards,

    Bendik

Children
Related