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.

CCS/CC2652R: how to change the symbolRate without re-init the chip?

Part Number: CC2652R
Other Parts Discussed in Thread: TEST2, CC2650, CC1310

Tool/software: Code Composer Studio

Hi TI,

we run a  proprietary protocol with the CC2652R, and we need change the symbolRate basic the RSSI, eg: when RSSI>-70dbm, we use the 1Mbps rate, otherwise, we use 250Kbps,

we need switch between these two datarate withou reset the chip, and make sure it switch successfully within 300us, is there any CMD can implement this function?

i find the same question:https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz/f/156/t/641406?tisearch=e2e-sitesearch&keymatch=symbolRate

my question is where is the "upated setup command"?  i can only find the "RF_cmdPropRadioDivSetup", but it does not work when call“RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRadioDivSetup, RF_PriorityNormal, NULL, 0);”

edit:it should be RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);rather than RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRadioDivSetup, RF_PriorityNormal, NULL, 0);

now i can change symbolRate and deviation dynamically like this:

PIN_setOutputValue(ledPinHandle, Board_PIN_LED1,1);
RF_close(rfHandle);

RF_cmdPropRadioDivSetup.symbolRate.rateWord = 0x28000;
rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);

/* Set the frequency */
RF_cmdFs.frequency = 2404;
RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
PIN_setOutputValue(ledPinHandle, Board_PIN_LED1,0);

but it takes 43ms it finish the re_init opteration, how can we shorten the time to 10ms or less?

help, please.

 

Thanks,

