examples/ulp: disable pullup on GPIO15 to reduce current

Also increase sampling frequency in ulp_adc example and update READMEs.

Fixes https://github.com/espressif/esp-idf/issues/1108
This commit is contained in:
Ivan Grokhotkov 2017-11-03 14:01:33 +08:00
parent b13cd4adf8
commit dec4a868d0
4 changed files with 26 additions and 6 deletions

View file

@ -45,6 +45,6 @@ Wrote updated pulse count to NVS: 405
Entering deep sleep
```
Note that in one case the pulse count captured by the ULP program is 6, even though the `edge_count_to_wake_up` variable is set to 10 by the main program. This shows that the ULP program keeps track of pulses while the main CPUs are starting up, so when pulses are sent rapidly it is possible to register more pulses between wake up and entry into app_main.
Note that in one case the pulse count captured by the ULP program is 6, even though the `edge_count_to_wake_up` variable is set to 10 by the main program. This shows that the ULP program keeps track of pulses while the main CPUs are starting up, so when pulses are sent rapidly it is possible to register more pulses between wake up and entry into app_main.
With the default configuration (20ms ULP wakeup period), average current consumption in deep sleep mode is 16uA.

View file

@ -68,6 +68,12 @@ static void init_ulp_program()
rtc_gpio_pullup_dis(gpio_num);
rtc_gpio_hold_en(gpio_num);
/* Disable pullup on GPIO15, in case it is connected to ground to suppress
* boot messages.
*/
rtc_gpio_pullup_dis(GPIO_NUM_15);
rtc_gpio_hold_en(GPIO_NUM_15);
/* Set ULP wake up period to T = 20ms (3095 cycles of RTC_SLOW_CLK clock).
* Minimum pulse width has to be T * (ulp_debounce_counter + 1) = 80ms.
*/

View file

@ -6,11 +6,19 @@ ULP program periodically measures the input voltage on GPIO34. The voltage is co
By default, thresholds are set to 1.35V and 1.75V, approximately.
Average current drawn by the ESP32 in this example with the default configuration (10Hz measurement period, 4x averaging) is 80 uA.
GPIO15 is connected to ground to supress output from ROM bootloader.
Average current drawn by the ESP32 in this example (with the default 4x averaging) depending on the measurement frequency is as follows:
Measurement frequency, Hz | Average current, uA
--------------------------|---------------------
10 | 8.5
50 | 20
100 | 37
## Example output
Below is the output from this example. GPIO15 is pulled down to ground to supress output from ROM bootloader.
Below is the output from this example.
```
Not ULP wakeup

View file

@ -71,8 +71,14 @@ static void init_ulp_program()
ulp_low_thr = 1500;
ulp_high_thr = 2000;
/* Set ULP wake up period to 100ms */
ulp_set_wakeup_period(0, 100000);
/* Set ULP wake up period to 20ms */
ulp_set_wakeup_period(0, 20000);
/* Disable pullup on GPIO15, in case it is connected to ground to suppress
* boot messages.
*/
rtc_gpio_pullup_dis(GPIO_NUM_15);
rtc_gpio_hold_en(GPIO_NUM_15);
}
static void start_ulp_program()