cancel
Showing results for 
Search instead for 
Did you mean: 

Collecting data from temperature sensor (I2C) and storing it in SRAM with less power consumption

RB4020
Associate II

I'm using STM32U073MCT6 MCU. I have a custom board (which contains this MCU and other required components) and I have 4 stages in my data logger that I want to develop using this board:
1) Just the battery is soldered and trip isn't started

2) Trip started but in low power mode i.e not performing any task

3) Collecting data through temp sensor (I2C) and storing data in SRAM (During the trip)

4) Moving all the data stored in SRAM to an external flash memory (During the trip) so that the SRAM can be used again

I want to put my device entirely in a low power mode and wakeup every certain interval and do 3) or 4). 
So now, I have few things to ask:

Q1) Basically, before the trip starts, button interrupt should have the wakeup capability and during the trip, both button interrupt and RTC should have the wakeup capability. And I want to use a low power mode such that the power consumption is very less. According to the datasheet, in Stop2, Standby and Shutdown: all these 3 low power modes both button and RTC has the wakeup capability and LSE, RTC can run during these modes. But I understand that the wakeup time from these modes will vary. Now, anyone can suggest what mode to use for this purpose such that the power consumption is less and user responsiveness is not much compromised i.e not much wakeup time??

Q2) And for 3), I want to do this: collect and store the data in SRAM with as much as less power consumption.

(Note: And here, SRAM content should be retained right? So, according to the datasheet, only Stop2 mode can retain SRAM1 (32KB) and SRAM2 (8KB), Standby can retain SRAM2 (8KB) and Shutdown cannot retain any SRAM. So, I'm thinking to use Stop2 mode to satisfy both 2) and 3))
And coming to this question, in ESP32, we have something called ULP Coprocessor Programming: 
The Ultra Low Power (ULP) coprocessor is a simple finite state machine (FSM) which is designed to perform measurements using the ADC, temperature sensor, and external I2C sensors, while the main processors are in Deep-sleep mode. The ULP coprocessor can access the RTC_SLOW_MEM memory region, and registers in the RTC_CNTLRTC_IO, and SARADC peripherals. The ULP coprocessor uses fixed-width 32-bit instructions, 32-bit memory addressing, and has 4 general-purpose 16-bit registers. This coprocessor is referred to as ULP FSM in ESP-IDF.

ESP32 ULP coprocessor is started by a timer. The timer is started once ulp_run() is called. The timer counts a number of RTC_SLOW_CLK ticks (by default, produced by an internal 150 kHz RC oscillator). The number of ticks is set using SENS_ULP_CP_SLEEP_CYCx_REG registers (x = 0..4). When starting the ULP for the first time, SENS_ULP_CP_SLEEP_CYC0_REG will be used to set the number of timer ticks. Later the ULP program can select another SENS_ULP_CP_SLEEP_CYCx_REG register using sleep instruction.

So, similarly is there anything in STM32? I'm thinking Low-power run mode is the solution. Am I right? If so, can anyone provide some article links to do this?

I attached the datasheet of STM32U073MCT6 and here's about ESP32: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/ulp.html

 

0 REPLIES 0