Jump to content
cavelez1490

Sensor Controller with Energia

Recommended Posts

Hello,

I'm working on a project based on the CC1350 microcontroller from TI. I would like to program the Sensor Controller with Energia IDE (I'm a big Arduino's fan). Is it possible? Should I give up now and start programming with CCS?

Thanks

Share this post


Link to post
Share on other sites

The Sensor Controller isn't supported by Energia. 

Actually, it requires a specific IDE, called Sensor Controller Studio (link).

Quote

The tool generates a Sensor Controller Interface driver, which is a set of C source files to be compiled into the System CPU (ARM Cortex-M3/M4) application. These source files contain the Sensor Controller firmware image and associated definitions, and generic functions that allow the System CPU application to control the Sensor Controller and exchange data.

I tried and played with the examples, but they are rather sophisticated.

I'm looking for a very basic application for my Low Power Home Network Weather Monitoring with a clock (every 10 mn) and a push-button (manual) to raise an event and wake up the main core.

Share this post


Link to post
Share on other sites
Posted (edited)

Hello, I tried to replicate the low power home network weather monitor using the Galaxia library and the available sensors library to program a CC1350 sensortag rev 1.5.1, but it fails to compile as the library (galaxia) doesn't seem to be compatible with that platform.

Using the default multitasking library, is not possible to get sensor readings using timer or clock, as the code inside the loop only executes once, or shows the same sensor readings despite using the get() function in the reading.

The only way it worked for me is using a conventional loop (read sensors, transmit using  easylink, delay). But as the ideal way to do this is to achieve a very low power consumption after each data transmission, I tried shutting down the peripherials (Wire.end()) before calling the delay(), but it simply crashes.

I know that the delay functions in EnergiaMT are a idle task that puts the processor in a low power mode, depending on the contrstraints set by the active peripherials.

I have attached 2 examples, only 1 line different (wire.end() before the delay()), and very different results.

sensor_read_not_working.txt -> reading and transmitting sensor values in CC1350 sensortag and not working if wire.end() is called to save power. (sensor values don't change).

sensor_read_tx_working.txt -> reading and transmitting sensor values in CC1350 sensortag but without ending the wire function, the sensor values change.

I don't want to think the only reliable way to do simple sensor readings, sub-ghz TX and enter low power mode is using Sensor Controller Studio. 

 

Edited by numeros
I wanted to specify my problem.

Share this post


Link to post
Share on other sites

I reached 0.0505 mW / 0.0141 mA (measured with EnergyTrace) for the CC1350 SensorTag when idle without using the Sensor Controller, only Energia MT and the Galaxia library.

On the sensor_read_tx_working.txt version, Wire is initialised at each loop. Try removing line 45.

On my side, I measured that using Wire.end() Wire.begin() has no impact on power consumption. delay() actually turns the CC1350 in low power mode.

About the Galaxia library, Clock is recommended over Timer. Was Timer configured correctly? it uses two parameters: 

1740477096_Capture2019-08-2812_23_06.thumb.png.9e6a63464e3e70c662e80725a3311bd7.png

Could you please post the program using Clock?

Share this post


Link to post
Share on other sites

Hello, thanks for your kind response.

The function called by myClock.begin() only gets to execute once, transmmiting the packet successfully and showing the sent packet, but it gets stuck there.

The function is executed every 3000ms as defined in the myClock.begin() function, but the sensor readings don't change, it keeps sending the same sensor values to the receiving unit. If I add a counter to the string, the number changes but the sensor readings keep being the same.

 

I've also tried initializing the sensors again in the called function, but that doesn't work either. 

It seems that something in the clock function or the rtos is keeping the sensors library to sucesfully return the sensors values after the first function execution...

Share this post


Link to post
Share on other sites

As posted earlier and marked as bug, the clockFunction() can't include Serial.print() and similar functions which rely on clocks.

337168095_Capture2019-08-2908_48_28.thumb.png.0882ddd6306b1bc77b2808e8a3ef3fb3.png

The clockFunction() function is too long. It should be brief.

  • Modify clockFunction() to only raise an event...
void clockFunction()
{
    myEvent.send();
}

...initialised in the setup() function

Event myEvent;

void setup()
{
    myEvent.begin();
    // ...

    // Clock initialisation
    // Initial period = 1 s, then every 60000 ms = 60 s = 1 min
    myClock.begin(clockFunction, 1000, 60000);
    myClock.start();

}

...waited for in the loop() function

void loop()
{
    myEvent.waitFor();
    // ...
}

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...