I’m working on a project which uses two Pololu motors (the 210:1 micro metal gear motors) and the DRV8833. I’m using PWM to control their speed and both motors must run at the same speed (or as near as I can make it). I do need to be able to control their directions independently, but can I use one PIC output pin (sending the PWM) to connect to AIN1 & BIN1 (i.e. 1 PWM output from a PIC microcontroller to both inputs on the DRV8833)? Or must I use separate PIC pin outputs (and hence separate PWM commands)?
Connecting a PWM to both inputs would make the driver oscillate from braking high to braking low. You need to use separate I/O but they don’t necessarily all have to be PWM outputs. There are ways to limit the PWM pins required if you are clever and don’t care if you are breaking high or low. Take a look at the truth table in the datasheet to see how the inputs work. You could also add some external logic, like we do on the Pololu dual MC33926 motor driver shield for Arduino.