How does it work?
Stepper 21 Click is based on the DRV8825, a stepper motor controller integral circuit from Texas Instruments. By integrating two NMOS H-bridges, current sense, and a STEP/DIR interface, the DRV8825 allows easy interfacing with the controller circuit. The STEP/DIR interface provides a simple method for advancing through the indexer table, with the direction determined by the DIR input pin and the indexer traveling for each rising edge on the STEP input pin. It uses three decay modes of operation, fast, slow, and mixed decay, as a highly configurable current regulation. Additional features are overcurrent protection, thermal shutdown, supply voltage undervoltage lockout, and fault condition indication.
The host MCU can control the direction and steps of the stepper driver directly through the DIR and STP pins of the mikroBUS™ socket. As a feature of its own, the Stepper 21 Click comes with a VREF potentiometer to set a reference voltage for winding current on both A and B bridges. The Stepper 21 Click also uses the PCA9538A, a low-voltage 8-bit I/O port expander from NXP Semiconductors, and its standard 2-Wire interface to communicate with the host MCU and control some of the features of the stepper driver.
The PCA9538A provides a flexible set of GPIOs, contains an 8-bit register set, and is necessary for interfacing the DRV8825 control pins to the host MUC over the pins-limited mikroBUS™ socket. Besides the standard 2-Wire interface, the host MCU has access to the expander’s reset and interrupt lines over the RST and INT pins of the mikroBUS™ socket. The interrupt output is activated when any input state differs from its corresponding input port register state. The I2C address of the expander can be selected over the ADDR SEL jumper with 0 set by default.
The expander can also control other features like Sleep mode, home position indication, decay mode selection, fault indicator triggered by over-temperature and over-current protection, or allow you to enable or disable the stepper driver. Last but not least, the expander controls micro-step modes combination (Mode 0-2), thus allowing the selection of full, 1/2, 1/4, 1/8, 1/16, and 1/32 steps.
The Stepper 21 Click supports an external power supply for the DRV8825, which can be connected to the input terminal labeled as INPUT VM and should be within the range of 8.2V to 45V (2.5A), while the stepper motor coils can be connected to the terminals labeled as B+, B-, A-, and A+.
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. However, the 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.
Specifications
Type
Stepper
Applications
Can be used for small stepping motors in various applications such as office automation and commercial and industrial equipment
On-board modules
DRV8825 – stepper motor controller integral circuit from Texas Instruments
Key Features
Low power consumption, capable of controlling the bipolar stepping motor, operational in full, half, quarter, 1/8, 1/16, and 1/32 step resolutions, built-in a mixed decay mode, anomaly detection functions, expander that controls most of I/O of the stepper driver with interrupt abilities, and more
Interface
GPIO,I2C
Feature
ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Stepper 21 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 |
JP1 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2-JP3 | ADDR SEL | Left | I2C Address Selection 0/1: Left position 0, Right position 1 |
P1 | VREF | – | Current Threshold Trimmer |
Stepper 21 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
External Supply Voltage VM | 8.2 | – | 45 | V |
Maximum Output Current | – | – | 2.5 | A |
Software Support
We provide a library for the Stepper 21 Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Stepper 21 Click driver.
Key functions
-
stepper21_set_step_mode
This function sets the step mode resolution settings. -
stepper21_set_direction
This function sets the motor direction by setting the DIR pin logic state. -
stepper21_drive_motor
This function drives the motor for the specific number of steps at the selected speed.
Example Description
This example demonstrates the use of the Stepper 21 Click board™ by driving the motor in both directions for a desired number of steps.
void application_task ( void )
{
log_printf ( &logger, " Move 200 full steps clockwise rnn" );
stepper21_set_step_mode ( &stepper21, STEPPER21_MODE_FULL_STEP );
stepper21_set_direction ( &stepper21, STEPPER21_DIR_CW );
stepper21_drive_motor ( &stepper21, 200, STEPPER21_SPEED_FAST );
Delay_ms ( 2000 );
log_printf ( &logger, " Move 400 quarter steps counter-clockwise rnn" );
stepper21_set_step_mode ( &stepper21, STEPPER21_MODE_QUARTER_STEP );
stepper21_set_direction ( &stepper21, STEPPER21_DIR_CCW );
stepper21_drive_motor ( &stepper21, 400, STEPPER21_SPEED_VERY_FAST );
Delay_ms ( 2000 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Stepper21
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. UART terminal is available in all MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE 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.