diff --git a/examples/system/ulp/README.md b/examples/system/ulp/README.md index a965736d5..17ba58f21 100644 --- a/examples/system/ulp/README.md +++ b/examples/system/ulp/README.md @@ -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. - \ No newline at end of file +With the default configuration (20ms ULP wakeup period), average current consumption in deep sleep mode is 16uA. diff --git a/examples/system/ulp/main/ulp_example_main.c b/examples/system/ulp/main/ulp_example_main.c index ede8813d2..650744e88 100644 --- a/examples/system/ulp/main/ulp_example_main.c +++ b/examples/system/ulp/main/ulp_example_main.c @@ -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. */ diff --git a/examples/system/ulp_adc/README.md b/examples/system/ulp_adc/README.md index a8d603361..f07cf0fc7 100644 --- a/examples/system/ulp_adc/README.md +++ b/examples/system/ulp_adc/README.md @@ -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 diff --git a/examples/system/ulp_adc/main/ulp_adc_example_main.c b/examples/system/ulp_adc/main/ulp_adc_example_main.c index 630c29eb6..5e43ca22d 100644 --- a/examples/system/ulp_adc/main/ulp_adc_example_main.c +++ b/examples/system/ulp_adc/main/ulp_adc_example_main.c @@ -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()