This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to set TX power in zigbee mode

Hi,

I have serval questions about TX power settings.I wan to increase power to +8dBm,but the result is no effect.

Before reseting Tx power,call nrf_802154_tx_power_get(), results is 0 and my_tx_power_register is 0x00000000.

2 Reseting TX power to 8 by calling nrf_802154_tx_power_set(8), and call nrf_802154_tx_power_get(), the result is 8, but my_tx_power_register still is 0x00000000.

So, why my settings is not effect,but the nrf_802154_tx_power_get() returns is right?

This is my code for power settings.

int main(void)
{
    // Here has some other codes...
    
    /* Start Zigbee CLI subsystem. */
    zb_cli_start();
    /*************************** Set TX power level *********************************/
    NRF_LOG_INFO("Get TX Power Before Resetting:  %d", nrf_802154_tx_power_get());
    NRF_LOG_INFO("Register Valuse Before Resetting: 0x%08x", NRF_RADIO->TXPOWER);  // The actual value from the register
    nrf_802154_tx_power_set(TX_POWER_LEVEL);  // TX_POWER_LEVEL is 8.
    NRF_LOG_INFO("Get TX Power After Resetting:  %d", nrf_802154_tx_power_get());
    NRF_LOG_INFO("Register Valuse After Resetting: 0x%08x", NRF_RADIO->TXPOWER);
    /********************************************************************************/
    /* Start Zigbee stack. */
    while(1)
    {
        if (zb_cli_is_stack_started())
        {
#ifdef ZIGBEE_CLI_DEBUG
            if (!zb_cli_stack_is_suspended())
            {
                zboss_main_loop_iteration();
            }
#else
            zboss_main_loop_iteration();
#endif
        }
        UNUSED_RETURN_VALUE(NRF_LOG_PROCESS());
        UNUSED_RETURN_VALUE(zb_cli_process());
    }

I can't find out the reason for this error,may be coding,may be others.

e.g. before this Q&A submitted, I had consulted other Q&A, their case ids are 219287, 246336, 219287.

Looking forward to your reply

Thanks.

Parents
  • Hello,

     

    So, why my settings is not effect,but the nrf_802154_tx_power_get() returns is right?

     That depends on when you read out the radio's TX power register when you read it directly like this.

    I am quite sure that the radio TX power register is not updated before the zigbee library, zboss, intends to use the radio the next time. Try to print the radio TX power register either on a button press, or set up a timer to print it every second or something to see that the radio TX power register will update eventually.

    Best regards,

    Edvin

  • Hello,

    According to your advice, periodically logging the register value in main function by timer, when the zigbee useing radio, the register value changing from 0x00000000 to 0x00000008, it means ok,but I tried other cases, a new questions is:

    If I set -4 or others(just not 8) for TX power, when the zigbee starts, the register value keep in 0x00000008, whether in searching devices or in transmiting data, it's abnormal.

    Thanks.

Reply
  • Hello,

    According to your advice, periodically logging the register value in main function by timer, when the zigbee useing radio, the register value changing from 0x00000000 to 0x00000008, it means ok,but I tried other cases, a new questions is:

    If I set -4 or others(just not 8) for TX power, when the zigbee starts, the register value keep in 0x00000008, whether in searching devices or in transmiting data, it's abnormal.

    Thanks.

Children
Related