> some MCUs have STOP mode with all clock sources disabled while all the internal RAM is kept powered
The new Raspberry Pi chips do this (RP2040 RP2350 with the RP2350 having an actual stop mode).
I'm using the esp32-s3 which has a deep sleep mode when only the
co processor is running and a light sleep mode when the main RAM
is being kept alive. The thing I wanna program is a "smartwatch" Watchy
from SQFMI which is just a small board with an E Ink display
slapped on it.
Being low power and all, it lasts a week before the battery runs
out, using the original firmware. I don't wanna sacrifice that for
programmable convenience.
These draw less than 1 microamp in this state. With the RTC doing a wake up every minute to poll sensors, battery life is in months. So lots of way to save power across the long term
--
That is quite low, the datasheet for the esp32-s3 says it draws 7 microamps in deepsleep and 240 microamps in light sleep.
~ Sewbacca
I didn't think of that, I did some more testing and wanna share what I've found:
- Running Lua without anything draws 7-8KB - Running just the base and nothing else about 9-10KB - Running a simple fibonacci program that prints the first 20 numbers 11-12KB (using only _G) - Running a simple terminal ascii clock updating constantly using a busy loop with os, string and io loaded uses just below 16KB (calling collectgarbage() every cycle)
The sleep resistant memory of the esp32-s3 has 16KB in total, so I could just barely run a simple terminal ascii clock within it. The main benefit of pausing Lua instead of restarting it every time would be that complicated programs would not have to worry about which data has to be stored and when and how it should be reconstructed.
Serializing threads could circumvent this issue by only
serializing non static data (i.e. no standard packages _G etc.) or
giving it unique ids derived of their global variable name, if
they are referenced from a local.
We can serialize almost every data type in Lua, even functions thanks to string.dump and the debug API. coroutines however seem to be the only exception, despite being transparent to the debug API.
--
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lua-l+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/lua-l/55004919-cee1-4686-8dc1-17522c92a14f%40kolabnow.com.