The strange thing is, if I use pin 32 it works perfectly, but if I switch to pin 12 it doesn't work. It seems like the drive strength isn't high enough, but looking at the data sheet it seems like those pins have the same default drive strength. They are in different power domains, but I'm not really sure why that would affect things. I'm using the ESP32-WROOM-32D Dev Kit v4. Here's the code:
Code: Select all
// Connect the A output to a pin.
ret = mcpwm_gpio_init(MCPWM_UNIT_0, MCPWM0A, PIN_STEP);
ESP_ERROR_CHECK(ret);
mcpwm_config_t pwmConfig = {};
// Default frequency in Hertz.
pwmConfig.frequency = 1000;
// Duty cycle of both outputs.
pwmConfig.cmpr_a = 50.0f;
pwmConfig.cmpr_b = 50.0f;
// The counter counts up, and then resets to 0.
pwmConfig.counter_mode = MCPWM_UP_COUNTER;
// This enables the output.
pwmConfig.duty_mode = MCPWM_DUTY_MODE_0;
ret = mcpwm_init(MCPWM_UNIT_0, MCPWM_TIMER_0, &pwmConfig);
ESP_ERROR_CHECK(ret);
Does anyone know why there is a difference in drive strength between these pins?