Advanced
30 min

Deliver smooth and accurate stepper motor motion with powerSTEP01 and STM32F410RB

1/128 microstepping and powerful 10A RMS output solution

Power Step 2 Click with Nucleo 64 with STM32F410RB MCU

Published Mar 31, 2025

Click board™

Power Step 2 Click

Dev. board

Nucleo 64 with STM32F410RB MCU

Compiler

NECTO Studio

MCU

STM32F410RB

Achieve ultra-precise motion control with 1/128 microstepping and powerful 10A RMS output

A

A

Hardware Overview

How does it work?

Power Step 2 Click is based on the powerSTEP01, an a power 1/128 microstepping controller from STMicroelectronics. This system-in-package solution integrates eight N-channel MOSFETs with an ultra-low RDS(on) of just 16mΩ, enabling precise control of stepper motors operating at voltages up to 85V while delivering a maximum output current of 10A RMS. The board is designed to offer full digital motion control, using an SPI-programmable interface for speed profile generation and accurate positioning. With its powerful combination of high voltage handling, precise microstepping control, and an extensive safety feature set, the Power Step 2 Click is an ideal solution for applications requiring precise motor control, including industrial process automation, medical analysis equipment, robotics, antenna positioning, CCTV and security systems, and dome camera mechanisms. At the core of the powerSTEP01 is its capability to support both voltage mode driving and advanced current control, making it adaptable to a variety of motor control applications. With its embedded dual full-bridge configuration and non-dissipative overcurrent protection, it ensures reliability even in demanding environments. The digital control engine allows users to define custom motion profiles, including acceleration, deceleration, speed, and target positioning, all of which can be conveniently programmed through a dedicated register set via the high-speed 5MHz SPI interface. Safety and

robustness are key aspects of the powerSTEP01 architecture. It includes a comprehensive set of protection features such as thermal shutdown, low bus voltage detection, overcurrent protection, and motor stall detection, ensuring uninterrupted and secure operation under all conditions. In addition to the SPI interface pins, Power Step 2 Click uses several additional control pins for enhanced functionality. The RST pin serves as both a standby and reset control, where pulling it to a LOW logic level places the device in standby mode and resets its logic. The STK pin acts as the step clock input, allowing precise motor motion control in step-clock mode. Each rising edge of the step-clock signal applied to this pin advances the motor by one microstep in the programmed direction while simultaneously updating the absolute position. Furthermore, the board features a SWITCH, which plays a crucial role in motor initialization. Since the initial position of the stepper motor is often undefined at power-up, an initialization sequence is required to move it to a known position. The GoUntil and ReleaseSW commands, in conjunction with this switch, makes a straightforward method for setting the motor's reference position. This Click board™ also includes two important status pins for monitoring device operation. The FLG pin serves as a status flag output whenever a programmed alarm condition is triggered. These conditions may include step loss, overcurrent detection (OCD), thermal pre-warning or shutdown, undervoltage

lockout (UVLO), invalid commands, or non-performable commands. The BSY pin, on the other hand, is primarily used to indicate when the device is actively executing a command by default. However, it can also be configured to generate a synchronization signal if required. Both of these signals are accompanied by dedicated LED indicators - a red LED for FLG and a yellow LED for BSY - providing clear visual feedback for quick status monitoring and troubleshooting. The Power Step 2 Click also includes two unpopulated pins, OSCIN and OSCO, which allow for the connection of an external oscillator or clock source. When an external clock is not used, the internal oscillator provides a configurable clock signal through the OSCO pin, which can output frequencies of 2MHz, 4MHz, 8MHz, or 16MHz, depending on the selected settings. This flexibility enables users to synchronize the motor driver with other system components or optimize performance based on specific application requirements. This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.

Power Step 2 Click hardware overview image

Features overview

Development board

Nucleo-64 with STM32F410RB MCU offers a cost-effective and adaptable platform for developers to explore new ideas and prototype their designs. This board harnesses the versatility of the STM32 microcontroller, enabling users to select the optimal balance of performance and power consumption for their projects. It accommodates the STM32 microcontroller in the LQFP64 package and includes essential components such as a user LED, which doubles as an ARDUINO® signal, alongside user and reset push-buttons, and a 32.768kHz crystal oscillator for precise timing operations. Designed with expansion and flexibility in mind, the Nucleo-64 board features an ARDUINO® Uno V3 expansion connector and ST morpho extension pin

headers, granting complete access to the STM32's I/Os for comprehensive project integration. Power supply options are adaptable, supporting ST-LINK USB VBUS or external power sources, ensuring adaptability in various development environments. The board also has an on-board ST-LINK debugger/programmer with USB re-enumeration capability, simplifying the programming and debugging process. Moreover, the board is designed to simplify advanced development with its external SMPS for efficient Vcore logic supply, support for USB Device full speed or USB SNK/UFP full speed, and built-in cryptographic features, enhancing both the power efficiency and security of projects. Additional connectivity is

provided through dedicated connectors for external SMPS experimentation, a USB connector for the ST-LINK, and a MIPI® debug connector, expanding the possibilities for hardware interfacing and experimentation. Developers will find extensive support through comprehensive free software libraries and examples, courtesy of the STM32Cube MCU Package. This, combined with compatibility with a wide array of Integrated Development Environments (IDEs), including IAR Embedded Workbench®, MDK-ARM, and STM32CubeIDE, ensures a smooth and efficient development experience, allowing users to fully leverage the capabilities of the Nucleo-64 board in their projects.

Nucleo 64 with STM32C031C6 MCU double side image

Microcontroller Overview

MCU Card / MCU

default

Architecture

ARM Cortex-M4

MCU Memory (KB)

128

Silicon Vendor

STMicroelectronics

Pin count

64

RAM (Bytes)

32768

You complete me!

Accessories

Click Shield for Nucleo-64 comes equipped with two proprietary mikroBUS™ sockets, allowing all the Click board™ devices to be interfaced with the STM32 Nucleo-64 board with no effort. This way, Mikroe allows its users to add any functionality from our ever-growing range of Click boards™, such as WiFi, GSM, GPS, Bluetooth, ZigBee, environmental sensors, LEDs, speech recognition, motor control, movement sensors, and many more. More than 1537 Click boards™, which can be stacked and integrated, are at your disposal. The STM32 Nucleo-64 boards are based on the microcontrollers in 64-pin packages, a 32-bit MCU with an ARM Cortex M4 processor operating at 84MHz, 512Kb Flash, and 96KB SRAM, divided into two regions where the top section represents the ST-Link/V2 debugger and programmer while the bottom section of the board is an actual development board. These boards are controlled and powered conveniently through a USB connection to program and efficiently debug the Nucleo-64 board out of the box, with an additional USB cable connected to the USB mini port on the board. Most of the STM32 microcontroller pins are brought to the IO pins on the left and right edge of the board, which are then connected to two existing mikroBUS™ sockets. This Click Shield also has several switches that perform functions such as selecting the logic levels of analog signals on mikroBUS™ sockets and selecting logic voltage levels of the mikroBUS™ sockets themselves. Besides, the user is offered the possibility of using any Click board™ with the help of existing bidirectional level-shifting voltage translators, regardless of whether the Click board™ operates at a 3.3V or 5V logic voltage level. Once you connect the STM32 Nucleo-64 board with our Click Shield for Nucleo-64, you can access hundreds of Click boards™, working with 3.3V or 5V logic voltage levels.

Click Shield for Nucleo-64 accessories 1 image

The 17HD40005-22B stepper motor is a two-phase hybrid motor for high torque, high speed, and low noise performance. It features a 1m wire with optional ports on the connection end and heat shrink tubing to prevent tangling. The motor's D-shaped axle is 22mm in length. This motor operates with a chopping wave constant current drive and has a two-phase 4-wire exciting mode, allowing for both forward and reverse rotation. The power order follows AB-BC-CD-DA, viewed as clockwise from the shaft end. It has a rated current of 1.3A DC, a rated voltage of 2.4V, and a stepping angle of 1.8°, with an insulation grade of B. This stepper motor is ideal for applications requiring precise movement control and reliability.

Power Step 2 Click accessories 1 image

Used MCU Pins

mikroBUS™ mapper

