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.

CC1350: Merging Pininterrupt with sensor example

Part Number: CC1350


Hi,

    I am trying to merge the pinInterrupt_CC1350_tirtos_ccs example with sensor_1350lp example.I want the sensor task I mean to say  the main of the sensor example to start only when the button is pressed.So what I returned a flag from the case where the button is pressed made the main of the sensor function as main_t and called it in the same case, and left the remaining function that is the main of the interrupt example as it is .

When I tested it with the lanchpad the flag value is changing but it is not going to that function main_t.I am not sure if this is the right way to do it. Please guide me how to do it.

It would be great if somebody could help me on this.

I have attached the screenshot of what I exactly did.

Thanks And Regards

Stuti

  • Hi Stuti,

    Simply calling "main_t" from the callback is typically not a good idea as the original main assumes TI-RTOS is running (as it assumes it is the main).

    in the sensor_1350 example you already have to press a button for the sensor to "start", what is it you want to achieve on top of this?
  • Thanks for the quick response. In the example code when I measure the current I see around 200uA of current getting consumed and my application has energy constraints so when my controller is continuously consuming 200uA or higher in case of transmission. So here my idea is to put it to shutdown mode and then start Adc sampling of my sensor and then transmit and again go to shutdown mode. But I don't want to eliminate the stack in the whole scenario.
    So let's says I will be trying to put the controller in shutdown /standby mode instead of ideal mode and start the process only when the interrupt is received.
    May be you can suggest a better approach.


    Thanks And Regards
    Stuti
  • Hi Stuti,

    If your sensor is setup as a sleepy device, you should not see 200uA current when not transmitting, the device should go into standby which is < 1uA. 200uA sounds like there is some peripheral that is left on when idle (for example, the ADC), try doing the same measurements without the ADC enabled and with dummy data to see if the power consumption goes down.

    Getting that right I would expect to be better for power consumption then entering shutdown after every reading as the reboot and re-joining process of the 15.4 stack requires quite some radio time. What is the configuration of your 15.4 stack?
  • I will check with the current consumption without Adc and get back to you.
    The 15.4 stack is in the same configuration as the default example. I believe the default sensor is configured as a sleepy device.
    Another doubt which I have is when I test the default example code of sensor with the out of the box collector code the joining process happens only once until the sensor becomes orphan. But I don't see a joining process taking place if the collector is on but the sensor has restarted. Is my understanding correct in this regard?

    Thanks And Regards
    Stuti
  • Hi M-W,

               I checked for the current consumption with out of the box example of sensor and collector I just reconfigured the transmission interval to 10 seconds still I could see a current of around 30 uA getting consumed .

    What do you think is happening in this case?I am still not able to achieve a consumption of less than 1uA.

    Thanks And Regards

    Stuti

  • Hi Stuti,

    Did you measure the current using the LaunchPad? If so, I assume you removed all of the jumpers from the debug header, try to put the "RX" header back and see if that makes a difference. Without this the RX pin is left floating which would increase the current draw.
  • Hi M-W,

                  I tested again by connecting the Rx jumper of the launchpad to the debugger. I gave the supply from the external power supply and not by debugger still I could see the difference ,the consumption has reduced to 6uA but still not less than 1uA. Secondly can you please explain why did the consumption change when i connected the RX?

    Thanks And Regards

    Stuti

  • Hi Stuti,

    Have you added in the "POWER_MEAS" define to your project before building it? If you do not do this, the external flash will not get disabled per default which means you will see 5-10uA of current when in standby. Doing this (and having the RX jumper), I get below 1uA in standby.

    Why the current change when connecting the RX pin is because the input is no longer floating. You could also pull it to the 3V3 line in any other way, this would have the same result.
  • Hi M-W,

                  I still see a consumption of around 5-7uA even after defining "POWER_MEAS" and keeping the RX jumper.It has not shown any change even after defining it .

    What else could be the issue?

    Thanks And Regards

    Stuti

  • Hi,

    In the main function, could you verify that the "Board_shutDownExtFlash()" is active and called?

    #if defined(POWER_MEAS)
    /* Disable external flash for power measurements */
    Board_shutDownExtFlash();
    #endif

    In terms of power consumption, the external flash is the only thing I can think of that match that current and is typically a sign on it not being turned of for some reason.
  • Hi M-W,

                I tested with Board_shutDownExtFlash(); being active .When I still connect it to my oscilloscope it still shows around 10uA minimum in DVM mode and that too it not 10uA all the time (other than transmitting).

    It still keeps drawing around 30uA most of the time.

    I am measuring the current across the supply pins on the Launchpad. It that the right way of doing it?

    I have a few more doubts

    How will the #define POWER_MEAS affect the functionality of the over all code because there are certain APIs which will get called when that power measurement is enabled.

    Second doubt is does the sensor perform joining process every time it is switched on because I don't see a joining happening for a sensor until the collector is switched off and the sensor becomes orphan.

    Whenever I restart the sensor I just see a configuration response and no joining process.Have I understood it correctly ?

    Thanks And Regards

    Stuti

  • Hi Stuti,

    I actually measured the current without the "POWER_MEAS" define, simply moving the "Board_shutDownExtFlash" call out of the IFDEF so that it is always invoked.

    I did the measurements with all jumpers except the RX one removed, connecting power on the 3V3 and GND headers at the bottom of the board (closest to the antenna). For this I used a DC Power analyzer.

    Restarting the sensor would result in a re-alignment with the collector as it has an active entry of the sensor (it does not "join" the network but instead reconnects to it).
    You should see the same if restarting the collector without clearing the NV section.