How does it work?
Stepper 16 Click as its foundation uses the NCV70517, an integrated motor-driver solution for bipolar stepper motors with integrated current sense and current regulation from ON Semiconductor. Two H−bridges are integrated to drive a bipolar stepper motor with a PWM current control loop with on-chip current sensing implemented for each H−bridge. It provides complete output protection, overcurrent protection, and thermal warning and shutdown, alongside with proprietary PWM algorithm used for reliable, current control allowing automatic selection of fast and slow decay.
The NCV70517 communicates with MCU using the standard SPI serial interface with a maximum frequency of 10MHz. One of five possible stepping modes is selectable through bits of the SPI registers. After Power−On or hard reset, the coil−current translator, which translates consecutive steps into corresponding currents in both motor coils for a given step mode, is set to the default to 1/16 micro−stepping at position ‘8’. Besides the micro−step modes, full step mode is implemented, which always activates only one coil.
The direction of rotation is selected by input pin DIR routed to the RST pin of the mikroBUS™ socket and its polarity bit DIRP, which allows changing the direction of rotation through only SPI commands instead of the dedicated input pin. Besides, it also takes the next micro−step depending on the clock signal on the NXT input pin routed to the PWM pin of the mikroBUS™ socket and provides an error message on the ERR pin routed to the INT pin of the mikroBUS™ socket if an electrical error, an undervoltage, or an elevated junction temperature is detected.
This Click board™ supports an external power supply for the motor, which can be connected to the input terminal labeled as VEXT and should be within the range of 6V to 29V, while the stepper motor coils can be connected to the terminals labeled as XP, XN, YP, and YN.
This Click board™ can be operated only with a 3.3V logic voltage level. Therefore, the board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ comes equipped with a library containing functions and an example code that can be used, as a reference, for further development.
Specifications
Type
Stepper
Applications
Can be used for general−purpose stepper motor applications in the automotive, industrial, and applications with fluctuating battery supplies.
On-board modules
NCV70517 – integrated motor-driver solution for bipolar stepper motors with integrated current sense and current regulation from ON Semiconductor
Key Features
Dual H−bridge for 2−phase stepper motors, fully integrated current−sensing and current−regulation, integrated current translator, 5 step modes from full-step up to 16 micro-steps, PWM current control with automatic selection of fast and slow decay, and more
Interface
GPIO,SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V,External
Pinout diagram
This table shows how the pinout on Stepper 16 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
Stepper 16 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage VCC | – | 3.3 | – | V |
External Supply Voltage VEXT | 6 | – | 29 | V |
Maximum Output Current (Normal Operation) | – | 800 | – | mA |
Step Resolution | 1 | – | 1/16 | steps |
Operating Temperature Range | -40 | +25 | +145 | °C |
Software Support
We provide a library for the Stepper 16 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Stepper 16 Click driver.
Key functions:
stepper16_cfg_setup
– Config Object Initialization function.stepper16_init
– Initialization function.stepper16_default_cfg
– Click Default Configuration function.
Examples description
This example showcases the device’s ability to control the motor. It initializes the device for control and moves the motor in two directions in a variety of speeds and step resolutions for 360 degrees.
The demo application is composed of two sections :
void application_task ( void ) { static uint8_t direction = 1; log_printf( &logger, "> Move 360deg in CW direction.rn" ); stepper16_set_step_resolution( &stepper16, STEPPER16_STEP_RES_FULL ); check_error( &stepper16 ); stepper16_move_motor_angle( &stepper16, 360, STEPPER16_SPEED_MEDIUM ); direction = !direction; stepper16_set_dir( &stepper16, direction ); Delay_ms( 500 ); log_printf( &logger, "> Move 180deg in CCW direction.rn" ); stepper16_set_step_resolution( &stepper16, STEPPER16_STEP_RES_QUARTER ); check_error( &stepper16 ); stepper16_move_motor_angle( &stepper16, 180, STEPPER16_SPEED_SLOW ); Delay_ms( 1000 ); log_printf( &logger, "> Move 180deg in CCW direcion.rn" ); stepper16_set_step_resolution( &stepper16, STEPPER16_STEP_RES_1div16 ); check_error( &stepper16 ); stepper16_move_motor_angle( &stepper16, 180, STEPPER16_SPEED_FAST ); direction = !direction; stepper16_set_dir( &stepper16, direction ); Delay_ms( 2000 ); }
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Stepper16
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.