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.
Features overview
Development board
Clicker 2 for Kinetis is a compact starter development board that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It comes with an onboard 32-bit ARM Cortex-M4F microcontroller, the MK64FN1M0VDC12 from NXP Semiconductors, two mikroBUS™ sockets for Click board™ connectivity, a USB connector, LED indicators, buttons, a JTAG programmer connector, and two 26-pin headers for interfacing with external electronics. Its compact design with clear and easily recognizable silkscreen markings allows you to build gadgets with unique functionalities and
features quickly. Each part of the Clicker 2 for Kinetis development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the Clicker 2 for Kinetis programming method, using a USB HID mikroBootloader or an external mikroProg connector for Kinetis programmer, the Clicker 2 board also includes a clean and regulated power supply module for the development kit. It provides two ways of board-powering; through the USB Micro-B cable, where onboard voltage regulators provide the appropriate voltage levels to each component on the board, or
using a Li-Polymer battery via an onboard battery connector. All communication methods that mikroBUS™ itself supports are on this board, including the well-established mikroBUS™ socket, reset button, and several user-configurable buttons and LED indicators. Clicker 2 for Kinetis is an integral part of the Mikroe ecosystem, allowing you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU

Architecture
ARM Cortex-M4
MCU Memory (KB)
1024
Silicon Vendor
NXP
Pin count
121
RAM (Bytes)
262144
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic

Step by step
Project assembly
Track your results in real time
Application Output
1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

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
/*!
* @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
Category:Stepper