So basically i tried providing PWM directly to the IN1/IN2 Of L298n motor driver instead of using ENA pin i got more or less the same result Im using ESP32 with 30000Hz freq for my PWM My question is if both ways it can be used why aren't people using this method? Or am i missing something? I would love to know the reason if someone has any idea about it.

  • "why aren't people using this method?" It's not true, it's a widley used method.
    – Marco Cogo
    Commented Feb 17, 2022 at 19:29

1 Answer 1


When using only IN1/2 to control speed and direction, you must apply PWM to IN1 for one direction and to IN2 for the other direction, while the other pin will be connected to ground. This method is easy to implement with a MCU but uses two PWM channels.
I think the EN pin is used for applications without MCUs or where there is only one PWM channel. In these situations, pins IN1/2 are used for STOP/CW/CCW selection and EN for speed from a single PWM source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.