DRV8818: Problem with the DRV8818

Part Number: DRV8818

Tool/software:

Hello,

I’m trying to drive a bipolar stepper motor with a DRV8818 using STEP/DIR from an ESP32-C6-DevKitC-1. I’ve attached my schematic and can also share the minimal firmware if useful.

Setup

  • MCU / FW: ESP32-C6-DevKitC-1, PlatformIO (Espressif32 6.8.1), ESP-IDF 5.3.0, 3.3 V logic

  • Driver: TI DRV8818

  • VM (motor supply): 24V

  • Sense resistors: 0.10 Ω (per phase)

  • VREF measured: ~2.0 V → I_trip calc ≈ Vref / (8·Rsense) = 2.0 V / (8·0.10 Ω) ≈ 2.5 A

  • Decay: Mixed

  • Microstepping: USM0/USM1 both fixed to GND -> fullstep.

  • Control pins (default states):

    • ENABLEn: LOW (driver enabled)

    • SLEEPn: HIGH (awake)

    • RESETn: HIGH (held high)

    • STEP/DIR: from GPIO 18 and 19




Code:

#include <stdint.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "esp_rom_sys.h" // esp_rom_delay_us()

#define PIN_STEP 18
#define PIN_DIR 19

static inline void step_pulses(int steps, uint32_t half_period_us) {
for (int i = 0; i < steps; ++i) {
gpio_set_level(PIN_STEP, 1);
esp_rom_delay_us(half_period_us);
gpio_set_level(PIN_STEP, 0);
esp_rom_delay_us(half_period_us);
}
}

void app_main(void) {
// STEP & DIR als Outputs
gpio_config_t io = {
.pin_bit_mask = (1ULL << PIN_STEP) | (1ULL << PIN_DIR),
.mode = GPIO_MODE_OUTPUT,
.pull_up_en = 0,
.pull_down_en = 0,
.intr_type = GPIO_INTR_DISABLE
};
gpio_config(&io);

while (1) {
// Richtung 1
gpio_set_level(PIN_DIR, 1);
step_pulses(200, 5000); // 100 Hz: 5 ms High + 5 ms Low pro Schritt
vTaskDelay(pdMS_TO_TICKS(500));

// Richtung 2
gpio_set_level(PIN_DIR, 0);
step_pulses(200, 5000); // wieder 100 Hz
vTaskDelay(pdMS_TO_TICKS(800));
}
}

  • Hi Tom, 

    Thank you for reaching out to us. 

    The schematic appears correct. Could you please describe the issue you're experiencing with the DRV8818?

    For reference, you can find helpful hardware design and firmware examples on the DRV8818EVM – they're available at

    DRV8818EVM Evaluation board | TI.com

    Best regards, 

    Mojtaba

  • Hi Mojtaba,

    I used the DRV8818EVM as a reference for my design, but I can’t get the stepper motor to rotate—the motor only makes an unusual buzzing noise. I’m not sure what I’m missing.

    Could you share a minimal code example (e.g., Arduino/C with register/settings) that reliably drives a stepper with the DRV8818, so I can cross-check my setup?

    Thanks,
    Tom


  • Hi Tom, 

    I used the DRV8818EVM as a reference for my design, but I can’t get the stepper motor to rotate—the motor only makes an unusual buzzing noise. I’m not sure what I’m missing.

    If you are hearing buzzing noise, it seems that the output voltage is generated.

    What is the motor spec? Resistor, inductance, current?

    Can you capture the input step pulse, and output voltages?

    can you check that power supply can provide enough current as well?

    Could you share a minimal code example (e.g., Arduino/C with register/settings) that reliably drives a stepper with the DRV8818, so I can cross-check my setup?

     We do not have codes for Arduino, however, you can download the FIRMWARE code MSP430 microprocessor from following link. 

    DRV8818EVM Evaluation board | TI.com

    Best regards, 

    Mojtaba