Re: h-bridge,
Hi,
In first place, try controll the chip directly, without MCU, only connect Breke pin to GND, PWM pin to + and switch direction between ground and +, but power supply must be below 12 V, this is a maximum for logic 1. If the motor change direction then problem is in your MCU level.
If your DC mottor have a stator, then is very possible that this is the problem, when you have stator and rotor, always you will have only one spin direction, if you want to change must change stator OR rotor polarity. But you can use multimeter to see the change of polarity or two parallel LED with different direction.