<15ms boot, project approach

tachin
Posts: 17
Joined: Sun Feb 02, 2020 1:02 am

<15ms boot, project approach

Postby tachin » Mon Nov 14, 2022 10:58 pm

Hola,
I am in the researching stage for a personal project, I haven't chosen the hardware yet but I would like to continue using any of the modules from the ESP family, however, I am faced with a challenging situation

I need to detect a very accurate moment from a signal, however this signal only occours time to time (hours) and the module must run on battery for months/years, so there is not any other option than deep sleep or even turn off

Image

The signal is always the same, 2 HIGH pulses, I need to take the timestamp of the "middle" of two pulses or the first falling, I would like to use the first pulse to wakeup
As you can see in the reference image, I have only ~15ms to wakeup and detect the second pulse, (then I will sync with an external RTC and substract micros(), send packet,etc.. but that is another history)
Of course, the signal is not the same in lenght, each pulse may last from 15ms to 400ms

Image

I am asking for some technical advice on how to achieve this performance, I read here some threads where they archive no less than 60ms boot time, maybe some aditional hardware is needed for this task or just discard esp for this :cry:

Saludos

ESP_Sprite
Posts: 9739
Joined: Thu Nov 26, 2015 4:08 am

Re: <15ms boot, project approach

Postby ESP_Sprite » Tue Nov 15, 2022 1:28 am

How's about using the ULP to detect the signal and capture the timing before powering on the main CPU?

tachin
Posts: 17
Joined: Sun Feb 02, 2020 1:02 am

Re: <15ms boot, project approach

Postby tachin » Mon Nov 28, 2022 9:00 pm

Thanks for the hint, I did not know about that.

After research, seems that ULP will need 0.1mA ,if I am not wrong then it is too much energy for my purpose.

boarchuz
Posts: 606
Joined: Tue Aug 21, 2018 5:28 am

Re: <15ms boot, project approach

Postby boarchuz » Tue Nov 29, 2022 6:55 am

tachin wrote:
Mon Nov 28, 2022 9:00 pm
After research, seems that ULP will need 0.1mA ,if I am not wrong then it is too much energy for my purpose.
It will only be >100uA while it's running, but you'd normally only start the ULP periodically (eg. every 20ms) and a typical ULP program has a very short execution time, so the average current will be much lower.

For example, if you know the signal will be high for at least 15ms, the ULP might only need to run every 14ms. I'd be surprised if that averaged out to more than 8uA. The newer RISCV-ULPs even have interrupts, so you wouldn't need to poll at all.

Another option is to use the RTC wakeup stub, either with a simple program to capture the pulse timing itself, or to start the ULP to do so while the SoC continues to wake up.

tachin
Posts: 17
Joined: Sun Feb 02, 2020 1:02 am

Re: <15ms boot, project approach

Postby tachin » Wed Nov 30, 2022 1:00 pm

boarchuz wrote:
Tue Nov 29, 2022 6:55 am
It will only be >100uA while it's running, but you'd normally only start the ULP periodically (eg. every 20ms) and a typical ULP program has a very short execution time, so the average current will be much lower.

For example, if you know the signal will be high for at least 15ms, the ULP might only need to run every 14ms. I'd be surprised if that averaged out to more than 8uA. The newer RISCV-ULPs even have interrupts, so you wouldn't need to poll at all.

Another option is to use the RTC wakeup stub, either with a simple program to capture the pulse timing itself, or to start the ULP to do so while the SoC continues to wake up.

You are right, but I don't know how you get thoose numbers (8uA) , the most conservative approach I can think of is 2ms ON, 13ms OFF permanently, that is 12% of the time ON, so atleast 12uA, just asking

I think I'm going to go for a wake stub, I am currently researching as I have not been able to get any more accurate information than runs immediately as soon as the chip wakes up and I don't know yet how many uS or mS mean "immediately" :D

Thanks for your reply

boarchuz
Posts: 606
Joined: Tue Aug 21, 2018 5:28 am

Re: <15ms boot, project approach

Postby boarchuz » Wed Nov 30, 2022 2:10 pm

tachin wrote:
Wed Nov 30, 2022 1:00 pm
I don't know how you get thoose numbers (8uA) , the most conservative approach I can think of is 2ms ON, 13ms OFF permanently, that is 12% of the time ON, so atleast 12uA, just asking
Tbh I don't understand what exactly you're trying to measure. Is it between the red dots in your above image? The logic low duration between pulses (I based the above on this)? The logic high duration of the second pulse?
tachin wrote:
Wed Nov 30, 2022 1:00 pm
I think I'm going to go for a wake stub, I am currently researching as I have not been able to get any more accurate information than runs immediately as soon as the chip wakes up and I don't know yet how many uS or mS mean "immediately"
For reference I timed the ESP32 at about 1.27ms (https://esp32.com/viewtopic.php?f=12&t=24817)

tachin
Posts: 17
Joined: Sun Feb 02, 2020 1:02 am

Re: <15ms boot, project approach

Postby tachin » Wed Nov 30, 2022 3:06 pm

boarchuz wrote:
Wed Nov 30, 2022 2:10 pm
Tbh I don't understand what exactly you're trying to measure. Is it between the red dots in your above image? The logic low duration between pulses (I based the above on this)? The logic high duration of the second pulse?
I want to timestamp the "exact" moment where the signal switch from HIGH to LOW or FALLING
boarchuz wrote:
Wed Nov 30, 2022 2:10 pm

For reference I timed the ESP32 at about 1.27ms (https://esp32.com/viewtopic.php?f=12&t=24817)
Awesome!! I was looking for that value so many time, thank you so much, I will definitely go for wakeup stub :)

Who is online

Users browsing this forum: Google [Bot] and 107 guests