You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ESP-Knob is also compatible with the Matter-Over-Thread protocol, allowing for easily connect with smart devices such as Apple [HomePod](https://www.apple.com/homepod/) and [Amazon Echo](https://www.dxomark.cn/amazon-echo-4th-gen-speaker-review-wider-than-meets-the-eye/) simultaneously. This enables users to seamlessly manage and control various smart home devices in their homes through the Matter protocol, facilitating a cross-platform smart home control system that enhances the coherence and convenience of the user experience.
66
66
67
67
@@ -116,17 +116,17 @@ The circuit blocks annotated in the drawing are as follows:
-**`EC11 (Rotary Encoder):`** Used for user input, capable of detecting both rotation and press operations. The press signal from the EC11 controls `VCC_EN`, which is used for power switching or mode switching.
119
+
-**`EC11 (Rotary Encoder):`** Used for user input, capable of detecting both rotation and press operations. The press signal from the EC11 controls `VCC_EN`, which is used for power switching or mode switching.
120
120
121
-
-**`5V → 3.3V (Power Module):`** Uses the XC6206P332MR-G low-dropout linear regulator to step down the USB power supply (5V) to the 3.3V required by the [ESP32-H2](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf).
121
+
-**`5V → 3.3V (Power Module):`** Uses the XC6206P332MR-G low-dropout linear regulator to step down the USB power supply (5V) to the 3.3V required by the [ESP32-H2](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf).
122
122
123
-
-**`VBAT → 3.3V (Power Module):`** Utilizes the TPS61291 boost converter to accommodate a wide input voltage range, supplying 3.3V to the [ESP32-H2](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf) during operation. When the [ESP32-H2](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf) is in sleep mode, it is directly powered by the battery, and supporting low-power on sleep mode for wake-up functionality.
123
+
-**`VBAT → 3.3V (Power Module):`** Utilizes the TPS61291 boost converter to accommodate a wide input voltage range, supplying 3.3V to the [ESP32-H2](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf) during operation. When the [ESP32-H2](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf) is in sleep mode, it is directly powered by the battery, and supporting low-power on sleep mode for wake-up functionality.
124
124
125
-
-**`USB-C Interface:`** Use a USB-C port connect to the ESP32-H2 and used for data transmission and power supply.
125
+
-**`USB-C Interface:`** Use a USB-C port connect to the ESP32-H2 and used for data transmission and power supply.
126
126
127
-
-**`LED (LED Module):`** Uses `GPIO2` and `GPIO3` of the [ESP32-H2](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf) to control a dual-color LED for lighting and off, and used indicating different operating states of the ESP-Knob.
127
+
-**`LED (LED Module):`** Uses `GPIO2` and `GPIO3` of the [ESP32-H2](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf) to control a dual-color LED for lighting and off, and used indicating different operating states of the ESP-Knob.
128
128
129
-
-**`BATTERY (Battery Management Module):`** Connects an external lithium battery (VBAT) through BT1 and monitors the battery voltage. The voltage is divided to BAT_ADC, allowing the ESP32-H2 to monitor the battery level.
129
+
-**`BATTERY (Battery Management Module):`** Connects an external lithium battery (VBAT) through BT1 and monitors the battery voltage. The voltage is divided to BAT_ADC, allowing the ESP32-H2 to monitor the battery level.
130
130
131
131
-**`DEBUG (Download & Debug Interface):`** A reserved test point for the download interface and hardware reset interface of the ESP-Knob device. By connecting to the ESP32-H2’s UART0 interface `(TXD0 and RXD0`), it supports firmware flashing and debugging. Pulling the `ESP_EN` pin low allows for a hardware reset of the ESP-Knob.
132
132
@@ -137,9 +137,9 @@ The complete open-source hardware documentation for ESP-Knob can be found at [ES
137
137
138
138
The example projects for the ESP-Knob available at the time of writing are detailed below. Once you flash the corresponding firmware, the ESP-Knob can be connected to different smart home systems. You can also directly download the three kinds of ESP-Knob firmware from the [ESP-LAUNCHPAD](https://espressif.github.io/esp-launchpad/?flashConfigURL=https://dl.espressif.com/AE/AE-Demo/ESP32-H2-Knob/config.toml).
139
139
The examples are
140
-
***BLE-HID**: A BLE-HID implementation based on the [ble_hid_device_demo](https://github.com/espressif/esp-idf/tree/release/v5.4/examples/bluetooth/bluedroid/ble/ble_hid_device_demo). You can adjust the volume by turning the knob and change the bonded device through a long press.
141
-
***BTHome firmware**: It integrates `Button`and `Dimmer`components, broadcasting the data in BTHome protocol. It supports Home Assistant and automatic deep sleep.
142
-
***Matter universal switch**: It implements a simple matter switch, which can be provisioned using the network qr-code.
140
+
***BLE-HID**: A BLE-HID implementation based on the [ble_hid_device_demo](https://github.com/espressif/esp-idf/tree/release/v5.4/examples/bluetooth/bluedroid/ble/ble_hid_device_demo). You can adjust the volume by turning the knob and change the bonded device through a long press.
141
+
***BTHome firmware**: It integrates `Button`and `Dimmer`components, broadcasting the data in BTHome protocol. It supports Home Assistant and automatic deep sleep.
142
+
***Matter universal switch**: It implements a simple matter switch, which can be provisioned using the network qr-code.
Imagine this scenario: you have finished programming your application, designed your PCB with a battery circuit, and you are finally ready to set it free by disconnecting the umbilical cord--the USB cable. But to your great disappointment, you find too soon that your small LiPo battery drains in a matter of hours.
11
+
Imagine this scenario: you have finished programming your application, designed your PCB with a battery circuit, and you are finally ready to set it free by disconnecting the umbilical cord --- the USB cable. But to your great disappointment, you find too soon that your small LiPo battery drains in a matter of hours.
12
12
13
13
If you plan to run your application on a battery, it is of utmost importance to know how to design your hardware and software so that the application does not gobble up the power like a vacuum cleaner. Even something as simple as polling a GPIO can have a drastic impact on power consumption. Doing it the easiest way vs. using the chip's low-power features can result in an average difference of 22 mA vs. 22 µA. In other words, with your 350 mAh LiPo battery, it is the difference between it lasting 16 hours vs. 2 years.
14
14
15
15
In this article, we'll introduce one of the features that Espressif chips provide to achieve low-power consumption: the Ultra-Low-Power coprocessor (ULP), a processor separate from the main CPU. In a nutshell, if we run parts of our application on the ULP while the rest of the system sleeps, we can achieve much lower power consumption.
16
16
17
-
This article will focus on the latest iteration of the ULP--the LP-Core--available on the ESP32-C6 and a range of other new chips. For building the application, we will use ESP-IDF v5.4.
17
+
This article will focus on the latest iteration of the ULP --- the LP-Core --- available on the ESP32-C6 and a range of other new chips. For building the application, we will use ESP-IDF v5.4.
18
18
19
19
## Low-power on Espressif chips
20
20
@@ -35,21 +35,21 @@ What the ULP brings to the table in a low-power context is the ability to run ev
35
35
36
36
## ULP
37
37
38
-
The ULP is a coprocessor that operates independently from the main CPU. Its main advantage is that it is powered and clocked by a power domain controlled seperately from the rest of the system. This allows it to continue operating even while the rest of the system is in deep sleep. For more information about power domains on the ESP32-C6 see the [TRM - Low-Power Management](https://www.espressif.com/sites/default/files/documentation/esp32-c6_technical_reference_manual_en.pdf#lowpowm).
38
+
The ULP is a coprocessor that operates independently from the main CPU. Its main advantage is that it is powered and clocked by a power domain controlled seperately from the rest of the system. This allows it to continue operating even while the rest of the system is in deep sleep. For more information about power domains on the ESP32-C6, see the [ESP32-C6 TRM](https://www.espressif.com/sites/default/files/documentation/esp32-c6_technical_reference_manual_en.pdf#lowpowm)→_Low-Power Management_.
39
39
40
40
This enables us to offload certain tasks to the ULP, such as sensor readings, while waking up the main CPU only when it is necessary for some more complex task.
41
41
42
-
Imagine this scenario: you're designing a smart plant-watering IoT device that measures soil humidity and waters the plant when needed. For a simple task like this, you could use the ULP to further reduce power consumption. While the rest of the system is powered down and sleeping, the ULP can periodically wake up, take measurements, as well as trigger watering action if necessary. Only when it is strictly necessary will the ULP wake up the main CPU and the rest of the system to perform actions that it cannot do--for example, to update the cloud with the latest device status over Wi-Fi.
42
+
Imagine this scenario: you're designing a smart plant-watering IoT device that measures soil humidity and waters the plant when needed. For a simple task like this, you could use the ULP to further reduce power consumption. While the rest of the system is powered down and sleeping, the ULP can periodically wake up, take measurements, as well as trigger watering action if necessary. Only when it is strictly necessary will the ULP wake up the main CPU and the rest of the system to perform actions that it cannot do --- for example, to update the cloud with the latest device status over Wi-Fi.
43
43
44
44
To summarize what the ULP is suitable for:
45
45
46
46
*:white_check_mark: Save power by performing simple tasks while the rest of the system sleeps
47
-
*:x: Help you achieve lower power-consumption during Wi-Fi or bluetooth connections
47
+
*:x: Help you achieve lower power-consumption during Wi-Fi or Bluetooth connections
48
48
*:white_check_mark: Assist main CPU by offloading simpler tasks
49
49
50
50
### Three generations of ULP coprocessor
51
51
52
-
As Espressif chips have evolved, so has the ULP. This article mainly focuses on the latest iteration of the ULP at the time of writing--the ESP32-C6's LP-Core. Some of the older chips had previous iterations. All in all, the ULP iterations are as follows:
52
+
As Espressif chips have evolved, so has the ULP. This article mainly focuses on the latest iteration of the ULP at the time of writing --- the ESP32-C6's LP-Core. Some of the older chips had previous iterations. All in all, the ULP iterations are as follows:
53
53
54
54

55
55
@@ -174,12 +174,12 @@ To explain a bit more what is happening:
174
174
175
175
[`ulp_lp_core_load_binary()`](https://docs.espressif.com/projects/esp-idf/en/v5.4/esp32c6/api-reference/system/ulp-lp-core.html#_CPPv423ulp_lp_core_load_binaryPK7uint8_t6size_t) copies the LP-Core binary from flash into LP-RAM, which is the memory area we have reserved for the LP-Core.
176
176
177
-
[`ulp_lp_core_run()`](https://docs.espressif.com/projects/esp-idf/en/v5.4/esp32c6/api-reference/system/ulp-lp-core.html#_CPPv415ulp_lp_core_runP17ulp_lp_core_cfg_t) then finally configures the LP-Core according to our config parameters. The [`wakeup_source`](https://docs.espressif.com/projects/esp-idf/en/v5.4/esp32c6/api-reference/system/ulp-lp-core.html#_CPPv4N17ulp_lp_core_cfg_t13wakeup_sourceE) is what will trigger the LP-Core to start running, in this case we choose the LP timer, which will make the LP-Core app be re-ran periodically. This is a common use-case when we want to monitor something with the LP-Core, but we don't want it to be active all the time in order to further reduce power consumption. For more information about other wake-up sources see [ulp-lp-core-program-flow](https://docs.espressif.com/projects/esp-idf/en/v5.4/esp32c6/api-reference/system/ulp-lp-core.html#ulp-lp-core-program-flow).
177
+
[`ulp_lp_core_run()`](https://docs.espressif.com/projects/esp-idf/en/v5.4/esp32c6/api-reference/system/ulp-lp-core.html#_CPPv415ulp_lp_core_runP17ulp_lp_core_cfg_t) then finally configures the LP-Core according to our config parameters. The [`wakeup_source`](https://docs.espressif.com/projects/esp-idf/en/v5.4/esp32c6/api-reference/system/ulp-lp-core.html#_CPPv4N17ulp_lp_core_cfg_t13wakeup_sourceE) is what will trigger the LP-Core to start running, in this case we choose the LP timer, which will make the LP-Core app be re-ran periodically. This is a common use-case when we want to monitor something with the LP-Core, but we don't want it to be active all the time in order to further reduce power consumption. For more information about other wake-up sources, see [ulp-lp-core-program-flow](https://docs.espressif.com/projects/esp-idf/en/v5.4/esp32c6/api-reference/system/ulp-lp-core.html#ulp-lp-core-program-flow).
178
178
179
179
The LP-Core now has everything it needs to run, if you selected a wake-up source which has an immediate effect (e.g. `ULP_LP_CORE_WAKEUP_SOURCE_HP_CPU`) then the LP-Core will already be running. In our example we choose the `LP_Timer` with a sleep duration of 1 second, so the first run of the LP-Core app will occur one second after calling [`ulp_lp_core_run()`](https://docs.espressif.com/projects/esp-idf/en/v5.4/esp32c6/api-reference/system/ulp-lp-core.html#_CPPv415ulp_lp_core_runP17ulp_lp_core_cfg_t).
180
180
181
181
182
-
### Interacting with the LP-Coe
182
+
### Interacting with the LP-Core
183
183
184
184
We now have an app running on the LP-Core, but since the app is just an empty `main()`, it doesn't do anything and we haven't seen any proof that it is actually running.
185
185
@@ -267,7 +267,7 @@ if (my_counter >= 5) {
267
267
}
268
268
```
269
269
270
-
Since we configured the LP timer to wake-up the LP-Core with a period of 1 sec, then this condition means that we will wake up the main processor on the 5th iteration, i.e., after 5 seconds.
270
+
Since we configured the LP timer to wakeup the LP-Core with a period of 1 sec, then this condition means that we will wake up the main processor on the 5th iteration, i.e., after 5 seconds.
271
271
272
272
If you now rebuild and re-flash your project, you'll see that the HP-CPU resets once every 5 second with the reset reason `rst:0x5 (SLEEP_WAKEUP)`.
0 commit comments