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.

rfWakeOnRadioTx consumption

Other Parts Discussed in Thread: CC1310, LAUNCHXL-CC1310

I am trying the examples of low power consumption for my cc1310. My goal is to integrate these examples with a message exchange via UART. My current consumption without the rfWakeOn examples is 7uA. I opted to choose these examples just to lower these 7uA. I tried the reception part and consumes very little about 2uA when I listen and 0uA when it's asleep. For the TX part I have a problem. When I do not transmit, 4uA consumption, while when I press the button I transmit 6.5uA consumption. I have two questions about it:

1) Is it possible to integrate message exchange via UART?
2) How can I reduce the 4uA of the transmission part?

The second question is more important.

  • I reduce the power consumption with RF_yield. Now, is it possible to integrate message comunication with UART? 

  • I suppose you can integrate uartecho example into your application to make it.

  • Hi , I integrate the uart echo on my example. In WoR TX I suppose that works, but In WoR RX not arrive nothing. I add this:

    static void rxTaskFunction(UArg arg0, UArg arg1)
    {
    
           const char  startPrompt[] = "Opening UART and RF:\r\n";
           const char  packetRxPromt[] = "Packet received \r\n";
           UART_Handle uart;
           UART_Params uartParams;
    
           UART_init();
    
           /* Create a UART with data processing off. */
           UART_Params_init(&uartParams);
           uartParams.writeDataMode = UART_DATA_BINARY;
           uartParams.readDataMode = UART_DATA_BINARY;
           uartParams.readReturnMode = UART_RETURN_FULL;
           uartParams.readEcho = UART_ECHO_OFF;
           uartParams.baudRate = 115200;
    
           uart = UART_open(Board_UART0, &uartParams);
    
           if (uart == NULL) {
                /* UART_open() failed */
                while (1);
           }
    
    
        RF_Params rfParams;
        RF_Params_init(&rfParams);
    
        /* Route out LNA active pin to LED1 */
        PINCC26XX_setMux(ledPinHandle, Board_PIN_LED0, PINCC26XX_MUX_RFC_GPO0);
    
        /* Create queue and data entries */
        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);
        }
    
        /* Copy all RX options from the SmartRF Studio exported RX command to the RX Sniff command */
        initializeSniffCmdFromRxCmd(&RF_cmdPropRxSniff, &RF_cmdPropRx);
    
        /* Configure RX part of RX_SNIFF command */
        RF_cmdPropRxSniff.pQueue    = &dataQueue;
        RF_cmdPropRxSniff.pOutput   = (uint8_t*)&rxStatistics;
        RF_cmdPropRxSniff.maxPktLen = MAX_LENGTH;
    
        /* Discard ignored packets and CRC errors from Rx queue */
        RF_cmdPropRxSniff.rxConf.bAutoFlushIgnored = 1;
        RF_cmdPropRxSniff.rxConf.bAutoFlushCrcErr  = 1;
    
        /* Calculate datarate from prescaler and rate word */
        uint32_t datarate = calculateSymbolRate(RF_cmdPropRadioDivSetup.symbolRate.preScale,
                                              RF_cmdPropRadioDivSetup.symbolRate.rateWord);
    
        /* Configure Sniff-mode part of the RX_SNIFF command */
        configureSniffCmd(&RF_cmdPropRxSniff, WOR_MODE, datarate, WOR_WAKEUPS_PER_SECOND);
    
        /* Request access to the radio */
        rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
    
        /* Set frequency */
        RF_runCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, &callback, 0);
    
        UART_write(uart, startPrompt, sizeof(startPrompt));
    
        /* Save the current radio time */
        RF_cmdPropRxSniff.startTime = RF_getCurrentTime();
    
        /* Enter main loop */
        while(1)
        {
            /* Set next wakeup time in the future */
            RF_cmdPropRxSniff.startTime += WOR_WAKE_UP_INTERVAL_RAT_TICKS(WOR_WAKEUPS_PER_SECOND);
    
            /* Schedule RX */
            RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRxSniff, RF_PriorityNormal, &callback, RF_EventRxEntryDone);
    
            UART_write(uart, &packet, packetLength);
        }
    }

  • WoR Examples.rar

    This is my tx and rx. I add the part of uartecho in tx and rx code. The code rx not receive nothing. Can you help me?

     

  • - Does it work if you are using packetTX, packetRX? 

    - Does WOR work if you comment out UART?

    - Have you taken into account the time the UART uses for the total timing?

    - Please give in detail how you have debugged this so far. 

    We can only do limited code debug on E2E and only for companies. For private projects we can only give guidelines. 

    The exception is if you have code that shows a bug in our drivers etc. 

  • Hi Ter, thanks for your support. The RfPacketTX and RX examples work by themselves, as the WOR examples also work. I tried to implement everything, but WOR Rx does not receive anything. When I send a message from TX to RX, the RX LED flashes but receives nothing.

  • I recommend that you monitor the LNA signal on the receiverand (this is already routed out on a pin in the rfWakeOnRadioRx example) at the same time as you look at the PA signal from the transmitter

    This way you can make sure that your timing is OK and that your receiver is entering RX state while the transmitter is sending data.

    Siri

  • Hi Siri, did you take a look at my code? Do you think that's okay?

  • Please see my last post. You have not given any details on how you have debugged your code. What you have done some far is observing that a LED is not blinking but what have you done to check the timing on your RX side? Note that a UART read/ write takes time and this can impact the RF.  

  • This time it is for the WAKEUP? How can I increment this time? I modify the setting of the time 2 to 10. But not changes nothing

  • Do you follow the following readme and see it works before you add UART related codes?

    Run the example on one of the boards above, this will be the RX board. Board_PIN_LED0 will blink on this board for every wake-up. By default the example is set up to wake up two times per second, so every 500 ms.

    Start the rfWakeOnRadioTx companion example on another board (TX board) and press Board_PIN_BUTTON0 on that board to send a packet.

    Board_PIN_LED1 on the RX board should now toggle for every button press.

  • I make this. It works. Now I add the uart echo in this example, but not works. Why?

  • Please do the steps I suggested. Look at the PA and LNA signal when it works, and then when it not works. Most likely the insertion of the UART code mess up your timing.

    Siri

  • it present a guide for this step? I haven't never used this Wor. I want to implement the uart echo in this example

  • GoodMorning Siri,  I'm trying the example of WoR. As I understand it, the example works like this:

    1) The RX and TX, They wake up twice every 500 ms, through this calculation:

    #define WOR_WAKE_UP_INTERVAL_RAT_TICKS(x) \
        ((uint32_t)(4000000*(1.0f/(x) - (WOR_WAKE_UP_MARGIN_S))))

    4000000*1/2 - 0.005 = 2000000 = 500ms 

    Now, If I want to use that the RX, it wake up 1 time every 5 seconds, what kind of data should I put?

    I make this reasoning, to make it match with the UART. When I have to send a message, I would like you to receive it.

    At this moment, when I send a packet, the TX and RX LEDs flash, but RX does not receive the message on the UART, so I would like to change the time.

     

  • It is not correct that TX transmits every 500 ms. TX transmits 1 packet everytime the button is pushed. The preamble length of the transmitted packet is 500 ms and is set by:

    RF_cmdPropTxAdv.preTime = WOR_PREAMBLE_TIME_RAT_TICKS(WOR_WAKEUPS_PER_SECOND);

    WOR_WAKEUPS_PER_SECOND 2 is also used by the RX code and means that the RX is configured to wake up 2 times a second (every 500 ms). Since the RX wakes up at this rate, the preamble of the transmitted packet must be equally long to make sure that that one of the RX wake-ups happens within the preamble.


    The plot above shows the WOR example running with the default 50 kbps settings and WOR_WAKEUPS_PER_SECOND 2.

    The RX signal is measured on Board_PIN_LED0:


    /* Route out LNA active pin to LED1 */
    PINCC26XX_setMux(ledPinHandle, Board_PIN_LED0, PINCC26XX_MUX_RFC_GPO0);
    

    To monitor the TX on the transmitter board, you can add

    /* Route out PA active pin to LED1 */
    PINCC26XX_setMux(ledPinHandle, Board_PIN_LED0, PINCC26XX_MUX_RFC_GPO1);
    

    Remember to add:

    #include <ti/drivers/pin/PINCC26XX.h>

    I tried settings WOR_WAKEUPS_PER_SECOND 0.2f to achieve 1 wakeup every 5 s, but I did not get this to work.

    It might be that there are some calculations that goes wrong when not using an interger, but I have not time to look into this right now. Setting it to 1 works, and the preamble is then 1 s long, and the receiver wake up once every s.

    Siri

     

     

  • Ok, thanks for your answer. If I add the part of uart echo in RX code, I make this steps:

    1) Add UART_init and setting

    2) Add the static uint8_t packet[MAX_LENGTH + NUM_APPENDED_BYTES - 1];

    3) In while cicle I add the UART_write(uart, packet, packetLenght);

    In this case when I push the button on TX board, I see the LED0 on RX board that turn ON, but the board pritnf the strange values ​​and not the sequence of numbers that should receive from TX. Why?

  • Because you are not converting the packet content to ascii???

    Siri

  • In RFpacketRX with uart-echo it works very well, now in WoR not works. Why? 

  • Can you change “UART_write(uart, &packet, packetLength);” to “UART_write(uart, “received”,8);” and see if you can get “received” output on console.

  • In this case, the RX board received always, even when the Board TX is close. I want to printf the packet that board TX send to RX

  • It looks your application can receive and output data to Uart. I suppose you sho follow Siri’s suggestion to transfer packet to hex format before you output it to UART.

  • Sorry , the TX board send to board RX a seqNumber. Now I want to see this seqNumber on UART of Board RX. In RX code, I add this line:

    static uint8_t packet[MAX_LENGTH + NUM_APPENDED_BYTES - 1]; /* The length byte is stored in a separate variable */
    
    
     const char value[] = "Read sequence:\r\n";
        UART_Handle uart;
        UART_Params uartParams;
    
        UART_init();
    
        RF_Params rfParams;
        RF_Params_init(&rfParams);
    
            UART_Params_init(&uartParams);
            uartParams.writeDataMode = UART_DATA_BINARY;
            uartParams.readDataMode = UART_DATA_BINARY;
            uartParams.readReturnMode = UART_RETURN_FULL;
            uartParams.readEcho = UART_ECHO_OFF;
            uartParams.baudRate = 115200;
    
            uart = UART_open(Board_UART0, &uartParams);
    
            if (uart == NULL) {
                /* UART_open() failed */
                while (1);
            }
    
     /* Set frequency */
        RF_runCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, &callback, 0);
    
        UART_write(uart, value, sizeof(value));
    
        /* Save the current radio time */
        RF_cmdPropRxSniff.startTime = RF_getCurrentTime();
    
        /* Enter main loop */
        while(1)
        {
            /* Set next wakeup time in the future */
            RF_cmdPropRxSniff.startTime += WOR_WAKE_UP_INTERVAL_RAT_TICKS(WOR_WAKEUPS_PER_SECOND);
    
            /* Schedule RX */
            RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRxSniff, RF_PriorityNormal, &callback, RF_EventRxEntryDone);
    
            UART_write(uart, &packet, packetLength);
    
            /* Log RX_SNIFF status */
            switch(RF_cmdPropRxSniff.status) {
                case PROP_DONE_IDLE:
                    /* Idle based on RSSI */
                    worStatistics.doneIdle++;
                    break;
                case PROP_DONE_IDLETIMEOUT:
                    /* Idle based on PQT */
                    worStatistics.doneIdleTimeout++;
                    break;
                case PROP_DONE_RXTIMEOUT:
                    /* Got valid preamble on the air, but did not find sync word */
                    worStatistics.doneRxTimeout++;
                    break;
                case PROP_DONE_OK:
                    /* Received packet */
                    worStatistics.doneOk++;
                    break;
                default:
                    /* Unhandled status */
                    break;
            };

    Why I don't read the seqNumber? Where is the problem? I don't understand this.

  • You cannot print everytime after the RF_runCmd. Then you are printing everytime, the radio has been in RX sniffing the channel, no matter if a packet has been received or not.

    Tou also MUST convert you received data to ascii. The sequence number is for your first packet 0x01 (I assume). 0x01 is not the ascii code for '1'.

    Siri

  • Sorry Siri, I still do not understand. Why can't I see the print on the receiver code? What part of the code I added is wrong?

  • I suppose you should do UART print inside case PROP_DONE_OK: and you have to format received data to hex format.

  • I was able to read the random number sequences on the serial. Now I should send a message and receive it on the side of the RX card. Is this possible? Can you give me directions?

  • Hi TER, this is the code that I see and I implement in my example of WoR. When I sent a message with UART, the board RX don't receive nothing.

  • I can't see that you use a Semaphore_pend in your code.

    What have you done so far to check the timing? I haven't seen any results of your debugging of the timing. 

  • I use a Semaphore_pend in TX code. It's right?

  • Good morning Yikai, yesterday I was able to transmit in the packets with a random numeric sequence and print them on both the receiver and the transmitter. I used the UART_write function within the switch in PROP_IDE like this: 

    UART_write(uart,&packet,packetLength);

    Now I think it's the same as with regard to a data written by me on UART and send it to the RX board. For the receiver the work is the same, while for the transmission I used the example of RF_UART and I also transmit with the Semaphore_pend. Now when I press the button, I write the data and send, but the RX card does not receive the sent message. How come? Am I wrong? 

  • I couldn’t understand your descriptions and question.

  • I was able to send a random number sequence to the RX board and print it on the serial. I used this command here to print: 

    UART_write(uart,&packet,packetLength);

    Now instead of printing a randomic number, I'd like to write on the Board TX serial and read it on board RX. I used the same command in RX to print and on the TX board I implemented the RF_UART sample that TER shared. It's not working. The RX board doesn't get what I write about the serial. What am I wrong?

  • Where and how do you call UART_write in RX to output receiving packets?

  • I call UART_write in this mode:

    case PROP_DONE_OK:
       /* Received packet */
           UART_write(uart, &packet, packetLength);
           worStatistics.doneOk++;
           break;

  • I still don’t see you format packet to hex output.

  • Why the packet it is format hex? If I send to board RX a sequence number I use this format.

  • I mean you should use something like sprintf %x to format it as hex before you output it to UART.

  • For to printf of Sequence number that I use in my example, I don't used the format %x for hex before my output it to UART. Why?

  • As I know, UART terminal tool such as Putty or Teraterm can only display ASCII characters. If the Sequence number is not in ASCII recognized form, I don't know how it can display the Sequence number without format it to hex first.

  • Goodmorning , I try to send to board RX the message that I write on UART through the board TX, but nothing. This is the part of code that I add: 

    TX: 

    while(1)
        {
            /* Wait for a button press */
           Semaphore_pend(txSemaphoreHandle, BIOS_WAIT_FOREVER);
    
            RF_yield(rfHandle);
            uint8_t i = 0;
    
            do{
                UART_read(uart, &input, 1);
                UART_write(uart, &input, 1);
                packet[i++] = input;
            }
            while (input != '\r');
    
         RF_cmdPropTxAdv.pktLen = i;
    
            /* Send packet */
            RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTxAdv, RF_PriorityNormal, NULL, 0);
    
            /* Update display */
      /*      Display_printf(uartDisplayHandle, 0, 0, "Pkts sent: %u", seqNumber);
            Display_printf(lcdDisplayHandle, 1, 0, "Pkts sent: %u", seqNumber);*/
    
            /* Toggle LED */
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED1, !PIN_getOutputValue(Board_PIN_LED1));
        }

    RX: 

     case PROP_DONE_OK:
                    /* Received packet */
                    buf[4] = packet[i];
                    System_sprintf(buf, "%x", packet);
                    UART_write(uart, buf, 4);
                    worStatistics.doneOk++;
                    break;

    Where is the problem? Please, can you help me?

  • System_sprintf doesn't work in this way. I suppose you should use "sprintf(buf, "%x", packet[0]);" to format packet[0] into hex format. I remembered I had show you similar code in your other threads long time ago.

  • Don't chenged nothing. The board RX don't receive the message. Why?

  • I see you revise codes inside "while(1){...}" in your TX example, don't you? Why do you say "Don't chenged nothing"?

  • I modify the sprintf in my rx code. Tx code it wrong?

  • In TX related code, are you sure it goes to the line "RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTxAdv, RF_PriorityNormal, NULL, 0);"? Can you set a breakpoint to confirm it?

  • I can't debug, I have this kind of error: