cavelez1490 0 Posted September 25, 2018 Share Posted September 25, 2018 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 Quote Link to post Share on other sites
Rei Vilo 695 Posted September 25, 2018 Share Posted September 25, 2018 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. energia 1 Quote Link to post Share on other sites
numeros 0 Posted August 27, 2019 Share Posted August 27, 2019 (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 August 28, 2019 by numeros I wanted to specify my problem. Quote Link to post Share on other sites
Rei Vilo 695 Posted August 28, 2019 Share Posted August 28, 2019 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: Could you please post the program using Clock? Quote Link to post Share on other sites
numeros 0 Posted August 29, 2019 Share Posted August 29, 2019 Hello, thanks for your kind response. I've attached the program using Clock, based in the Galaxia_Clock example. -> Galaxia_TX_Sensors.txt : 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. I've also attached the same program, but excluding all Serial calls. -> Galaxia_TX_Sensors_loop_same_values.txt : 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... Quote Link to post Share on other sites
Rei Vilo 695 Posted August 29, 2019 Share Posted August 29, 2019 As posted earlier and marked as bug, the clockFunction() can't include Serial.print() and similar functions which rely on clocks. Please refer to the Galaxia Library Suite — Reference Manual (version 2.0.1).pdf provided with the library. 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(); // ... } Quote Link to post Share on other sites
numeros 0 Posted September 2, 2019 Share Posted September 2, 2019 Excellent, That way the code worked flawlessly! Thank you very much! Quote Link to post Share on other sites
Rei Vilo 695 Posted November 22, 2019 Share Posted November 22, 2019 You're welcome! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.