Wake-up from light sleep mode

tve
Posts: 123
Joined: Sun Feb 15, 2015 4:33 pm

Wake-up from light sleep mode

Postby tve » Tue Jul 07, 2015 5:54 am

Do I understand correctly that the esp8266 can only wake up from light-sleep using the timer or a gpio input change? Does this mean, for example, that it cannot wake up from an incoming character on the UART? Is the UART powered-down during light sleep?

costaud
Posts: 138
Joined: Fri Oct 24, 2014 7:40 pm

Re: Wake-up from light sleep mode

Postby costaud » Tue Jul 07, 2015 5:07 pm

tve wrote:Do I understand correctly that the esp8266 can only wake up from light-sleep using the timer or a gpio input change? Does this mean, for example, that it cannot wake up from an incoming character on the UART? Is the UART powered-down during light sleep?


It is auto determined whether the chip is able to get into light-sleep.The API just pushes the "enable button"
For now, we can only receive ext-wake-up from GPIO. So the UART data might be lost if the chip is in light-sleep, during which the CPU clock pauses.
You can holde the GPIO before sending UART data.

tve
Posts: 123
Joined: Sun Feb 15, 2015 4:33 pm

Re: Wake-up from light sleep mode

Postby tve » Wed Jul 08, 2015 1:08 pm

Is the UART powered down during light sleep? (I don't know whether "CPU clock pauses" means that the UART is also paused.)
If the UART was running then the esp8266 program could find received characters when waking up. Otherwise, besides just triggering wake-up through some other GPIO one also has to synchronize to make sure the esp8266 has had time to wake-up...

User avatar
kolban
Posts: 131
Joined: Tue Jun 16, 2015 1:09 pm
Location: Fort Worth, Texas, USA

Re: Wake-up from light sleep mode

Postby kolban » Thu Jul 09, 2015 8:01 am

Reading here:

https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter

I get the impression that UART basically is a convention that says the send and receiver agree on a clock rate and the sender is always listening for data. Before a byte of data arrives, a start bit is sent, followed by 8 data bits, followed by a stop bit. The key phrase here is that the sender assumes that the receive is ready. This is where higher level protocols such as RS232 come into the play. With RS232, the serial data transmitter would signal Data Carrier Detect which would wake up the ESP8266 which would signal Data Terminal Ready when it wakes up from a sleep and only then can we start using UART for transmission (I'm being very, very loose in my words here).

So UART is responsible for turning parallel data into serial data and back again, but it is not responsible for the initial hand-shaking of when this should start or happen. That's where the other pins of communication:

o DTR
o RTS
o CTS
o DCD
o ... others

come into play.

So ... when you say "... an incoming character on the UART" ... is there a bigger story here? Do you have an RS232 or other higher level protocol? What is the source of your UART data?

tve
Posts: 123
Joined: Sun Feb 15, 2015 4:33 pm

Re: Wake-up from light sleep mode

Postby tve » Thu Jul 09, 2015 12:30 pm

Thanks for the UART education :-), but I can't use DTR/CSR or RTS/CTS because the esp8266 won't wake up from light sleep to those. I could use such signals on the far end and a GPIO pin to wake up. But now I'm using 4 pins for serial comm instead of 2. It's not like the esp8266 has an over-abundance of pins... See, if it could wake up from sleep when the UART receives a character and the UART stayed powered then I'd need only two pins and would have a 128 character buffer for waking up, that would be just so awesome, but sadly that's not the way it works :-(.

Who is online

Users browsing this forum: No registered users and 90 guests