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.

LAUNCHXL-CC1310: RF Transceiver power management

Part Number: LAUNCHXL-CC1310
Other Parts Discussed in Thread: CC1310

Hi,

I am working on cc1310 Transceiver. If I keep delay of  ( #define PACKET_INTERVAL (uint32_t)(4000000*0.5f) /* packet interval 0.5 sec*/  ) It is transmitting only 256 frames and taking some time and startiing again with 257 frame and again transmitting upto 512 frames, that I can see using docklight .

If i keep packet interval to 5.5 sec, It is transmitting only 54 frames. Can you guide me how to transmit continuously 

Regards

Dinesh Kumar

  • Are you using one of the examples in the SDK? If yes, which one? If not, we need some more information on the code you are running, ideally a self contained project that run on the CC1310 launchpad that show the issue.

    By continuously, do you mean back to back or always send a new packet after x ms delay?
  • I am using Tx packet and Rx packet code from examples.

    I want to send packets after delay time regularly .

    The above is my code from Tx side.


    #define PACKET_INTERVAL (uint32_t)(4000000*5.0f) /* packet interval 5.0 sec*/


    static void txTaskFunction(UArg arg0, UArg arg1)
    {
    //int count1,count2;
    uint32_t curtime;

    RF_Params rfParams;
    RF_Params_init(&rfParams);

    RF_cmdPropTx.pktLen = PAYLOAD_LENGTH;
    RF_cmdPropTx.pPkt = txPacket1;
    RF_cmdPropTx.startTrigger.triggerType = TRIG_ABSTIME;
    RF_cmdPropTx.startTrigger.pastTrig = 1;
    RF_cmdPropTx.startTime = 0;


    /* Request access to the radio */
    trfHandle = RF_open(&trfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);

    /* Set the frequency */
    RF_postCmd(trfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);

    /* Get current time */
    curtime = RF_getCurrentTime();


    while(1)
    {
    //if(u8_Flag == 1)
    //{
    u8_Flag_Rx1=1;
    //u8_DisFlag = 1;
    //if(count1 %2 == 0)
    //{
    txPacket1[0] = 0x33;
    txPacket1[1] = 0x44;
    txPacket1[2] = 0x11;
    txPacket1[3] = 0x22;
    //}
    //else
    //{
    //txPacket1[0] = 0x55;
    //txPacket1[1] = 0x66;
    //txPacket1[2] = 0x11;
    //txPacket1[3] = 0x22;
    //}
    //count1 = count1 + 1;

    txPacket1[4] = 0x12;
    txPacket1[5] = 0x21;

    memcpy(txPacket1+6," Master_1 \r\n ",16);

    /* Set absolute TX time to utilize automatic power management */
    curtime += PACKET_INTERVAL;
    RF_cmdPropTx.startTime = curtime;

    /* Send packet */
    RF_EventMask result = RF_runCmd(trfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0);

    PIN_setOutputValue(pinHandle, Board_LED1,!PIN_getOutputValue(Board_LED1));




    }
    }
  • I use the rfpacketTX example from the 1.5 SDK and only change this: define PACKET_INTERVAL (uint32_t)(4000000*5.0f)

    I use SmartRF Studio on the RX side and I receive more than 54 frames.

    Is the LED still blinking when you don't receive more frames?
  • No LED is not Blinking after 54 frame, after some time again it is getting started with 55 frame and continuing upto 120 frames. then after again getting pause for 5 to 10 min...

    Actually i am using 2 RF boards as Transceiver, 1 is master and other is slave. master should transmit first and slave should receive and again slave should transmit and master should receive. This is running only upto 55 frames if i keep delay ( PACKET_INTERVAL (uint32_t)(4000000*5.0f) /* packet interval 5.0 sec*/ ). if i place delay to 0.5 sec it  can perform 255 frames and then after it is getting pause and again starting with 256 frame after 5 to 10 min. and this process was repeating. 

  • Ok, from what you wrote in your previous post I assumed that you used the rfPacketTX/RX code as is with only small changes.

    For a master - slave that alter between RX and TX:
    - Check that TRIG_ABSTIME doesn't cause any issues. A absolute time could easily become a time in the past before you are ready to send a packet. See e2e.ti.com/.../553006 and similar posts.
    - You have to monitor both the RX and TX side to see more details what happens when the TX halts.
  • also i am doing power management by keeping packet interval to 5 sec. at that time after 5 seconds master transmitting data to slave and again receiving data from slave . so, at a time 4 LEDs are blinking on 2 RF boards, but this process is also taking 5 sec, continuously for 5 sec LEDs are glowing. then after LEDs shutting down after 5 sec Master Transmitting next frame, in every frame transmission LEDs also glowing for 5 sec. If i place packet interval for 10 sec then also LEDs also glowing for 10 sec and then shutting down after again 10 sec , this process is repeating . Main issue is I don't want glow LEDs as PACKET_INTERVAL time It should off immediately after data transmission and with PACKET_INTERVAL time it should go to sleep mode then after it should transmit again. Could you please help me for this issue.

    /* Set absolute TX time to utilize automatic power management */
    curtime += PACKET_INTERVAL;
    RF_cmdPropTx.startTime = curtime;

    Is there any better example for Transceiver operation. as of now i combined both Tx_packet and rx_packet and working.
  • This link e2e.ti.com/.../1842373 have combined RX and TX (see post from PrashanthS)

    We the LED is on for 5 s/ 10 s it's not possible to know without having your code.
  • Dinesh Kumar44 said:
    also i am doing power management by keeping packet interval to 5 sec. at that time after 5 seconds master transmitting data to slave and again receiving data from slave . so, at a time 4 LEDs are blinking on 2 RF boards, but this process is also taking 5 sec, continuously for 5 sec LEDs are glowing. then after LEDs shutting down after 5 sec Master Transmitting next frame, in every frame transmission LEDs also glowing for 5 sec. If i place packet interval for 10 sec then also LEDs also glowing for 10 sec and then shutting down after again 10 sec , this process is repeating . Main issue is I don't want glow LEDs as PACKET_INTERVAL time It should off immediately after data transmission and with PACKET_INTERVAL time it should go to sleep mode then after it should transmit again. Could you please help me for this issue.

    It looks to me that you are not aware, that the following function call blocks for almost PACKET_INTERVAL time:

    RF_EventMask result = RF_runCmd(trfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0);

    I suggest to not use automatic power management and switch to TRIG_NOW as a start trigger:

    // Start the TX command whenever it is delivered to the RF core
    RF_cmdPropTx.startTrigger.triggerType = TRIG_NOW;
    
    // ... The loop stuff
    // Remove everything related to startTime, RF_getCurrentTime(), you don't need it here.
    
    // Finally execute the TX command immediately and turn an LED on/off only while TX is active
    PIN_setOutputValue(pinHandle, Board_PIN_LED1, 1);
    RF_EventMask result = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx,RF_PriorityNormal, NULL, 0);
    PIN_setOutputValue(pinHandle, Board_PIN_LED1, 0);
    
    // Optional: Power the RF core down explicitly if no more work has to be done for a while:
    RF_yield(rfHandle);
    
    // Optional: Put the current task to sleep for a while (5s)
    Task_sleep(5000000 / Clock_tickPeriod);

    That is much simpler to understand than absolute trigger. The absolute triggers have no value in this example. Read more about triggers here.

  • Hi,

    The below is my Tx code in 1 master RF board , also i want to give address to my boards, Is is possible of giving Hardware filters or we have to do software filtering., as of now i am transmitting with 

    txPacket1[0] = 0x11;
    txPacket1[1] = 0x22;      this packets   

    and receiving side I kept 

    RF_cmdPropRx.pktConf.bChkAddress = 1;
    RF_cmdPropRx.address0 = 0x11;
    RF_cmdPropRx.address1 = 0x22;  

    This is fine or I have to go with any another method of giving addresses.

    /*Tx parameters */
    #define TX_TASK_STACK_SIZE 1024
    #define TX_TASK_PRIORITY 3

    #define PACKET_INTERVAL (uint32_t)(4000000*0.5f) /* packet interval 5.0 sec*/

    /******************************************************************************/
    /* Global Variables Section */
    /******************************************************************************/
    static uint8_t txTaskStack[TX_TASK_STACK_SIZE];

    static Task_Params txTaskParams;

    Task_Struct txTask;

    uint8_t txPacket1[PAYLOAD_LENGTH];
    uint8_t txPacket2[PAYLOAD_LENGTH];


    /* sensor1 and sensor2 transmitting packet */
    uint32_t u8Sen1;
    uint32_t u8Sen2;

    /* Tx RF handle and object*/
    static RF_Object trfObject;
    static RF_Handle trfHandle;

    static PIN_Handle pinHandle;

    /* flags for Rx1 and Rx2 */
    uint8_t u8_Flag_Rx1;
    uint8_t u8_Flag_Rx2;


    uint8_t u8_DisFlag;

    /******************************************************************************/
    /* Local Function Declaration */
    /******************************************************************************/
    static void txTaskFunction(UArg arg0, UArg arg1);

    /******************************************************************************/
    /* Function Name : Rf_Rx_Task_init */
    /* */
    /* Description : Declare receive task parameters */
    /* */
    /* In Params : PIN_Handle ledPinHandle */
    /* */
    /* Out Params : None */
    /* */
    /* Return Value : void */
    /******************************************************************************/
    void Rf_Tx_Task_init(PIN_Handle ledPinHandle)
    {
    pinHandle = ledPinHandle;

    /* Tx task parameters */
    Task_Params_init(&txTaskParams);
    txTaskParams.stackSize = TX_TASK_STACK_SIZE;
    txTaskParams.priority = TX_TASK_PRIORITY;
    txTaskParams.stack = &txTaskStack;
    txTaskParams.arg0 = (UInt)1000000;
    Task_construct(&txTask, txTaskFunction, &txTaskParams, NULL);
    }
    /******************************************************************************/
    /* Function Name : Rf_Rx_Task_init */
    /* */
    /* Description : Declare receive task parameters */
    /* */
    /* In Params : PIN_Handle ledPinHandle */
    /* */
    /* Out Params : None */
    /* */
    /* Return Value : void */
    /******************************************************************************/
    static void txTaskFunction(UArg arg0, UArg arg1)
    {
    //int count1,count2;
    uint32_t curtime;

    RF_Params rfParams;
    RF_Params_init(&rfParams);

    RF_cmdPropRx.pQueue = NULL;
    RF_cmdPropRx.rxConf.bAutoFlushIgnored = 1; /* Discard ignored packets from Rx queue */
    RF_cmdPropRx.rxConf.bAutoFlushCrcErr = 1; /* Discard packets with CRC error from Rx queue */
    RF_cmdPropTx.pktLen = PAYLOAD_LENGTH;
    RF_cmdPropTx.pPkt = txPacket1;
    RF_cmdPropTx.startTrigger.triggerType = TRIG_ABSTIME;
    RF_cmdPropTx.startTrigger.pastTrig = 1;
    RF_cmdPropTx.startTime = 0;

    RF_cmdPropRx.endTrigger.triggerType = TRIG_REL_START;


    /* Request access to the radio */
    trfHandle = RF_open(&trfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);

    /* Set the frequency */
    RF_postCmd(trfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);

    /* Get current time */
    curtime = RF_getCurrentTime();

    while(1)
    {

    u8_Flag_Rx1=1;


    txPacket1[0] = 0x11;
    txPacket1[1] = 0x22;

    memcpy(txPacket1+6," Master_1 \r\n ",16);

    /* Set absolute TX time to utilize automatic power management */
    curtime += PACKET_INTERVAL;
    RF_cmdPropTx.startTime = curtime;

    /* Send packet */
    RF_EventMask result = RF_runCmd(trfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0);

    PIN_setOutputValue(pinHandle, Board_LED1,!PIN_getOutputValue(Board_LED1));

    // Optional: Power the RF core down explicitly if no more work has to be done for a while:
    //RF_yield(trfHandle);

    sleep(1);


         }

    }

    This is my Rx code in Master

    /***** Defines *****/
    #define RX_TASK_STACK_SIZE 1024
    #define RX_TASK_PRIORITY 2

    /* rxpacket RX Configuration */
    /* Constant header size of a Generic Data Entry */
    #define DATA_ENTRY_HEADER_SIZE 8

    /* Max length byte the radio will accept */
    #define MAX_LENGTH 100

    /* NOTE: Only two data entries supported at the moment */
    #define NUM_DATA_ENTRIES 2

    /* The Data Entries data field will contain:*/
    #define NUM_APPENDED_BYTES 2

    #if defined(__TI_COMPILER_VERSION__)
    #pragma DATA_ALIGN (rxDataEntryBuffer, 4);

    static uint8_t rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(NUM_DATA_ENTRIES,
    MAX_LENGTH,NUM_APPENDED_BYTES)];
    #endif

    /******************************************************************************/
    /* Global Variables Section */
    /******************************************************************************/
    /* Variable declaration */
    uint32_t sleepTickCount;

    /* Check for the data receive */
    //uint8_t u8_Flag = 0;

    /* Pin driver handle */
    static PIN_Handle pinHandle;

    /***** Variable declarations for Rx *****/
    static Task_Params rxTaskParams;
    Task_Struct rxTask; /* not static so you can see in ROV */
    static uint8_t rxTaskStack[RX_TASK_STACK_SIZE];

    static RF_Object rrfObject;
    static RF_Handle rrfHandle;

    uint8_t rxpacket1[PAYLOAD_LENGTH];

    uint8_t rxpacket2[PAYLOAD_LENGTH];

    /* Receive dataQueue for RF Core to fill in data */
    static dataQueue_t dataQueue;
    static rfc_dataEntryGeneral_t* currentDataEntry;
    static uint8_t rxpacketLength;
    static uint8_t* rxpacketDataPointer;

    /******************************************************************************/
    /* Local Function Declaration */
    /******************************************************************************/
    void rxTaskFunction(UArg arg0, UArg arg1);

    void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e);


    /******************************************************************************/
    /* Function Name : Rf_Rx_Task_init */
    /* */
    /* Description : Declare receive task parameters */
    /* */
    /* In Params : PIN_Handle ledPinHandle */
    /* */
    /* Out Params : None */
    /* */
    /* Return Value : void */
    /******************************************************************************/
    void Rf_Rx_Task_init(PIN_Handle ledPinHandle)
    {
    pinHandle = ledPinHandle;

    /* Rx task parameters */
    Task_Params_init(&rxTaskParams);
    rxTaskParams.stackSize = RX_TASK_STACK_SIZE;
    rxTaskParams.priority = RX_TASK_PRIORITY;
    rxTaskParams.stack = &rxTaskStack;
    rxTaskParams.arg0 = (UInt)1000000;
    Task_construct(&rxTask, rxTaskFunction, &rxTaskParams, NULL);
    }

    /******************************************************************************/
    /* Function Name : Rf_Rx_Task_init */
    /* */
    /* Description : Declare receive task parameters */
    /* */
    /* In Params : PIN_Handle ledPinHandle */
    /* */
    /* Out Params : None */
    /* */
    /* Return Value : void */
    /******************************************************************************/
    void rxTaskFunction(UArg arg0, UArg arg1)
    {
    RF_Params rfParams;

    RF_Params_init(&rfParams);

    if(RFQueue_defineQueue(&dataQueue, rxDataEntryBuffer, sizeof(rxDataEntryBuffer),
    NUM_DATA_ENTRIES, MAX_LENGTH + NUM_APPENDED_BYTES))
    { /* Failed to allocate space for all data entries */
    while(1);
    }

    /* Modify CMD_PROP_RX command for application needs */
    RF_cmdPropRx.pQueue = &dataQueue; /* Set the Data Entity queue for received data */
    RF_cmdPropRx.rxConf.bAutoFlushIgnored = 1; /* Discard ignored rxpackets from Rx queue */
    RF_cmdPropRx.rxConf.bAutoFlushCrcErr = 1; /* Discard rxpackets with CRC error from Rx queue */
    RF_cmdPropRx.maxPktLen = MAX_LENGTH; /* Implement rxpacket length filtering to avoid PROP_ERROR_RXBUF */
    RF_cmdPropRx.pktConf.bRepeatOk = 0;
    RF_cmdPropRx.pktConf.bRepeatNok = 0;
    RF_cmdPropRx.pktConf.bChkAddress = 1;
    RF_cmdPropRx.address0 = 0x11;
    RF_cmdPropRx.address1 = 0x22;

    if (!rrfHandle)
    {
    /* Request access to the radio */
    rrfHandle = RF_open(&rrfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);

    /* Set the frequency */
    RF_postCmd(rrfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
    }


    if(u8_Flag_Rx1 == 1)
    {
    while (1)
    {
    /* Enter RX mode and stay forever in RX */
    RF_runCmd(rrfHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, &callback, IRQ_RX_ENTRY_DONE);

    sleep(1);
    }
    }

    }

    /******************************************************************************/
    /* Function Name : Rf_Rx_Task_init */
    /* */
    /* Description : Declare receive task parameters */
    /* */
    /* In Params : PIN_Handle ledPinHandle */
    /* */
    /* Out Params : None */
    /* */
    /* Return Value : void */
    /******************************************************************************/
    void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
    if (e & RF_EventRxEntryDone)
    {
    /* Toggle pin to indicate RX */
    PIN_setOutputValue(pinHandle, Board_LED2,!PIN_getOutputValue(Board_LED2));

    /* Get current unhandled data entry */
    currentDataEntry = RFQueue_getDataEntry();

    rxpacketLength = *(uint8_t*)(&currentDataEntry->data);

    rxpacketDataPointer = (uint8_t*)(&currentDataEntry->data + 1);

    //if(((*(rxpacketDataPointer + 2)) == 0x33)) & ( (*(rxpacketDataPointer + 3)) == 0x44))
    //{
    memset(rxpacket1,0,sizeof(rxpacket1));
    memcpy(rxpacket1, rxpacketDataPointer, (rxpacketLength + 1));

    u8_Flag_Rx1 = 0;
    u8_DisFlag = 1;
    //}

    /*else if(((*(rxpacketDataPointer + 2)) == 0x55) & ( (*(rxpacketDataPointer + 3)) == 0x66))
    {
    memset(rxpacket2,0,sizeof(rxpacket2));
    memcpy(rxpacket2, rxpacketDataPointer, (rxpacketLength + 1));

    u8_Flag_Rx1 = 0;
    u8_DisFlag = 1;
    }*/

    RFQueue_nextEntry();
    }
    }
    /******************************************************************************/
    /* End of RF_RX_IE_SENSOR.c */
    /******************************************************************************/

  • See dev.ti.com/.../packet-format.html and the TRM.

    When you are using RF_cmdPropTx the address field is 1 byte long in TX. Meaning that when you are using
    txPacket1[0] = 0x11;
    txPacket1[1] = 0x22;

    txPacket1[0] will be used as address on the receiver side when you use address filtering. txPacket1[1] will be the first byte in the payload will not be regarded as an address.
  • Is there Hardware filtering , or we have to go with software filtering. What to do if i have to communicate with 4 boards by giving addresses. Please guide me for giving addresses to devices.
  • Dinesh Kumar44 said:
    Is there Hardware filtering , or we have to go with software filtering. What to do if i have to communicate with 4 boards by giving addresses. Please guide me for giving addresses to devices.

    This is a software filter, but implemented on the RF core so it runs autonomously. TER has already written how to enable address filtering on the RX side for 2 addresses. If you have a star network with multiple nodes, 1 address would be the node address, the other address might be used for broadcasting. The base station would not use address filtering, but receive everything.

    I also highly recommend using EasyLink for the start. It deals with address filtering and makes application development much simpler and faster than using raw proprietary commands. If you want to transfer packets with address filtering, then EasyLink is the way to go. Try out the EasyLink examples in the SDK.