Resolved: Jeenode Zero running from a coin cell (how to?)
The article "Ultra low-power and coin cells"- https://jeelabs.org/article/1652b/ - investigates the options in detail. - The forth library provides sleep-l0 tools (stop1s etc.). I tried the latter but run into a problem, on jeenode Zero V3 the following
: lp-test ( -- ) only-msi stop1s ; lptim-init lp-test
seems to crash the system, it can be reanimated only by reset. Does anyone have an idea what's wrong or where to start to achieve the goal (running from a coin cell)?
RE: Jeenode Zero running from a coin cell (how to?) - Added by jcw over 2 years ago
A (very brief) search reports example of use of
stop1s in the following files:
./jz1/main.fs ./jz1/ex/node.fs ./jz3/main.fs
Some more examples of
./jz1/ex/stop.fs ./jz3/ex/stop.fs ./jz4/ex/rot7.fs
Perhaps that's of use - as far as I know, these all did work as expected.
It can be tricky, all the clocks and interrupts have to be just right.
It's also very hard to debug, you may have to toggle GPIO pins to find out which code ran and which didn't.
RE: Jeenode Zero running from a coin cell (how to?) - Added by Rolf over 2 years ago
Thanks a lot!
Shame on me! Suddenly it works and I do not know why. To close the thread reasonably,
here is the code that I use now for low power sleep (consumes around 60 micro Amperes
with a Jeenode Zero Rev 3 and a BME280 in 1 shot mode):
: lp-wait ( -- ) led-off rf-init rf-sleep 2.1MHz 1000 systick-hz lptim-init only-msi \ stop10s \ stop 10 s 60 0 do stop10s loop \ stop 10 min ;