Motor Controller PWM PIN drive strength differences

Posts: 2
Joined: Wed Jun 05, 2019 12:54 pm

Motor Controller PWM PIN drive strength differences

Postby Timmmm » Wed Jun 05, 2019 1:03 pm

I'm using the MCPWM (Motor Controller PWM) peripheral to drive the "step" pin on a stepper motor driver. The driver (Leadshine DM320C) has optoisolator inputs, so the ESP32 pin is basically connect to an LED via a resistor. The high pin of the LED is connected to 3.3V and the low pin is connected to the ESP32 pin, so it is turns it on by pulling the pin low.

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);

	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);
The only thing I change is `PIN_STEP` which is either 12 or 32.

Does anyone know why there is a difference in drive strength between these pins?

Who is online

Users browsing this forum: No registered users and 11 guests