I'm trying here is to let the real-time units of the BeagleBone generate the signals for a stepper motor. In this post: assign BB peripherals and wire up the stepper motor driver. |
The DRV8711 stepper motor controllerDRV8711 stepper motor controller has a number of pins that need to be entertained by the BB.
(for the wiring of motor and power supply, please check this post).
The controller requires a SPI connection, in order to set it in the desired operation mode. These SPI pins are connect to BB SPI0.
Two signals are required to control steps, speed and direction. These are coming from the BB PRU.
Two more pins are required to reset the controller and put it to sleep.
I haven't implemented the feedback pins that the driver uses to indicate it's in an error state.
stepper motor driver DRV8711 | beaglebone |
image source: element14 | image source: edited from Embedded Basics: BeagleBone Black: Enabling SPI0 |
All of the pins that control the stepper motor are wired up.
I haven't connected the Stall and Fault error signals. Maybe later ...
BB MUX | BB P9 | Patch wire | Driver function | Driver pin | LA |
---|---|---|---|---|---|
GPIO_30 | 11 | orange | nSleep | J1.6 | 5 |
GPIO_31 | 13 | white | Reset | J1.8 | 4 |
Stall | J2.2 | ||||
Fault | J2.3 | ||||
SPI_CS | 17 | white | SCS | J2.10 | 0 |
SPI_D1 (MOSI) | 18 | blue | SDI | J2.6 | 2 |
SPI_DO(MISO) | 21 | green | SDO | J2.7 | 3 |
SPI_SCLK | 22 | orange | SCLK | J1.7 | 1 |
PRU_GPO0 | 31 | blue | DIR/AIN2 | J1.10 | 6 |
PRU_GPO1 | 29 | green | STEP/AIN1 | J1.9 | 7 |
VDD_3V3 | 1 | red | 3.3V | J1.1 | |
DGND | 45 | black | GND | J2.1 |
All but the GPIO and power pins have to be multiplexed in some way. I've written specific posts on muxing PRU and SPI pins.
This is also a good time to switch from oscilloscope to logic analyser.
By now I know that the signals can be generated (easy to check on the oscilloscope) and I can focus on order of signals, data sent and protocols (easier on a logic analyser).
The top four channels show the SPI communication. The lower four are the GPIO and PRU signals going to the stepper motor driver.
With this setup, I'm ready to start developing a working example that actually rotates the stepper motor. It's about time ...
Top Comments