Also increase sampling frequency in ulp_adc example and update READMEs.
Fixes https://github.com/espressif/esp-idf/issues/1108
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.
-
\ No newline at end of file
+With the default configuration (20ms ULP wakeup period), average current consumption in deep sleep mode is 16uA.
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.
*/
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
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()