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.

CC2340R5: [CC2340]about HCI_EXT_SetTxPowerDbmCmd function.

Part Number: CC2340R5

Dear TI experts.

according to the previous discussion:CC2340R5: how to modify the tx power at CC2340 run time. - Bluetooth forum - Bluetooth®︎ - TI E2E support forums

now, I am using the simplelink_lowpower_f3_sdk_7_20_00_29 to verify the change of tx power at run time.

Chip is Rev.B.

IDE:CCS 12.3

In the same module, I used smart rf studio to generate CW with a specific TX Power and used hard code to set the TX power through HCI and generate CW waves.

I compared the smart rf studio and hard code methods.

Currently, I have 2 questions.
1. Use the hard code to call HCI_EXT_SetTxPowerDbmCmd(8,1) and then HCI_EXT_ModemTestTxCmd(1,19); the power will be very low, but if you choose HCI_EXT_SetTxPowerDbmCmd(7,1) it will be close to the 7dbm-0.3~0.4dbm of smart rf studio.

2. In addition to the 8dbm problem, I compared the setting power of smart rf studio with the hard code method. The CW power generated by using hard code will be lower than smart rf studio by about 0.3~0.4dBm.

The picture below uses smart rf studio to set 8dBm and the actual spectrum signal.

The picture below uses hard code to set 8dBm and the actual spectrum signal.

    /**************add by weli for CW test begin****************/
    GAP_TerminateLinkReq(Connection_getConnhandle(0), HCI_DISCONNECT_REMOTE_USER_TERM);
    GapAdv_disable(peripheralAdvHandle_1);
    HCI_EXT_SetTxPowerDbmCmd(8,1);
    HCI_EXT_ModemTestTxCmd(1,19);
    while(1)
    /***************add by weli for CW test end*****************/

We can see that when using HCI_EXT_SetTxPowerDbmCmd(8,0), the power will be very low.

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

The picture below uses smart rf studio to set 7dBm and the actual spectrum signal.

The picture below uses hard code to set 7dBm and the actual spectrum signal.

/**************add by weli for CW test begin****************/
    GAP_TerminateLinkReq(Connection_getConnhandle(0), HCI_DISCONNECT_REMOTE_USER_TERM);
    GapAdv_disable(peripheralAdvHandle_1);
    HCI_EXT_SetTxPowerDbmCmd(7,1);
    HCI_EXT_ModemTestTxCmd(1,19);
    while(1)
    /***************add by weli for CW test end*****************/

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

The picture below uses smart rf studio to set 6dBm and the actual spectrum signal.

The picture below uses hard code to set 6dBm and the actual spectrum signal.

/**************add by weli for CW test begin****************/
    GAP_TerminateLinkReq(Connection_getConnhandle(0), HCI_DISCONNECT_REMOTE_USER_TERM);
    GapAdv_disable(peripheralAdvHandle_1);
    HCI_EXT_SetTxPowerDbmCmd(6,1);
    HCI_EXT_ModemTestTxCmd(1,19);
    while(1)
    /***************add by weli for CW test end*****************/

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

The picture below uses smart rf studio to set 0dBm and the actual spectrum signal.

The picture below uses hard code to set 0dBm and the actual spectrum signal.

/**************add by weli for CW test begin****************/
    GAP_TerminateLinkReq(Connection_getConnhandle(0), HCI_DISCONNECT_REMOTE_USER_TERM);
    GapAdv_disable(peripheralAdvHandle_1);
    HCI_EXT_SetTxPowerDbmCmd(0,1);
    HCI_EXT_ModemTestTxCmd(1,19);
    while(1)
    /***************add by weli for CW test end*****************/

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

I summarized the results of using smart rf and code as shown in the table below.

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

Regarding the above issues, can Ti experts provide some advice?

Thanks.

  • Hello Weli,


    Thanks for reaching out.


    I have been able to reproduce a similar behaviour, and it appears that the fraction parameters may be causing the issue. We are looking further into this with the team.


    On the meantime, could you please try with fraction = 0?

    GAP_TerminateLinkReq(Connection_getConnhandle(0), HCI_DISCONNECT_REMOTE_USER_TERM);
    GapAdv_disable(peripheralAdvHandle_1);
    const int8_t txPower = 8;
    const uint8_t fraction = 0;
    HCI_EXT_SetTxPowerDbmCmd(txPower, fraction);

    Also, where are you calling this section of the code? Are you using an example project as base (like basic_ble from the SDK examples)?

    Best regards,


    David.

  • Hi David.

    I used the data_stream sample code,
    Then because our chip is 4X4, we only changed syscfg to CC2340R5RGE, and then we added functions to change TX power and CW tone in bStatus_t Peripheral_start() in app_peripheral.c.

    bStatus_t Peripheral_start()
    {
        bStatus_t status = SUCCESS;
    
        status = BLEAppUtil_registerEventHandler(&peripheralConnHandler);
        if(status != SUCCESS)
        {
            // Return status value
            return(status);
        }
    
        status = BLEAppUtil_registerEventHandler(&peripheralAdvHandler);
        if(status != SUCCESS)
        {
            return(status);
        }
    
        status = BLEAppUtil_initAdvSet(&peripheralAdvHandle_1, &advSetInitParamsSet_1);
        if(status != SUCCESS)
        {
            // Return status value
            return(status);
        }
    
        status = BLEAppUtil_advStart(peripheralAdvHandle_1, &advSetStartParamsSet_1);
        if(status != SUCCESS)
        {
            // Return status value
            return(status);
        }
        /**************add by weli for CW test begin****************/
        GAP_TerminateLinkReq(Connection_getConnhandle(0), HCI_DISCONNECT_REMOTE_USER_TERM);
        GapAdv_disable(peripheralAdvHandle_1);
        HCI_EXT_SetTxPowerDbmCmd(0,1);
        HCI_EXT_ModemTestTxCmd(1,19);
        while(1)
        /***************add by weli for CW test end*****************/
    
        // Return status value
        return(status);
    }

  • Hi David,

    Thank you for your help. This fraction needs to be set to 1. Although the comment states that this is not used, added for future support, anyway, you solved my question.
    thanks.