2019-12-28 05:05 AM
2019-12-28 05:31 AM
Sleep mode. And wake up cpu at pulse. How frequent and how long this puls is?
Then variable ++ and make cpu sleep again.
2019-12-28 06:06 AM
The problem is that the pulses are at arbitrary times. They can occur all day long, this can leave the MCU awake for a long time by draining current. should have an option to count pulses in sleep mode. Only once a day will the values be sent to the server.
2019-12-28 09:01 AM
All I know is that STM32L4 series have low power peripherals such as LPTIM which can work even if the core is low power mode.
Combined with RTC for time elapsed, use the LPTIM as a counter and wake up the micro only when regularly needed.
Other peripherals such as LPUART allow to wake up from receiving byte without losing its data while the core wakes up.
I suggest to dig in this direction for metering.
2019-12-28 10:11 AM
Without some idea of the pulse rate, it's impossible to give you a reasonable answer. The STM32L4 is a great part -- I've designed data loggers that average 1uA over months -- but you need to define the problem better.
2019-12-30 02:46 PM
OK, the project is: I need to monitor a flowmeter, which runs 24hrs, always has water passing, so pulses are always generated. I will not be able to use solar panel, and will be in a region of difficult access to always be changing the battery. Soon I need to find a way to count pulses with minimal consumption. Once a day the data will be sent to a server using SIM800l. RTC will also be required to submit the data at the right time. Thanks.
2019-12-30 02:53 PM
The pulse frequency is approximately 0.1 hz.
2019-12-30 02:58 PM
The stm32l4 can easily do 0.1hz wakeup at under 2 uA (stop 2) and with a bit more effort under 1uA (standby). But, if you don't have experience in writing embedded software and designing low-power hardware getting to those targets will take some real effort.
2019-12-30 09:00 PM
So use the low power timer and use the signal as clock.
16 bit timer would overflow after 6500 sec = 2 hours when the micro needs to increment a RAM counter (and probably save the value in case of power down)
Make sure your HW peripheral selection is enabling low power and lowest core operating frequency. You can also have a speed gear box on L4 for the core, peripherals can use other clocks than SYSCLK so that you have progressive way to improve the power consumption. Most important will be system leakage.