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.

CC2652P: Rf switch configuration for rx tx

Part Number: CC2652P
Other Parts Discussed in Thread: SYSCONFIG, CC1352P

I am using a switch with single pin control (BGS12WN6) for 5 dBm and 20 dBm on a custom board. I also implemented rfDriverCallbackAntennaSwitching() by referring to this.  I've successfully tested the switch with smartRF studio. In my case, I want Rx using a 5dBm path whereas Tx with 20dBm. How to implement this in code?

  • Hi Amit,

    In looking at the CC2652P datasheet, you will find that the RX path always occurs through the RF_P/RF_N pins.  TX_20DBM_P/TX_20DBM_N is solely for TX.  Thus after implementing rfDriverCallbackAntennaSwitching to change your operating PHY to the 20 dBm output, the RF TI driver will handle changing the radio paths between RX and TX.  Thus if you've successfully tested the design with Smart RF Studio then I do not foresee any issues with applying this to your application code after altering the RF pin configurations, which would occur primarily through the RF Design and RF sections of SysConfig.  You will want to review the Running the SDK on Custom Hardware section of the BLE5-Stack User's Guide along with SWRA640.

    Regards,
    Ryan

  • Hi Ryan,

    In rfDriverCallbackAntennaSwitching I'm switching to the 20 dBm path, But as you maintained "the RF TI driver will handle changing the radio paths between RX and TX" ,   I observed on an oscilloscope that the RF switch control pin is not changing its state while receiving. Is there any interrupt/ API is available to check RF is in RX mode or TX mode? For testing, I've implemented this in the "Simple Peripheral" example. I'm successfully able to interact with all the characteristics, which means module is exchanging data in both ways. How this is possible if the switch control pin is not changing its state?

  • Hi Amit,

    Are you sure that the 20 dBm path is being used for TX instead of the normal RF path?  Are you using the CC1352P-2 simple_peripheral example as recommended in the BLE5-Stack Migration Guide?  Can you clarify what other changes are being made to your project configuration in SysConfig?  Have you debugged rfDriverCallbackAntennaSwitching to determine which front-end path is actually being chosen, and does it align with your CONFIG_RF_* pin expectations?

    Regards,
    Ryan

  • Hi Ryan,

    I've verified TX path on the spectrum analyser. It is taking 20dBm path. I'm using simple_peripheral example from CC1352P_2 directory (directory path : simplelink_cc13x2_26x2_sdk_5_10_00_48\examples\rtos\CC1352P_2_LAUNCHXL\ble5stack\). I've changed the bootloader configuration for my board in SysConfig and the changes required for the RF switch. Following are piece of code :

    GPIO configurations in ti_drivers_config.c :

    (here DIO7 is VDD and DIO14 is the control pin of the switch.)

    const PIN_Config BoardGpioInitTable[CONFIG_PIN_COUNT + 1] = {
        /* LaunchPad Button BTN-1 (Left), Parent Signal: CONFIG_GPIO_BTN1 GPIO Pin, (DIO15) */
        CONFIG_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_DIS,
        /* Parent Signal: CONFIG_PIN_BTN2 GPIO Pin, (DIO5) */
        CONFIG_PIN_0 | PIN_INPUT_EN | PIN_NOPULL | PIN_IRQ_DIS,
        /* XDS110 UART, Parent Signal: CONFIG_DISPLAY_UART TX, (DIO13) */
        CONFIG_PIN_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* XDS110 UART, Parent Signal: CONFIG_DISPLAY_UART RX, (DIO12) */
        CONFIG_PIN_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN | PIN_IRQ_DIS,
        /* Parent Signal: /ti/drivers/RF RF Antenna Pin 0, (DIO7) */
        CONFIG_RF_ANTENNA_PIN_0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: /ti/drivers/RF RF Antenna Pin 1, (DIO14) */
        CONFIG_RF_ANTENNA_PIN_1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
    
        PIN_TERMINATE
    };
    

    RF driver callback :

    void rfDriverCallbackAntennaSwitching(RF_Handle client, RF_GlobalEvent events, void *arg)
    {
        /* Protect against repeated RF_init */
        static bool initialized = false;
    
        if (!initialized && events & RF_GlobalEventInit)
        {
            /* Don't do it again */
            initialized = true;
           // initAntennaSwitch();
        }
        else if (events & RF_GlobalEventRadioSetup) 
        {
            /* Switch off all paths. */
    
            PINCC26XX_setOutputValue(CONFIG_RF_ANTENNA_PIN_1, 0);
    
            RF_TxPowerTable_PAType paType = (RF_TxPowerTable_PAType)RF_getTxPower(client).paType;
    
    
            if (paType == RF_TxPowerTable_HighPA)
    
                PINCC26XX_setOutputValue(CONFIG_RF_ANTENNA_PIN_1, 1);
            else
                PINCC26XX_setOutputValue(CONFIG_RF_ANTENNA_PIN_1, 0);
        }
        else if (events & RF_GlobalEventRadioPowerDown)
        {
    
        }  
    }

    When I debugged rfDriverCallbackAntennaSwitching, if (paType == RF_TxPowerTable_HighPA) is getting true.

  • Since your antenna is SPDT, you only need one antenna pin to control the selection of the RF or PA path.  You can choose whether to invert this pin's state while not in use based on where the RF path are connected to your switch.  You should also be using PINCC26XX_setMux to connect the antenna pin to the correct RF hardware function (PINCC26XX_MUX_RFC_GPO3), keep initAntennaSwitch to initialize the pin paths, and not referencing PINCC26XX_setOutputValue to set the pin to one if using the normal PA path.  Please make sure that the pin's definitions also do not conflict with any other functionality, for example DIO_14 is also used for BTN2 of the LaunchPad hardware.  Here is a relevant thread that I recommend you read through.

    Regards,
    Ryan