As anticipated in a previous post, for a future project I’m working with some displays based on the ST7735 driver.
My project will be battery-powered, it’s therefore very important to think about power saving.
During normal use, with the backlight on, the display consumes about 67mA:
First, we can turn off the backlight by grounding the BLK pin. In this case the consumption drops to about 3mA:
Can the consumption of the display be reduced further? Reading the datasheet, you can find that the ST7735 chip can enter a sleep state, with minimal power consumption.
To enter this state, you have to send the SLPIN command, while to exit it the command is SLPOUT:
Initially, the Adafruit-ST7735-Library didn’t support those commands. I therefore proposed, and it was accepted, a change to include a new method:
void Adafruit_ST77xx::enableSleep(boolean enable) |
If you set the enable parameter to TRUE, the SLPIN command is sent and the chip enters sleep mode. In this mode, it consumes only 0,47mA:
Ciao Luca,
ho un ESP32 collegato a un ST7735 che mando in deep sleep senza resettare il display. Per risparmiare energia mando anche il display in sleep e al wake dell’ESP32 riattivo il display che si riaccende con l’ultima immagine che aveva caricato come mi aspetto.
L’anomalia che non mi spiego é che i successivi comandi di scrittura testo o full screen di colore vengono come non recepiti.
L’SPI é inizializzata e i pin DC e CS sono in output.
Secondo te a cosa può essere dovuto?
Saluti
ciao Fabrizio, molto strano: è esattamente come gestisco il display nel mio progetto e si “riprende” dallo sleep senza problemi. Mandi anche esp32 in deep sleep (e quindi al risveglio riparte lo sketch)?
Si scusa, mi spiego meglio:
– a primo avvio faccio init display(con hwreset)
– faccio draw di immagine
– mando in sleep display
– mando in deep sleep esp32 specificando di tenere alto (non resettato) pin hw reset display
– al secondo riavvio esp32 sa che sta tornando da deep sleep e chiama solo sleep out del display e mi trovo subito immagine di prima come mi aspetto senza reinizializzare display
– da qui in poi successivi comandi sul display non hanno effetto
Secondo me non rispetto una qualche temporizzazione
ciao Fabrizio, l’unica cosa che cambio è che faccio cmq l’init della libreria al risveglio… per come funziona il deep sleep di esp32 di fatto il processore viene resettato quindi temo che tutte le variabili interne della libreria si perdano.