Busy Status / Synchronization
PC0
AN
Reset / ID SEL
PC12
RST
SPI Select / ID COMM
PB12
CS
SPI Clock
PB3
SCK
SPI Data OUT
PB4
MISO
SPI Data IN
PB5
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
Step-Clock Signal
PC8
PWM
Fault Indicator
PC14
INT
NC
NC
TX
NC
NC
RX
NC
NC
SCL
NC
NC
SDA
Power Supply
5V
5V
Ground
GND
GND
1

Take a closer look

Click board™ Schematic

Power Step 2 Click Schematic schematic

Step by step

Project assembly

Click Shield for Nucleo-64 accessories 1 image hardware assembly

Start by selecting your development board and Click board™. Begin with the Nucleo 64 with STM32F410RB MCU as your development board.

Click Shield for Nucleo-64 accessories 1 image hardware assembly
Nucleo 64 with STM32F401RE MCU front image hardware assembly
LTE IoT 5 Click front image hardware assembly
Prog-cut hardware assembly
LTE IoT 5 Click complete accessories setup image hardware assembly
Board mapper by product8 hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
Necto image step 5 hardware assembly
Necto image step 6 hardware assembly
Clicker 4 for STM32F4 HA MCU Step hardware assembly
Necto No Display image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Debug Image Necto Step hardware assembly

Software Support

Library Description

Power Step 2 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.

Example Description
This example demonstrates the use of the Power Step 2 Click board for precise control of stepper motors. The application showcases various step modes, directions, and speeds while demonstrating the board's ability to control motors using different operation modes.

Key functions:

  • powerstep2_cfg_setup - Config Object Initialization function.

  • powerstep2_init - Initialization function.

  • powerstep2_default_cfg - Click Default Configuration function.

  • powerstep2_set_step_mode - This function sets the step mode (microstepping level) of the Power Step 2 device.

  • powerstep2_set_speed - This function sets the minimum and maximum speeds for motor movement.

  • powerstep2_move - This function moves the motor a specified number of steps in a given direction.

Application Init
Initializes the logger and configures the Power Step 2 Click board. The default settings are applied to prepare the device for motor control operations.

Application Task
Demonstrates motor control with various configurations. The example alternates between multiple step modes (1/8, 1/16, 1/32, 1/4), directions (CW, CCW), speeds, and control modes (voltage, current). Each configuration is applied sequentially, with the motor driven through specified steps before switching to the next configuration.

Open Source

Code example

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.

/*!
 * @file main.c
 * @brief Power Step 2 Click example
 *
 * # Description
 * This example demonstrates the use of the Power Step 2 Click board for precise control of stepper motors. 
 * The application showcases various step modes, directions, and speeds while demonstrating the board's 
 * ability to control motors using different operation modes.
 *
 * The demo application is composed of two sections:
 *
 * ## Application Init
 * Initializes the logger and configures the Power Step 2 Click board. The default settings are applied 
 * to prepare the device for motor control operations.
 *
 * ## Application Task
 * Demonstrates motor control with various configurations. The example alternates between multiple step 
 * modes (1/8, 1/16, 1/32, 1/4), directions (CW, CCW), speeds, and control modes (voltage, current). 
 * Each configuration is applied sequentially, with the motor driven through specified steps before switching 
 * to the next configuration.
 *
 * @author Stefan Filipovic
 *
 */

#include "board.h"
#include "log.h"
#include "powerstep2.h"

static powerstep2_t powerstep2;
static log_t logger;

