I would like to ask about a guidance to resources or measurements describing timings for arduino/Atmega328p when going to sleep / waking up.
In datasheet for Atmega328p we can find description of 5 sleep modes. But I cannot find any detailed information about how long it takes to go from 'active' state to 'power-down' or 'idle'. And other way around. How long it takes to go for example from 'idle' to 'active' state.
Would be great if you can point me to some existing chart/grid with some timing summary or maybe help understand and calculate values on my own.
I have a battery-driven sensor, based on mini pro 8Mhz 3.3v, that needs to report data several times per second. So, wake up, get data, send data, sleep. In loop. The operation of getting and sending data is around 2.5ms. Sleep time is 120ms.
Some time is spent on waking up device and then putting it into sleep.
I read somewhere that full process of waking up arduino from power-down takes 2ms. I assume that putting it into sleep will take same amount of time. So in summary I have 4ms when I am just waiting for internal arduino operations and 2.5ms of my own operations. So total of 6.5ms when adruino is working with current of 3.88mA (measured active state of my pro mini) and then sleeps 120ms with current arount 66uA. I am not considering here my sensor for simplicity. Also I am not able to find how much current is used during the process of wake-up, go-to-sleep so I assume worst case scanario - same amount as in active state.
Some simple math: (6.5ms x 3.88mA + 120ms x 0.066mA) / 126.5ms = 0.262mA
With 1000mAh battery it gives me around 159 days.
So I started to wonder if using other sleep modes will give me chance to reduce 'active' state time with a cost of slightly increased sleep current. Which in general will still reduce average current and increase battery life. 4ms of internal operations comparing to 2.5ms of actual job seems too much. And with so frequent wake-ups maybe other sleep mode will be more suitable for me.
Unfortunately I have no laboratory equipment to measure those times or currents myself so I can base only on theoretical calculations which seems not available.