Hello - I am trying to write a simple program to run a stepper motor back and forth using the Pololu DRV8711 driver (Link: https://www.pololu.com/product/3730). In order to use the driver, you must first enable it and then you can use the DIR and Step Pins to run your stepper. With other drivers, all you needed to do was drive the ENABLE pin high and you were good to go. With the 8711 board, you have to enable it via SPI. This is done by sending 16-bit values to the registers on the board. Page 27 of the data sheet for this (Link: https://www.ti.com/lit/ds/symlink/drv8711.pdf) shows the registers and gives the default values. Technically, all I should have to do is to set bit 0 of the CTRL register to 1 and that should enable the motor, correct? I also want to limit the current to 1/2 of it's maximum value of 4A. This is done using the lower 8 bits of the TORQUE register. Here is my routine to do that:
Code:
'****************************************************************
InitStepper1:
'Set current to 1/2 max (2A)
'$1180 = %0001000110000000
high M1SCS
Shiftout m1SDAT, M1SCLK, 1, [$1180/16]
low M1SCS
pause 50
'Enable Motor
'$0C11 = %0000110000010001
high M1SCS
Shiftout m1SDAT, M1SCLK, 1, [$0C11/16]
low M1SCS
return
'****************************************************************
I am leaving all of the other values at their default. After executing the InitStepper1 code, I go to stepping the motor by pulsing the STEP pin and nothing happens. My stepper spins freely and I get no indication from my power supply that there is any additional current draw. Is there something I am not doing or doing wrong? Thanks! Jeff
Bookmarks