This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TI 15.4 Stack: How to set the transmit power dynamically?

Other Parts Discussed in Thread: CC1310

hi all,


we need a function which to set phyTransmitPower dynamic.

Have any one give me a Suggest about this issue.

1. i find it at , and that is work.

@sensor.c Sensor_init()

    /* Set the transmit power */
    ApiMac_mlmeSetReqUint8(ApiMac_attribute_phyTransmitPowerSigned,
                           (uint8_t)14);//can be change

2. at the sensor @ Jdllc_states_joining state

    i also change the phyTransmitPower  dynamic.

3.then @ link with coprocessor.

   it will auto change the phyTransmitPower and i can't set again it.

sdK:

CC13x0 SDK 1.00.00.13

hw:

cc1310 5x5 Rev A.

  • Hi,

    are you using the GEN-FSK PHY in proprietary mode and do you want to update the PA output power dynamically in your application?

    The TX power can be updated using CMD_SET_TX_POWER. This is an immediate command. The TX power values are not generic and not always linear. We deduce them during PHY characterization and put the result into SmartRF Studio. I would suggest to use SmartRF Studio to get the values and put them into a look-up table, then use CMD_SET_TX_POWER to update the power.

  • hi richard,

    we use the ti 802.15.4 stack .

    How to set it when i need change at run time ?

    i found the value about phyTransmitPower when connect state,

    it reference macPibDefaults ,

    static CODE const macPib_t macPibDefaults ={

    ...

      /* Proprietary */
      14,                                         /* phyTransmitPower */


    }



    Thank you for considering my request.

  • Hello Steven, 

    You can use the below API to change the transmit power dynamically. This is described here www.ti.com/.../swru489a.pdf

        /* Set the transmit power */

        ApiMac_mlmeSetReqUint8(ApiMac_attribute_phyTransmitPowerSigned,

                               (uint8_t)txPwr);

    txPwr is in dBm and can take a value ranging from 0 to 14dBm in steps of 1 dBm and -10dBm 

    Regards,

    Prashanth

  • hi prashanth,
    thank you for your reply.
    i have been do this function,but it work before Association only.


    In my test(see peak power consumption and Coprocessor web Application ,rssi ),

    After Association state, it reference the macPibDefaults setting to setting it and
    it can't use ApiMac_mlmeSetReqUint8(ApiMac_attribute_phyTransmitPowerSigned,txPwr)
    to change.

  • hi all and prashanth:

    update my test report.

    HW.CC1310 launchpad x2

    sdk:TI 15.4 Stack simplelink_cc13x0_sdk_1_00_00_13

    before Association(A, 14dbm ; B 0dbm)

    1.use key to change

            if(keys & KEY_RIGHT)
            {
               ApiMac_mlmeSetReqUint8(ApiMac_attribute_phyTransmitPowerSigned,
                                       (uint8_t)0);

            }

    After Association(C and D)

    2.by A,B case(use key to change TransmitPower,14 and 0 dbm)

       see image C.D

    As 1 and 2, the result is same. so,it seem that not valid.

    ------------------------------

    3. E

    change preprocessor define macPibDefaults ,the phyTransmitPower = 0(14)

    at the same test case,the web application show the rssi value lower than other.

    so ,it is preprocessor define ,i can't change at run time redefine .

    I hope you will be able to provide the information.

    A.before Association( 14dbm)


    B. before Association(0dbm)


     

    C.after Association(14dbm)



    D.after Association(0dbm)



    E. macPibDefaults =phyTransmitPower

  • Hello Steven, 

    Thanks for pointing this out. We are currently looking into this issue and we will respond soon. 

    Regards,

    Prashanth

  • hi ,

    Thank you for considering my request.

    add my config.h and feature.h files.

    features.h

    3666.config.h

  • hi all and PrashanthS ,
    excuse me,

    have any information update?

    i try to redefine the macPibDefaults as global variable ,and every boot time to write from a special NV item
    which to set phyTransmitPower .

    but ,it also can't set again.

    Thank you for considering my request.
  • Hello Steven, 

    I have contacted the team working on this and waiting for a response. I will let you know once I get further information. 

    Regards,

    Prashanth

  • Hello Steven,
    Can you check the value of usePowerAndChannel under ApiMac_txOptions_t Data request transmit options. If this is set then the power and channel values in macDataReq_t are used instead of the PIB values as described on page137 of the developer's guide www.ti.com/.../swru489a.pdf
    Regards,
    Prashanth
  • Hello Steven, 

    Below is the response that I got from the team responsible for the TI 15.4g stack.

    Here is the result of my investigation on this issue.

    In conclusion, I didn’t see any problem on this ticket.

     

    1. If he wants to change Tx power dynamically, please do like below

    Both Collector and sensor side : change the function static void sendMsg(Smsgs_cmdIds_t type, uint16_t dstShortAddr, bool rxOnIdle, uint16_t len, uint8_t *pData)

    Before calling ApiMac_mcpsDataReq(&dataReq) add the following lines

            dataReq.txOptions.usePowerAndChannel = true;

        dataReq.power = any power value you want to set. Please see CONFIG_TRANSMIT_POWER in config.h for what values are allowed.

     

    1. About his test. I am not sure if my understanding is correct or not. If the problem is that even though he set transmit power by calling ApiMac_mlmeSetReqUint8(ApiMac_attribute_phyTransmitPowerSigned,(uint8_t)0), the power automatically returns to 14 after association, I guess this is why.

    In both collector.c and sensor.c, you can see the following code in xxx_init() function.

        ApiMac_mlmeSetReqUint8(ApiMac_attribute_phyTransmitPowerSigned,

                               (uint8_t)CONFIG_TRANSMIT_POWER);

                   If he called ApiMac_mlmeSetReqUint8(ApiMac_attribute_phyTransmitPowerSigned,(uint8_t)0) before this code, he can see this kind of behavior because this code will return the default power value to 14. So if this is the case, he should change  CONFIG_TRANSMIT_POWER  from config.h to keep the value or change after the code above.

    Regards,

    Prashanth

  • hi,

    i have been try them ,but no effect about it.

    1.dataReq.txOptions.usePowerAndChannel = true

    it only send one packet ,then which will lost link.

    http://i.imgur.com/ED2QBXg.png

    static bool sendMsg(Smsgs_cmdIds_t type, ApiMac_sAddr_t *pDstAddr,
                        bool rxOnIdle, uint16_t len, uint8_t *pData)
    {
        bool ret = false;
        ApiMac_mcpsDataReq_t dataReq;
        Board_Led_toggle(board_led_type_LED1);

        /* Fill the data request field */
        memset(&dataReq, 0, sizeof(ApiMac_mcpsDataReq_t));

        memcpy(&dataReq.dstAddr, pDstAddr, sizeof(ApiMac_sAddr_t));

        if(pDstAddr->addrMode == ApiMac_addrType_extended)
        {
            dataReq.srcAddrMode = ApiMac_addrType_extended;
        }
        else
        {
            dataReq.srcAddrMode = ApiMac_addrType_short;
        }

        if(rejoining == true)
        {
            ApiMac_mlmeGetReqUint16(ApiMac_attribute_panId,
                                    &(parentInfo.devInfo.panID));
        }

        dataReq.txOptions.usePowerAndChannel =true;
        dataReq.power = 0;

        dataReq.dstPanId = parentInfo.devInfo.panID;

        dataReq.msduHandle = getMsduHandle(type);

        dataReq.txOptions.ack = true;

        if(CERTIFICATION_TEST_MODE)
        {
            dataReq.txOptions.ack = false;
        }
    ...........

    }

    2. ApiMac_mlmeSetReqUint8(ApiMac_attribute_phyTransmitPowerSigned,(uint8_t)0)

    i add this at the key event ,follow code

            if(keys & KEY_RIGHT)
            {
                ApiMac_mlmeSetReqUint8(_attribute_phyTransmitPowerSigned,

                                           (uint8_t)0);
            }

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/156/sensor_5F00_cc1310lp.7z

    HW:

    cc1310 launchpad Rev:1.3 x2

    SW:

    simplelink_cc13x0_sdk_1_00_00_13

    ***

    FEATURE_NON_BEACON_MODE and Channel 0

    4578.config.h4578.features.h

  • Hello Steven, 

    We will double check on our side. Meanwhile can you please disable the key event and always set power to 0 and check what happens? (Essentially comment out the line  if(keys & KEY_RIGHT) )

    Regards,

    Prashanth

  • hi ,
    excuse me ,i so late to reply.

    1.
    about "ApiMac_mlmeSetReqUint8(ApiMac_attribute_phyTransmitPowerSigned,x"
    i called it only at Sensor_init() function,but it will be reset to 14dbm when association.

    Can you give me your configure and setting files(config.h ,feature.h and Pre-define macro )
    and  your test step about this ? *1

    *1


    void Sensor_init(void)
    {
    uint32_t frameCounter = 0;

    /* Initialize the sensor's structures */
    memset(&configSettings, 0, sizeof(Smsgs_configReqMsg_t));
    #if defined(TEMP_SENSOR)
    configSettings.frameControl |= Smsgs_dataFields_tempSensor;
    #endif
    #if defined(LIGHT_SENSOR)
    configSettings.frameControl |= Smsgs_dataFields_lightSensor;
    #endif
    #if defined(HUMIDITY_SENSOR)
    configSettings.frameControl |= Smsgs_dataFields_humiditySensor;
    #endif
    configSettings.frameControl |= Smsgs_dataFields_msgStats;
    configSettings.frameControl |= Smsgs_dataFields_configSettings;
    .......................

    /* Set the transmit power */
    /*ApiMac_mlmeSetReqUint8(ApiMac_attribute_phyTransmitPowerSigned,
    (uint8_t)CONFIG_TRANSMIT_POWER);*/
    ApiMac_mlmeSetReqUint8(ApiMac_attribute_phyTransmitPowerSigned,
    (uint8_t)0);

    /* Initialize the app clocks */
    initializeClocks();

    if(CONFIG_AUTO_START)
    {
    /* Start the device */
    Util_setEvent(&Sensor_events, SENSOR_START_EVT);
    }
    }

  • hi ,
    now,

    i try to redefine macPib_t macPibDefaults as global ,and reassign "phyTransmitPower" every boot.
    ,it seem work.

    but i need to run time dynamically .


    see follow ,

    @mac_pib.c

    MAC_INTERNAL_API void macPibReset(void)
    {
    //reassign from NV
    macPibDefaults.phyTransmitPower = u8TxPower;
    /* copy PIB defaults */
    #if defined( FEATURE_MAC_PIB_PTR )
    *pMacPib = macPibDefaults;
    #else
    macPib = macPibDefaults;
    #endif /* FEATURE_MAC_PIB_PTR */

    /* initialize random sequence numbers */
    pMacPib->dsn = macRadioRandomByte();
    pMacPib->bsn = macRadioRandomByte();
    }


    @main.c

    pTxNV = &Main_user1Cfg.nvFps;

    if((pTxNV != NULL) && (pTxNV->readItem != NULL))
    {
    //read the txpower from nv
    (void)pTxNV->readItem(nvTxId, 0, 1, &u8TxPower);
    }

    @ssf.c

    //to write nv,tx power
    if(keys & KEY_RIGHT)
    {
    NVINTF_itemID_t id;
    uint8_t TxPwr;

    /* Setup NV ID */
    id.systemID = NVINTF_SYSID_APP;
    id.itemID = 0x0007;
    id.subID = 0;
    if(u8TxPower ==0)
    TxPwr =14;
    else
    TxPwr =0;
    pNV->writeItem(id, sizeof(uint8_t), &TxPwr);

    }
  • Steven,

    Thanks for the update. There may be an issue on our side. We are trying to narrow it down. I will update you once we find something. 

    Regards,

    Prashanth

  • Hello Steven,
    We have an updated library with the fix. I have sent you a friend request. I can email you the updated library.
    Regards,
    Prashanth
  • Dear Prashanth,

    Has the fix been implemented in the current version of the protocol stack? I still experience the same problem.

    Could you please share the updated library with me?

    Thank you,

    Best regards,

    Alessandro

  • hi alessandro,
    current version( 1.30.00 ) which don't fix this .
    you should contact local distributor.
  • Hello Alessandro,
    I can share the updated library with you. Please accept the friend request I sent out.
    Regards,
    Prashanth