Getting Started

Getting Started with Waveu #

Welcome to Waveu! This guide will help you set up and run Waveu on your ESP32, allowing you to generate and visualize waveforms easily. Whether you’re a beginner or an experienced developer, you’ll find step-by-step instructions to get started quickly. By the end of this guide, you’ll be able to generate a sawtooth wave and visualize it on your oscilloscope, as shown in the figure below!

Figure: Sawtooth wave with a frequency of 200 Hz displayed on both channels: CH0 (top) and CH1 (bottom), generated as a result of completing this Getting Started guide.

Figure: Sawtooth wave with a frequency of 200 Hz displayed on both channels: CH0 (top) and CH1 (bottom), generated as a result of completing this Getting Started guide.


1. Short Description #

Compile & Run on ESP32 #

Run on ESP32

Waveu’s example code on GitHub can be compiled and run on your ESP32. Simply connect the DAC pin to an oscilloscope, and you’re ready to generate diverse waveforms!


2. Step by Step Guide #

Waveu simplifies waveform generation with ESP32 by offering pre-configured examples. This guide will walk you through everything from setting up your hardware and software to visualizing waveforms on an oscilloscope. Even if you’re new to ESP32 or ESP-IDF, don’t worry—we’ve got you covered!

2.1 Hardware Requirements #

To use Waveu, you’ll need:

  • ESP32 development board (for running software)
  • PC and USB cable (for programming)
  • Oscilloscope (to visualize waveform output)

2.2 Prerequisites on Software #

Before diving into Waveu, ensure you have:

  1. Git installed
    Install git, following the Downloads link at the git homepage.

  2. ESP-IDF setup
    Install the ESP-IDF version 5.4 or later.

  3. Familiarity with DAC examples We recommend reviewing the ESP-IDF example: DAC Continuous Signal Generator.


– New to ESP-IDF? – #

If you’re new to ESP-IDF, here are some key concepts to help you get started:

  1. What is ESP-IDF? ESP-IDF (Espressif IoT Development Framework) is an official development framework for ESP32, offering tools, libraries, and examples to program the chip. Think of it as the foundation for writing, building, and deploying your applications.

  2. Why Use ESP-IDF? While Arduino IDE is simpler, ESP-IDF offers advanced features, better debugging tools, and fine-grained control of hardware components, making it ideal for more complex projects like Waveu.

  3. Using VSCode with ESP-IDF For beginners, using the ESP-IDF extension in VSCode can simplify navigation, code editing, and flashing your ESP32. The extension integrates the ESP-IDF tools directly into VSCode.

  4. Installing ESP-IDF Follow Espressif’s guide to set up ESP-IDF. Installation includes setting up the toolchain, build tools, and ESP-IDF itself. Don’t worry—it’s well-documented, and you’ll only need to do it once.

  5. What is menuconfig? menuconfig is a configuration tool for setting up project-specific options, such as selecting hardware peripherals and tuning parameters. When you run idf.py menuconfig, you’ll see a terminal-based menu interface where you can configure Waveu options.

  6. Common Commands

    • idf.py build: Compiles your project.
    • idf.py flash: Uploads the compiled firmware to your ESP32.
    • idf.py monitor: Opens a serial monitor to view logs from the ESP32.

2.3 Build, Flash & Visualize on Oscilloscope #

  1. Clone the repository:

    git clone https://github.com/tinyalg/waveu.git
    
  2. Change to this directory:

    cd waveu/examples/sawtooth
    

    Alternatively, open this directory in VSCode with the ESP-IDF extension for easier navigation and editing.

  3. Run menuconfig:

    In VSCode, open the ESP-IDF Terminal.

    idf.py menuconfig
    

    In menuconfig, configure the following settings under [Component config > Waveu Configuration]:

    • Select active DAC channels:
      • CH0 and CH1: Output to both channels.
      • CH0 only: Output to DAC Channel 0.
      • CH1 only: Output to DAC Channel 1.
  4. Flash the example:

    idf.py build flash
    
  5. Monitor the output:

    idf.py monitor
    

    You should observe messages in the console confirming the start of waveform generation.

    I (291) UserWaveConfig: Frequency=200.00
    I (291) Waveu-ESP32Config: waveformDataOutputTask to on core 0 at priority 10.
    I (291) Waveu: LEN_DATA_BUFFER=16000, SAMPLE_RATE=1000000, TIMER_PERIOD=16000
    I (301) Waveu: Started waveformDataGenerationTask on core 1 at priority 5.
    
  6. Connect your oscilloscope: Attach the oscilloscope to the DAC output channel as configured in menuconfig.


– Troubleshooting – #

Even with proper setup, you might encounter some issues. Here are common problems and their solutions:

  1. ESP32 not detected by your computer

    • Solution: Ensure the USB cable supports data transfer (some cables are power-only). Try reconnecting or using a different USB port. Verify drivers are installed for your ESP32 board.
  2. idf.py command not recognized

    • Cause: ESP-IDF environment variables might not be set up.
    • Solution: Re-run the ESP-IDF setup script for your OS:
      • On Windows: Run install.bat and then export.bat.
      • On Linux/macOS: Source the export.sh script in your terminal.
  3. Compilation errors

    • Cause: Missing or incompatible ESP-IDF version.
    • Solution: Ensure you’re using ESP-IDF 5.4 or later and update if necessary.
  4. Flashing issues

    • Cause: Incorrect port or permissions.
    • Solution: Use idf.py flash -p <your_port> to specify the correct port. On Linux/macOS, ensure your user has permission to access the port (e.g., add your user to the dialout group).
  5. No waveform visible on oscilloscope

    • Cause: Incorrect DAC channel configuration or wiring.
    • Solution: Double-check your menuconfig settings for active DAC channels and ensure the correct pins are connected to your oscilloscope.
  6. Garbage output on serial monitor

    • Cause: Incorrect baud rate.
    • Solution: Confirm that the monitor’s baud rate matches the project’s settings in menuconfig (default is 115200).
© 2024-2025 Tinyalg Systems. See Licenses.