void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    powerstep2_cfg_t powerstep2_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    powerstep2_cfg_setup( &powerstep2_cfg );
    POWERSTEP2_MAP_MIKROBUS( powerstep2_cfg, MIKROBUS_1 );
    if ( SPI_MASTER_ERROR == powerstep2_init( &powerstep2, &powerstep2_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    if ( POWERSTEP2_ERROR == powerstep2_default_cfg ( &powerstep2 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }
    
    log_info( &logger, " Application Task " );
}

void application_task ( void )
{
    log_printf ( &logger, " Step mode: 1/8\r\n" );
    log_printf ( &logger, " Direction: CW\r\n" );
    log_printf ( &logger, " Steps: 16000\r\n" );
    log_printf ( &logger, " Speed: [0, 500]\r\n" );
    log_printf ( &logger, " Acc-Dec: [200, 100]\r\n" );
    log_printf ( &logger, " Control mode: Command voltage\r\n\n" );
    powerstep2_clear_status ( &powerstep2 );
    powerstep2_set_control_mode ( &powerstep2, POWERSTEP2_CONTROL_MODE_VOLTAGE );
    powerstep2_set_step_mode ( &powerstep2, POWERSTEP2_STEP_MODE_1_OVER_8 );
    powerstep2_set_speed ( &powerstep2, 0, 500 );
    powerstep2_set_acc_dec ( &powerstep2, 200, 100 );
    powerstep2_move ( &powerstep2, POWERSTEP2_DIR_CW, 16000 );
    powerstep2_soft_hiz ( &powerstep2 );
    Delay_ms ( 1000 );

    log_printf ( &logger, " Step mode: 1/16\r\n" );
    log_printf ( &logger, " Direction: CCW\r\n" );
    log_printf ( &logger, " Steps: 32000\r\n" );
    log_printf ( &logger, " Speed: [350, 600]\r\n" );
    log_printf ( &logger, " Acc-Dec: [100, 200]\r\n" );
    log_printf ( &logger, " Control mode: Command current\r\n\n" );
    powerstep2_clear_status ( &powerstep2 );
    powerstep2_set_control_mode ( &powerstep2, POWERSTEP2_CONTROL_MODE_CURRENT );
    powerstep2_set_step_mode ( &powerstep2, POWERSTEP2_STEP_MODE_1_OVER_16 );
    powerstep2_set_speed ( &powerstep2, 350, 600 );
    powerstep2_set_acc_dec ( &powerstep2, 100, 200 );
    powerstep2_move ( &powerstep2, POWERSTEP2_DIR_CCW, 32000 );
    powerstep2_soft_hiz ( &powerstep2 );
    Delay_ms ( 1000 );

    log_printf ( &logger, " Step mode: 1/32\r\n" );
    log_printf ( &logger, " Direction: CW\r\n" );
    log_printf ( &logger, " Steps: 16000\r\n" );
    log_printf ( &logger, " Speed: Very fast\r\n" );
    log_printf ( &logger, " Control mode: Step-clock voltage\r\n\n" );
    powerstep2_clear_status ( &powerstep2 );
    powerstep2_set_control_mode ( &powerstep2, POWERSTEP2_CONTROL_MODE_VOLTAGE );
    powerstep2_set_step_mode ( &powerstep2, POWERSTEP2_STEP_MODE_1_OVER_32 );
    powerstep2_step_clock ( &powerstep2, POWERSTEP2_DIR_CW );
    powerstep2_drive_motor ( &powerstep2, 16000, POWERSTEP2_SPEED_VERY_FAST );
    powerstep2_soft_hiz ( &powerstep2 );
    Delay_ms ( 1000 );

    log_printf ( &logger, " Step mode: 1/4\r\n" );
    log_printf ( &logger, " Direction: CCW\r\n" );
    log_printf ( &logger, " Steps: 2000\r\n" );
    log_printf ( &logger, " Speed: Medium\r\n" );
    log_printf ( &logger, " Control mode: Step-clock current\r\n\n" );
    powerstep2_clear_status ( &powerstep2 );
    powerstep2_set_control_mode ( &powerstep2, POWERSTEP2_CONTROL_MODE_CURRENT );
    powerstep2_set_step_mode ( &powerstep2, POWERSTEP2_STEP_MODE_QUARTER_STEP );
    powerstep2_step_clock ( &powerstep2, POWERSTEP2_DIR_CCW );
    powerstep2_drive_motor ( &powerstep2, 2000, POWERSTEP2_SPEED_MEDIUM );
    powerstep2_soft_hiz ( &powerstep2 );
    Delay_ms ( 1000 );
}

int main ( void ) 
{
    /* Do not remove this line or clock might not be set correctly. */
    #ifdef PREINIT_SUPPORTED
    preinit();
    #endif
    
    application_init( );
    
    for ( ; ; ) 
    {
        application_task( );
    }

    return 0;
}

// ------------------------------------------------------------------------ END

Additional Support

Resources

Love this project?

'Buy This Kit' button takes you directly to the shopping cart where you can easily add or remove products.