SolidWorksMagi
Senior Member
Hi,
My motor runs fine plugged directly into the 5V power source, but the motor doesn't run connected to the SparkFun TB6612FNG Motor Driver board.
I've tried this with and without the STBY connected to a PICAXE PIN ... trying to run it high and low.
Here is my program so far ... as you can see it is talking to me as it moves through the program so I know exactly what should be happening at each event.
I've double checked the wiring a couple of times now and disconnected the STBY jumper wire for the last failing tests.
The only connections on the SparkFun TB6612FNG Motor Driver board not being used are the three BO2, B0! and GND on that half of the board and GND on the other half of the board.
In the program you can see the commented out high PWMA etc... as I did try that too.
I am planning to run two motors later once I have a good working setup so the B motor wiring is in place from the PICAXE 28X2 module.
My motor runs fine plugged directly into the 5V power source, but the motor doesn't run connected to the SparkFun TB6612FNG Motor Driver board.
I've tried this with and without the STBY connected to a PICAXE PIN ... trying to run it high and low.
Here is my program so far ... as you can see it is talking to me as it moves through the program so I know exactly what should be happening at each event.
Code:
#picaxe 28X2 ; Define the µProcessor a PICAXE 28X2 module
symbol PWMA = B.0 ; Right Motor Speed Control
symbol PWMB = B.1 ; Left Motor Speed Control
symbol AIN1 = A.0 ; Forward Direction Control
symbol AIN2 = A.1 ; Reverse Direction Control
symbol BIN1 = A.2 ; Forward Direction Control
symbol BIN2 = A.3 ; Reverse Direction Control
symbol STBY = B.3 ; HIGH Allows the H-Bridge to Operate
; w/a 1K? Ohm PullDown Resistor
symbol BLED = B.5 ; Red LED
symbol GLED = B.6 ; Green LED
symbol RLED = B.7 ; Blue LED
init: servo PWMA,50
servo PWMB,50
; hserout PIN 11 = C.6
hsersetup B9600_8, %00000 ; 9600 baud, non-inverted polarity
symbol i = b0
; BEGIN Main Body * * * * * * * * * * * * * * *
;high AIN1
;low AIN2
;high BIN1
;low BIN2
;pulsout PWMA, 500
;pulsout PWMB, 500
do
; Testing Motor A Forward
; Testing , Motor , A , Forward
hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 191, 131, 8, 187, 191, 129, 143, 2, 140, 137, 191, 7, 151, 2, 154, 128, 2, 186, 7, 153, 7, 147, 151, 176)
;high STBY
high AIN1
low AIN2
; high PWMA
pause 5000
for i = 0 to 50
servopos PWMA, 150
pause 20
next i
; Testing Motor A Reverse
; Testing , Motor , A , \RR \IY \VV \RR \Slow \Slow \SE
hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 191, 131, 8, 187, 191, 129, 143, 2, 140, 137, 191, 7, 151, 2, 154, 128, 2, 148, 128, 166, 148, 8, 8, 187)
;high STBY
low AIN1
high AIN2
; high PWMA
for i = 0 to 50
servopos PWMA, 150
pause 20
next i
pause 5000
; Testing Motor B Forward
; Testing , Motor , B , Forward
hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 191, 131, 8, 187, 191, 129, 143, 2, 140, 137, 191, 7, 151, 2, 170, 128, 128, 2, 186, 7, 153, 7, 147, 151, 176)
;high STBY
high BIN1
low BIN2
; high PWMB
for i = 0 to 50
servopos PWMB, 150
pause 20
next i
pause 5000
; Testing Motor B Reverse
; Testing , Motor , B , \RR \IY \VV \RR \Slow \Slow \SE
hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 191, 131, 8, 187, 191, 129, 143, 2, 140, 137, 191, 7, 151, 2, 170, 128, 128, 2, 148, 128, 166, 148, 8, 8, 187)
;high STBY
high AIN1
low AIN2
; high PWMB
for i = 0 to 50
servopos PWMB, 150
pause 20
next i
pause 5000
loop
; END Main Body * * * * * * * * * * * * * * * *
end
The logic table for the Motor Driver Board;
; In1 In2 PWM Out1 Out2 Mode
; H H H/L L L Short brake
; L H H L H CCW
; L H L L L Short brake
; H L H H L CW
; H L L L L Short brake
; L L H OFF OFF Stop
I even got this help from another post that say's this setup works ... but it's not working for me.
;high AIN1
;low AIN2
;high BIN1
;low BIN2
;pulsout PWMA, 500
;pulsout PWMB, 500
The only connections on the SparkFun TB6612FNG Motor Driver board not being used are the three BO2, B0! and GND on that half of the board and GND on the other half of the board.
In the program you can see the commented out high PWMA etc... as I did try that too.
I am planning to run two motors later once I have a good working setup so the B motor wiring is in place from the PICAXE 28X2 module.
Last edited by a moderator: