element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Industrial Automation
  • Technologies
  • More
Industrial Automation
Blog Stepper Motor Control with Hercules High-End Timer - Part 3: SPI Commands and Pulse Control
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Industrial Automation to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 4 Jun 2017 11:30 AM Date Created
  • Views 744 views
  • Likes 1 like
  • Comments 1 comment
  • stepper_motor
  • boosterpack
  • drv8711
  • msp430
  • launchpad
Related
Recommended

Stepper Motor Control with Hercules High-End Timer - Part 3: SPI Commands and Pulse Control

Jan Cumps
Jan Cumps
4 Jun 2017

I'm trying to control an unknown stepper motor with the high-end timer (NHET) module of a Texas Instruments Hercules microcontroller

image

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 this third post I snoop SPI traffic between MSP430 microcontroller and the stepper motor controller. The PWM signals are for the fourth blog.

 

 

Snooping Traffic

 

There are two types of commands flying towards the DRV8711 Stepper Motor Controller: Setup commands and Step commands.

The Setup ones configure the modules in the stepper motor driver and use SPI as protocol.

The Step commands (handled in the next blog) are just pulses, where each pulse tells the driver to give the motor a kick. The result of that is depending of the driver setup

 

Setup Commands

The DRV8711 is a microcontroller on its own, with a few registers that you can set and read with SPI.

You can configure the internal modules such as the current control network, microstepping indexer, decay and blanking blocks, ...

The image below is a capture of setting the driver using the TI demo application for this motor.

 

image

You see 8 blocks of commands, each writing to a particular register. The register map from the DRV8711 datasheet shows what each of the controls:

image

The GUI of the demo app gives an easier view - and you can change and read them directly from the app.

image

The SPI capture from my protocol analyser shows the result of shooting the following init settings:

image

Full output of the analyser (ignore the MISO columns, there's only traffic from MSP430 to DRV8711 in this scenario):

 

 

SPI Analysis results


Generated: 3 juni 2017
Configuration
SPI modeMode 0 (CPOL = 0, CPHA = 0)
MOSIMISO
IndexTimeHexBinDecASCIIHexBinDecASCII
0-1,66 μsCS_LOWCS_LOW
120,00 ns0x0f190b000011110001100138650xffff0b111111111111111165535
39,92 μsCS_LOWCS_LOW
412,24 μsCS_HIGHCS_HIGH
513,68 μs0x10ba0b000100001011101042820xffff0b111111111111111165535
723,82 μsCS_LOWCS_LOW
826,14 μsCS_HIGHCS_HIGH
927,82 μs0x20300b001000000011000082400xffff0b111111111111111165535
1137,70 μsCS_LOWCS_LOW
1240,04 μsCS_HIGHCS_HIGH
1341,46 μs0x31080b0011000100001000125520xffff0b111111111111111165535
1551,60 μsCS_LOWCS_LOW
1653,94 μsCS_HIGHCS_HIGH
1755,62 μs0x43100b0100001100010000171680xffff0b111111111111111165535
1965,50 μsCS_LOWCS_LOW
2067,46 μsCS_HIGHCS_HIGH
2168,76 μs0x5f400b0101111101000000243840xffff0b111111111111111165535
2378,64 μsCS_LOWCS_LOW
2481,54 μsCS_HIGHCS_HIGH
2582,90 μs0x60550b0110000001010101246610xffff0b111111111111111165535
2792,72 μsCS_LOWCS_LOW
2896,64 μsCS_HIGHCS_HIGH
2998,06 μs0x70000b0111000000000000286720xffff0b111111111111111165535
31108,20 μsCS_LOWCS_LOW

 

The column of interest is MOSI - in the Hex or Bin format of line 1, 5, 9, 13, 17, 21, 25 and 29.

Compare those with each register's explanation in the DRV8711 datasheet to get what's happening.

 

As promised, the next post is about the (runtime controlled) PWM signals that actually drive the motor.

I need some time first to study the MSP430 timers and the stepper demo firmware ...

 

Related Blog
Part 1: Hardware Overview
Part 2: Stepper Controller and MSP430 Firmware
Part 3: SPI Commands and Pulse Control
Part 4: Analyse MSP430 PWM Step Signal
Part 5: Hercules RM57 Hardware Provisioning
Part 6: Hercules RM57 SPI
Part 7: HET Assembly Language Test
Part 8: HET Based Pulse Train Output
  • Sign in to reply

Top Comments

  • DAB
    DAB over 8 years ago +1
    Great detailed post Jan. DAB
  • DAB
    DAB over 8 years ago

    Great detailed post Jan.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube