I have 2 DC Motors connected to DVR8835.
I am using PHASE/ENABLE Mode, so MODE pin is HIGH.
The motors will always run at common speed, so the port from arduino that produces the PWM is common to both Aenable and Benable.
The phase (direction) of motors is controlled from Aphase pins and Bphase pins from arduino.
PWM seems to be working good. I have tried different output compare values (that alter pwm speed etc) and the speed changes accordingly.
However here is the strange fact:
Say for example I want to run my vehicle forwards at a certain speed with this pseudocode:
aphase_pin = 1
bphase_pin = 1
PWM = X //connected to Aenable and Benable
The vehicle at this point will continue to move accordingly, however if I want to change it’s direction
Then only one motor will obey.
The strange fact is that if I run FROM THE BEGINNING this:
PWM = x
The motors will behave good but then again if I want to change the direction
They won’t behave accordingly.
So to sum up, If I “initialize” the phase pins at a certain direction, then the motors will obey and will move to that particular direction, however if I want to change the direction then they won’t obey!