esp-idf/examples/system/ulp/ulp_riscv/ds18b20_onewire
Marius Vikhammer 9d41418bd2 fix(ulp): improve ULP examples for users using usb-jtag-serial
When using USB-serial-jtag for monitoring idf-monitor will lose connection
during deep sleep (because the peripheral powers down) and will need
some time to reconnect when we wake-up. In the ULP examples this would result in
the chip waking up->printing-> going back to sleep, before idf-monitor is even able
to connect, and users would erroneously assume the chip never woke up.

Add a 1 sec delay at the start of the examples to improve the user experience when
using jtag-serial.
2024-01-15 13:01:59 +08:00
..
main fix(ulp): improve ULP examples for users using usb-jtag-serial 2024-01-15 13:01:59 +08:00
CMakeLists.txt ulp/lp-core: added gpio API for lp core as well as an example showcasing it. 2023-05-29 11:13:47 +08:00
README.md ulp/lp-core: added gpio API for lp core as well as an example showcasing it. 2023-05-29 11:13:47 +08:00
sdkconfig.defaults ulp/lp-core: added gpio API for lp core as well as an example showcasing it. 2023-05-29 11:13:47 +08:00

Supported Targets ESP32-S2

ULP-RISC-V DS18B20 Temperature Sensor OneWire Communication

This example demonstrates how to program the ULP-RISC-V co-processor to read temperature from a DS18B20 temperature sensor over 1-Wire. When the measurement exceeds the limit set(32.5 degrees) the co-processor will wake up the main CPU from deep-sleep and the main CPU will print the temperature measurement.

Hardware Required

  • A development board with a SOC which has a RISC-V ULP coprocessor (e.g., ESP32-S2 Saola)
  • A USB cable for power supply and programming
  • A DS18B20 temperature sensor

Example connection :

ESP Dev-kit DS18B20
GPIO4 DQ
VCC 3.3V VDD
GND GND

Example output

Not a ULP wakeup, initializing it!
Entering in deep sleep

...

ULP-RISC-V woke up the main CPU, temperature is above set limit!
ULP-RISC-V read temperature is 32.562500
Entering in deep sleep

...

ULP-RISC-V woke up the main CPU, temperature is above set limit!
ULP-RISC-V read temperature is 33.000000
Entering in deep sleep