Hi, I am building a motor shield using an L293D for my sons robot. I want to use PWM to drive the H-bridge and use a standard logic pin to determine the direction the motor turns. To do this, I need to route the PWM signal to one or the other control pins for the bridge and I have come up with using a pair of AND gates and a NOT gate. I am probably 75% sure that this logic would work and have sketched out a small circuit to achieve this. I am less sure about my circuit itself, so I was hoping I could get some constructive feedback please.
The PWM signal is fed into 2 AND gates. The direction signal is fed into one of the AND gates directly, whereas it is inverted before feeding into the other and gate. The AND gates then output the PWM signal dependant on the direction signal. Does this sound correct?
The attached schematic shows how I intend to wire up the logic gates using BC546 transistors. Q1 is an inverter with a pull up resistor. Q2 and Q3 are paired up as an AND gate with a pull down resistor, along with Q4 and Q5. I am not sure if R9 is necessary or wise as R3 already limits the current to Q5’s base.
If this is feasible and not fatally flawed I will duplicate the logic for the second H bridge.