e4ac072ea9
* IDF 5.3 support * IDF 5.3 * IDF 5.3 toolchains remove dynamic toolchains support, currently only older incompatible are possible to fetch. * Fix owner of * ULP compability for IDF 5.3 * remove debug print * Fix bootloader offset code retrieve * Update esp32-c6-devkitc-1.json * use espressif Arduino branch `release/v3.1.x` * Update README.md * Update README.md * Fix compile issue with managed components * use latest Arduino 3.1.0 libs * fetch Arduino libs dl URL from manifest json * fetch Arduino libs dl URL from manifest json * Update README.md * Fix IDF 5.3 ULP compile * Use espressif Arduino branch release/v3.1.x * Update platform.py * better handling of complex Macros from cmake model * IDF 5.3.1 release * fix handling of cc fragments * unchanged IDF 5.3.1 * ULP has now a cmake build script * add arduino/idf examples * fix used platform * prepare LP ULP support * enable bootloader components build * ULP LP support * add missing P4 * add P4 * change some if checks * Update README.md * remove wrong left over code * add ULP LP example / update Matter example * fix path * add zigbee examples * disable zigbee examples needs merge of the open zigbee Arduino PR * esptool.py v4.8.0 * add cmake_utilities for C2 * add auto select "espidf" when pio var "custom_sdkconfig" is set * IDF v5.3.1.240924 * Update main.py * matter example currently broken * Update platformio.ini * Update platformio.ini * Update platformio.ini * Update platformio.ini * Update examples.yml * IDF v5.3.1.241016 * Update Zigbee_On_Off_Light.ino * Update Zigbee_On_Off_Switch.ino * Update examples.yml * Update platformio.ini * Update platformio.ini * Update examples.yml * esptool.py v4.8.1.1 s2 s3 usb jtag reset fix * Update platform.py * Update gdb 14.2.0+20240403 * fix owner for gdb * Update IDF v5.3.1.241024 * Update adafruit_matrixportal_esp32s3.json * Use compatible h2zero NimBLE git commit * Update Zigbee_On_Off_Light.ino * Update Zigbee_On_Off_Switch.ino * fix custom partiton table offset calculation * Update README.md * Create esp32-p4.json * add P4 to blink example * Update Zigbee_On_Off_Switch.ino * Update Zigbee_On_Off_Light.ino * Update sdkconfig.defaults * add P4 to LP example * Create esp32-p4-evboard.json * IDF 5.3.2 release * prep for "pioarduino-build.py" script * add missing import os * fix not defined var * Update Zigbee_On_Off_Switch.ino * esptool.py v4.8.5 * Update Zigbee_On_Off_Light.ino * add Hybrid Compile (#73) * Update README.md * set Arduino compile option `UPDATE_NOCRYPT` in example Tasmota * Update C2 Hybrid compile skeleton * Update IDF v5.3.2.241210 * Revert to IDF 5.3.2 * Update pioarduino IDF 5.2 * Update release_zips.yml
52 lines
2.4 KiB
Markdown
52 lines
2.4 KiB
Markdown
| Supported Targets | ESP32-C6 |
|
|
| ----------------- | -------- |
|
|
|
|
This example demonstrates how to program the ULP Core coprocessor to count pulses on an IO while the main CPUs are either running some other code or are in deep sleep. See the README.md file in the upper level 'examples' directory for more information about examples.
|
|
|
|
At runtime, the main code running on the ESP (found in lp_core_pulse_counter_example_main.c) loads ULP program into the `RTC_SLOW_MEM` memory region using `ulp_lp_core_load_binary` function. Main code configures the ULP program by setting up values of some variables and then starts it using `ulp_lp_core_run`. Once the ULP program is started, it monitors the IO pin for pulses.
|
|
|
|
When the ULP program finds an edge in the input signal, it performs debouncing and increments the variable maintaining the total edge count. Once the edge count reaches certain value, ULP triggers wake up from deep sleep. Note that the ULP program keeps running and monitoring the input signal even when the SoC is woken up.
|
|
|
|
### Hardware Required
|
|
|
|
To run this example, you should have a development board based on any of the chips listed in the supported targets table at the top and a host machine with a serial input connection.
|
|
|
|
#### Pin Assignment:
|
|
|
|
**Note:** The following pin assignments are used by default.
|
|
|
|
|
|
| | Uart Tx | Pulse Count Input |
|
|
| ----------------------- | ------- | ----------------- |
|
|
| ESP32-C6 | GPIO5 | GPIO6 |
|
|
| Host machine | Rx | N/A |
|
|
|
|
|
|
## Example Output
|
|
|
|
The log output from the serial monitor connected to the main core should indicate that the LP core and the LP UART peripheral have been successfully initialized. The main CPU would then enter deep sleep mode.
|
|
|
|
```bash
|
|
Using pin 6 as pulse counter input
|
|
ULP will wake up processor after every 10 pulses
|
|
Not a ULP wakeup, initializing it!
|
|
Entering in deep sleep
|
|
...
|
|
rst:0x5 (SLEEP_WAKEUP),boot:0xc (SPI_FAST_FLASH_BOOT)
|
|
...
|
|
ULP woke up the main CPU!
|
|
Pulse count: 11
|
|
Entering in deep sleep
|
|
```
|
|
|
|
The log output from the serial monitor connected to the LP core should display output as below -
|
|
|
|
```bash
|
|
LP Core pulse counter started
|
|
Pulse count: 10, wake-up main CPU
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
(For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you as soon as possible.)
|