Reducing 2 pins to 1 with a signal inverter?

Thread Starter

Graylord

Joined Jan 19, 2018
4
I'm currently building all of my motor driving circuits from scratch, and have been looking for ways to optimize the amount of pins used from my MCU (since i use a fair bit of motors) and fell in love with this driver circuit due to it only needing 2 pins:

However, as I started putting it together, I realized; What would happen if I add a signal inverter to the green input line, and ran both A and B from the same PWM output?
Say I send a high signal with a PWM of maybe 90%, it goes straight to the A input to define speed and as on.
It gets inverted for input B as a low signal, so it goes forwards.
If I wanted to reverse, I just send a inverted PWM signal (which as far as I understand would be reacted to as a low input?), that way I still get to control the speed (and the * indicates it's expected to be opposite for reverse anyway), it counts as a high for the direction signal.

Any issues I might not be aware of? Would varying PWM signals mess with turning B on and off? Especially of low speeds?
I'm guessing I will probably lose breaking, unless I just add another line with a single pin with a high signal to both inputs. I can live with that.
 

Dodgydave

Joined Jun 22, 2012
11,395
Pin 4 the Direction is either permanent Low for forward, or High for reverse, you can't put an AC signal on it as the motor will try to change direction at the same time.
 

crutschow

Joined Mar 14, 2008
38,322
As Dd noted, if you put the same, but inverted signal on the green line, then the motor will try to reverse directions on each PWM cycle.
When the PWM voltage is high it will try to go one direction, and when the PWM voltage is low it will try to go the other direction, and that's not something you want.
 
Top