LN

  • Hi

    sorry for the late replay. We will look into this and give you some feedback by tomorrow.

    Siri

  • You do not need to do an RF_Close and RF_Open to change the setup command. The setup command will be called whenever the RF Core has been off, and are beeing turned on again. You can force the RF Core off by using RF_yield.

    The example below show how every other packet is sent with different symbol rate:

    rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
    
    RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
    
    while(1)
    {
        /* Create packet with incrementing sequence number and random payload */
        packet[0] = (uint8_t)(seqNumber >> 8);
        packet[1] = (uint8_t)(seqNumber++);
        uint8_t i;
        for (i = 2; i < PAYLOAD_LENGTH; i++)
        {
            packet[i] = rand();
        }
    
        /* Send packet */
        RF_EventMask terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx,
                                                   RF_PriorityNormal, NULL, 0);
    
        PIN_setOutputValue(ledPinHandle, CONFIG_PIN_RLED,!PIN_getOutputValue(CONFIG_PIN_RLED));
    
        /* Power down the radio */
        RF_yield(rfHandle);
    
        /* Update the setup command */
        if (RF_cmdPropRadioDivSetup.symbolRate.rateWord == 0x8000)
        {
            RF_cmdPropRadioDivSetup.symbolRate.rateWord = 0x9000;
        }
        else
        {
            RF_cmdPropRadioDivSetup.symbolRate.rateWord = 0x8000;
        }
    }

    BR

    Siri

  • Hi Siri,

    thank you  for your info.

    do you mean it will update the Rate to the RF core without any operation(such as postcmd ,open, or others)?

    and how long it will takes to finish the new rate updated since the RF_cmdPropRadioDivSetup.symbolRate.rateWord = newValue;

    Thanks

    LN

  • Hi siri,

    Thank you!

    i test the code you post here, it works for the Tx, but does not work for the  Rx.

    Test 1:

    Tx send packets  switch between rateWord@0x8000 and rateWord@0x9000, Rx1 aways stays in rx mode @rateWord@0x8000, and Rx2 aways stays in rx mode @rateWord@0x8000, both this two Rxs get the packets successfully.

    Test 2:

    Tx send packets  switch between rateWord@0x8000 and rateWord@0x9000, Rx1 stays in receive mode switch between rateWord@0x8000 and rateWord@0x9000, but the Rx1 only can get half quantity

    of the packets the Tx had send out. (it means it get nothing in one rateWord)

    Tx code:

    RF_cmdPropTx.pktLen = PAYLOAD_LENGTH;
        RF_cmdPropTx.pPkt = packet;
        RF_cmdPropTx.startTrigger.triggerType = 0;
        RF_cmdPropTx.startTrigger.pastTrig = 1;
        RF_cmdPropTx.startTime = 0;
    
        /* Request access to the radio */
        rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
    
        /* Set the frequency */
        RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
    
        while(1)
        {
            /* Create packet with incrementing sequence number and random payload */
            packet[0] = (uint8_t)(seqNumber >> 8);
            packet[1] = (uint8_t)(seqNumber++);
            uint8_t i;
            for (i = 2; i < PAYLOAD_LENGTH; i++)
            {
                packet[i] = rand();
            }
    
            /* Send packet */
            //RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
            RF_EventMask terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx,RF_PriorityNormal, NULL, 0);
    
            /* Power down the radio */
            RF_yield(rfHandle);
    
            /* Update the setup command */
            if (RF_cmdPropRadioDivSetup.symbolRate.rateWord == 0x8000)
            {
                RF_cmdPropRadioDivSetup.symbolRate.rateWord = 0x9000;
                //RF_cmdFs.frequency = 2440;
            }
            else
            {
                RF_cmdPropRadioDivSetup.symbolRate.rateWord = 0x8000;
                //RF_cmdFs.frequency = 2450;
            }
    
    #ifndef POWER_MEASUREMENT
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED1,!PIN_getOutputValue(Board_PIN_LED1));
    #endif
        }

    Rx code:

    RF_cmdPropRadioDivSetup.symbolRate.rateWord = 0x8000;
        /* Request access to the radio */
        rfHandle = RF_open(&rfObject, &RF_prop,
                           (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
    
        /* Set the frequency */
        RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
    
        /* Enter RX mode and stay forever in RX */
        //RF_EventMask terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRx,RF_PriorityNormal, &callback,RF_EventRxEntryDone);
        RF_EventMask terminationReason = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRx,RF_PriorityNormal, &callback,RF_EventRxEntryDone);
        while(1)
        {
            if(Rx_Flag)
            {
                Rx_Flag =0;
    #if 1
                /* Update the setup command */
                if (RF_cmdPropRadioDivSetup.symbolRate.rateWord == 0x8000)
                {
                    RF_cmdPropRadioDivSetup.symbolRate.rateWord = 0x9000;
                    //RF_cmdFs.frequency = 2440;
                }
                else
                {
                    RF_cmdPropRadioDivSetup.symbolRate.rateWord = 0x8000;
                    //RF_cmdFs.frequency = 2450;
                }
                /* Power down the radio */
                RF_yield(rfHandle);
    #endif
               // RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
                RF_EventMask terminationReason = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRx,RF_PriorityNormal, &callback,RF_EventRxEntryDone);
    
    
            }
        }

    Thanks,

    LN

  • Hi

    Glad to hear that you were able to get it to work. Please note that the example was made to show/explain how you could change fileds in the setup command by forcing the RF Core off between the packets.

    If you are changing from 250 kbps to 1 Mbps, there might be other parameters that also needs to be changed (like RX BW, deviation etc. ).

    I know that in SmartRF Studio there are only settings for 100 kbps and 250 kbps.

  • Thank you, i am testing the daterate 0x8000 and 0x9000, have you noticed the Test2?

    The Tx switch successfully, but the Rx rateWord switch seems does not work.

  • Not sure if you are using repeat mode or not (then you need to cancel RX before turning off the RX code.

    I modified the rfPacketRX example as follows, and were able to receive all packets from the transmitter. Please note that you need to receive a packet to actually change the data rate, so this only works for demo purposes (and when you have no errors on your link):

    RF_cmdPropRx.pktConf.bRepeatOk = 0;
    RF_cmdPropRx.pktConf.bRepeatNok = 0;
    
    rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
    
    /* Set the frequency */
    RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
    
    while (1)
    {
        /* Enter RX mode and stay forever in RX */
        RF_EventMask terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRx,
                                                   RF_PriorityNormal, &callback,
                                                   RF_EventRxEntryDone);
    
        /* Power down the radio */
        RF_yield(rfHandle);
    
        if (RF_cmdPropRadioDivSetup.symbolRate.rateWord == 0x8000)
        {
            RF_cmdPropRadioDivSetup.symbolRate.rateWord = 0x9000;
        }
        else
        {
            RF_cmdPropRadioDivSetup.symbolRate.rateWord = 0x8000;
        }
    }
    

  • Hi Siri,

    it works when disable the repeat mode. it takes about 170us to finish the datarate switch.

    we also test this with CC2650(SDK  V2_21_00_06), it takes about 440us to finish the datarate change. have you test this with the CC2650?

    we want shorten the switch tiime to 220us.

    Thanks,

    LN

  • I do not have the chance to test this with the CC2650 now, but I have previously tested RX to TX and TX to RX switching on the CC1310 and it takes 320 and 270 us. This is WITHOUT having to turn off the RF Core and run a new setup command, so 440 us sounds reasonable. Unfortunately we do not have any magic setting to speed up this process.

    BR

    Siri

  • OK,thank you. it means we will lost the first packet after change the datarate , we have only 220us to do this.

    Thank you for your help.

    BR

    LN