There you go. A dragon of a title - just because I can.
I'm trying to control an unknown stepper motor with the high-end timer (NHET) module of a Texas Instruments Hercules microcontroller I got a freebee from TI almost a year ago. An unknown stepper motor, a driver board and a Hercules RM57 LaunchPad. The code to run the motor was expected to arrive too (it was an assignment for an internal) but that never materialised. In this blog series I'm trying to program the NHET module so that it sends the right signals to make the stepper step.
In the fifth post I check what peripherals should be used to drive the DRV8711 from the Hercules RM57 safety microcontroller.. |
Matching the Hercules Controller with the DRV8711 Stepper Driver
I'm using a LaunchPad and a BoosterPack.
That's a double-edged sword. I don't have to make PCBs - but on the other hand I'm dependent on the TI boards for matching pins (always a bet when combining LaunchPads and BoosterPacks).
The DRV8711 BoosterPack is the driver for requirements. We need to be able to drive or read all of its pins.
I know the exercise has to be possible because someone at TI showed me a video of this combination ramping up a stepper motor.
So if at the end of the blog series this doesn't work, it's me.
Side note to self: this (found when writing the blog ) Pulse Train Output application note from TI may contain most of the PWM code.
If that's true, it may be an unexpected windfall.
I was afraid to start programming the NHET subcontroller with the HET assembly language. It's been my weak point since as long as I work with the Hercules family.
I haven't checked the document in detail but it looks promising ...
... continuing with the:
DRV8711 BoosterPack pins
The critical ones are the SPI pins (SCLK, SDI, SDO, SCS) and the PWM pin (STEP/AIN1).
The green pins and DIR/AIN2 can be handled with any pin that's GIO capable.
3V3 and GND are standard, not to worry.
I don't need the potentiometer input and the BIN pins.
Hercules RM57 LaunchPad pins
Good news. A match for many. This is not that common with Hercules Launchpads. They defer often from the BoosterPack layout (deliberately not using the word standard here).
The match table below shows where I am confident and where more investigation is necessary.
BoosterPack | Function | Requirements for Hercules | Header 4 |
---|---|---|---|
3.3V | |||
nSLEEP | tell driver to sleep (no current to the stepper coils) | GIO out | AD1[17] or AD2[0] |
SCLK | SPI clock | SPI clock | MIBSPI3CLK |
RESET | reset driver | GIO out | GIOA[6] |
STEP/AIN1 | PWM input | HET / PWM out | NHET1[4] |
DIR/AIN2 | motor direction | GIO out | NHET1[9] |
GND | |||
nSTALL | is the motor stalled? | GIO in | NHET1[22] |
nFAULT | is the driver in error state? | GIO in | NHET1[[25] or MIBSPI3NCS[1] |
SDI | SPI Slave in Master out | SPI MOSI | MIBSPI3SIMO |
SDO | SPI Slave out Master in | SPI MISO | MIBSPI6SOMI |
SCS | SPI chip select (active high !) | SPI CS | GIOB[2] |
My main worry is the nSLEEP pin. I'll have to read the doco to see if I can render an analog input into a digital output.
I don't understand why this particular pin is used on the BoosterPack for a signal that has to be driven by the microcontroller.
On the BoosterPack standard, this is reserved for analog in signals. The pin above that is a generic IO pin. And its free. Why?