Question about screen initialization time

Suppose I made something that runs on batteries, and it is just made of an ATTiny85, a button, and a 1602 LCD w/ I2C backpack.

All it needs to do is to display something on the LCD for 5 seconds whenever the button is triggered. The ATTiny85 will be sleeping otherwise.

Does the LCD need time to 'wake up' before it acknowledges a command? Or would it stay initialized from the very first time so it's actually always active? Would it still be draining power even if backlight was off and nothing was displayed? Or would I have to de-initialize and re-initialize (and if so, what kind of time delay/sanity check period would it need)?

Any advice on approaches to have the LCD use as little power as possible while the device is sleeping, and any insight on how best to pair with the sleeping/waking mcu in terms of code, would be appreciated.

I have a alarm clock with SSD1306 OLED. The init code is kept as long as the OLED has power, but I turn off the content after some seconds. At the moment uptime is >200 days from two AAA cells. Controller is a STM32L031, which is in deep power down mode (only RTC runs) for most of the time.

I think the most important trick is to use a step up converter. I use the XC9142 to generate the 3.3V from the two AAA cells as long as voltage is above 0.7V. This means, your hardware will run until your battery is really empty (<0.4V for one 1.5 AAA cell).

Oliver

Ah, wonder if a 128x64 SSD1306 OLED uses less power than a 1602.
If so, I'd have to wonder if the larger graphics library needed for the OLED would fit on the ATTiny85. My code is otherwise very basic, just a stopwatch type of function. No RTC, accuracy not vital.

INTP:
Does the LCD need time to 'wake up' before it acknowledges a command? Or would it stay initialized from the very first time so it's actually always active?

hd44780 LCDs power up into a known state. You can send it commands to alter its state. One of things that gets changed from the default power up state when using a i2c backpack is changing from the default 8 bit mode to 4 bit mode.
As long as the LCD has power, it remains in its current state.

Would it still be draining power even if backlight was off and nothing was displayed?

Yes. There is a difference between displaying all spaces and disabling the display.
There is a command to turn off the pixels. This reduces the power a bit but the LCD still remains in its current state and when the display is re-enabled, whatever was on the display will show up again.
The current for the LCD is a few milliamps when the backlight is off and the display is turned off.

Or would I have to de-initialize and re-initialize (and if so, what kind of time delay/sanity check period would it need)?

There is no way to reset or de-initialize a hd44780 display.
You can turn the backlight and display off, or you could turn off the power completely.
If you turn off the power completely, the LCD must must be fully initialized into 4 bit mode again.
That initialization varies by library but it typically is in the range of 75 to 150 milliseconds.
So it might add a slightly noticeable delay between pushing the button and something appearing on the display if initialization was being done after the button was pushed.

Any advice on approaches to have the LCD use as little power as possible while the device is sleeping, and any insight on how best to pair with the sleeping/waking mcu in terms of code, would be appreciated.

If you want really low power, then you could and a transistor to cut of the power to the LCD device circuitry.
(Assuming you have an extra pin to be able to do that).
Just keep in mind that you will have to re-initialize the display when you turn the power back on and there will be a small delay to do that.

If you want to avoid the delay you may want to consider using shift registers with a modified LCD library.
Here is the reasoning:

If you use two 8 bit shift registers you could run the LCD in 8 bit mode rather than 4 bit mode.
The advantage of that is that a hd44780 powers up in 8 bit mode and is ready to go with no initialization needed.
To use two shift registers in 8 bit mode you would need to use a modified library anyway, but you could also modify it such that it skips most of the initialization sequence since you would know that begin() is being called after a fresh LCD powerup and does not need to go through the command sequence to ensure the LCD is in 8 bit mode.
This would allow you to turn the power off to the LCD when not in use but make the reinitialization time shorter.

For your application, it may not be worth it to use shift registers.
What you could do, to see how long initialization is with your i2c LCD device, just call millis() before and after lcd.begin() and then print the time difference to the LCD.
That will tell you how long the the initialization takes.
That time is the added overhead to re-initialize the LCD device if you power it off before you can print to it again.

And depending on your batteries and battery life needed, you may be able to get away with just turning the display off.
You will have to measure the current to the LCD device when the backlight and display is off to see what it actually draws to see if that is acceptable or whether you will need added circuity to disable the power.

--- bill