Distance measurement library questions (Part 2)

1.The code in dm.c  calls a function nrf_config_get()  which returns a default configuration defined as NRF_DM_DEFAULT_CONFIG in nrf_dm.h

That configuration has the TX power set to  NRF_DM_DEFAULT_TX_POWER ( 8 dBM )

Does this mean that during the distance measurement procedure the radio TX power is always at  8 dBM ?

2. There is a function nrf_dm_configure() in nrf_dm.h but I could not find the function definition anywhere. Where and how is it used? It seems that the TX power is always 8 dBM because that's what nrf_config_get returns and it is called from various places in dm.c Can you confirm that?

3 Can you confirm that  TX power is reset to whatever it was set before when the  ranging procedure completes?

Thanks
Andy
Parents
  • Hi, 

    If the application is using the default config NRF_DM_DEFAULT_CONFIG when calling nrf_dm_configure it would get NRF_DM_DEFAULT_TX_POWER. The value of NRF_DM_DEFAULT_TX_POWER in turn depends on what NCS\modules\hal\nordic\nrfx\mdk is being used by the application. The RADIO_TXPOWER_TXPOWER_Pos8dBm is defined in the nrfxxxx_bitfields.h  file. 

    nrf_dm_configure() is defined in NCS\nrfxlib\nrf_dm\include\nrf_dm.h L.288. See nrf_dm_configure() documentation. 

    Regards,
    Amanda H

  • mdk is a directory with lots  files. How do I tell which one is used by my application? When I load my app in VSCode, in the nrf_dm.h file only RADIO_TXPOWER_TXPOWER_Pos8dBm is enabled , all others are grayed out, so I assume my application uses that value. Please confirm that.

    Assuming NRF_DM_DEFAULT_TX_POWER  is RADIO_TXPOWER_TXPOWER_Pos8dBm and the radio TX power is set to 8 dBM for the distance measurement, what happens when the measurement is complete?  Is the power reset back to what it was set to before? ( 0 in my case )

    Thanks

  • About the TX power definition.

    In my case it is defined in modules\hal\nordic\nrfx\mdk\nrf52840_bitfields.h file

    However RADIO_TXPOWER_TXPOWER_Pos4dBm and others are also defined in the same file but VSCode grays out everything except  RADIO_TXPOWER_TXPOWER_Pos8dBm in nrf_dm.h

    Why?

    On TX power

    Please clarify what you mean by "it depends on your application to configure the TX power.." The implication is that  after the measurement the TX power remains at 8 dBM  and it's my application responsibility to set it back to 0. Can you confirm that ?

    Generally, how does the TX power affect the measurement? Is there a correlation between the accuracy of the measurement and TX power? 

    Thanks

  • Hi, 

    Because the RADIO_TXPOWER_TXPOWER_Pos8dBm meets the first if condition. 

    The TX power is only valid when the distance measurement is running. Once we power-cycle the radio, the configuration is reset. We turn the radio off after the measurement. The BT (or any other stack) needs to set the TX power again, otherwise, it will use the radio's default value.

    Generally, the measurements will be better with higher TX power, this will decrease the interference / noise during the measurements. However, it is possible to use too high TX power, which can lead to saturation in the receiving side, which will worsen the quality of the measurements.

    Our distance measurement library will detect saturation and report that the measurement has poor quality.

    Regards,
    Amanda H.

  • The BT (or any other stack) needs to set the TX power again, otherwise, it will use the radio's default value.

    Let me rephrase my question

    My application uses 

    bt_hci_cmd_send_sync(BT_HCI_OP_VS_WRITE_TX_POWER_LEVEL,,,,,...) API to set the tx power on boot. Let's say it is set  to 2 dBM
    Then it calls the DM library to measure with another node 
    What will the TX power be after DM result callback fires ?

    Thanks
    Andy
  • Hi, 

    The settings of BT and the nrf_dm_config_t should generally not affect each other. If the BT subsys is active, it should set the TX power level to the configured value (in this case, this would be the one that was set at boot). If DM is active, it should use the value configured in nrf_dm_config_t. So when DM is not using the radio, it should be set to the value defined at boot.

    Regards,
    Amanda H.

Reply Children
Related