OFF
MIKROE-3544
24 g
Status:
STSPIN820 click is a stepper motor driver with the PWM current control, selectable microstepping up to 256 microsteps, and a wide voltage range. It is based on the STSPIN820, a stepper motor driver from STSPIN8 series. Designed to be a bullet-proof solution for the new wave of demanding industrial applications, it integrates two full-bridges with low ON resistance, the control logic, and a full set of protection features, in a small 4x4mm QFN package. Its output stage implements the PWM current control with the fixed OFF time. The device can be used with the step motor voltage ranging from 7V up to 45V, and current up to 1.5A per bridge.
STSPIN820 click is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click board™ comes as a fully tested product, ready to be used on a system equipped with the mikroBUS™ socket.
This product is no longer in stock
Availability date:
This Click board™ is optimized for driving bipolar stepper motors over a wide voltage range. Therefore, the STSPIN820 integrates very efficient H-Bridges with ON resistance of approximately 1Ω through each bridge. Motor current can be limited by an onboard potentiometer. These features make STSPIN820 click perfectly suited for rapid development of various stepper motor applications, including ATM-related applications, toys, 3D printers, mechatronics, robotics-related applications, etc.
STSPIN820 click is based on the STSPIN820, an advanced stepper motor driver produced by STMicroelectronics. The monolithic IC incorporates both the power MOSFETs and the logic circuitry necessary for simplified control and reliable functioning of the connected bipolar stepper motor. Featuring a microstepping sequencer that supports up to 256 microsteps, this IC can perform very smooth and silent movements. The step sequencer also controls the VREF voltage, allowing the current through coils to be at an optimal level during the microstepping. In full step mode, the maximum current through the coils is controlled by the VREF, according to the formula given further below. As the sequencer propagates through the microsteps, the VREF is further reduced following a circular pattern, ensuring maximum power efficiency for each step.
The STSPIN820 has two PWM current controllers with the fixed OFF time for each H-Bridge, during which the current decay sequence is performed. This effectively limits the maximum current through the connected motor phase. The OFF (decay) time is fixed to approximately 25 µs on this Click board™. The DECAY pin determines the decay mode. In mixed decay mode (DECAY pin at the LOW logic level), the decay period is divided into slow decaying and fast decaying segments. The slow decay segment lasts for 5/8 of the total OFF time, while the fast decay segment lasts for 3/8 of the total OFF time. When the DECAY pin is at the HIGH logic level, the slow decay mode lasts for the entire OFF time.
The PWM current controller compares the voltage across two sense resistors (VSENS1, and VSENS2) and the VREF voltage, which can be adjusted by a potentiometer. When VSENS becomes greater than the VREF voltage, the current limiting is triggered, and the OFF timer starts counting. The decay sequence is performed. By using a simple formula, the VREF voltage can be determined for a specific load current:
VREF = RSENS · ILOAD
Where:
By knowing the RSENS, it can be easily calculated how much voltage should be applied to the REF pin of the STSPIN820, to limit the current according to ILOAD. For example, if there is 0.3V applied at the VREF pin, the current limit will be maxed out to 0.91A. The potentiometer allows to simply adjust the VREF voltage, according to needs.
The STSPIN820 contains two independent H-Bridges, and each of them controls one phase of the bipolar stepper motor. The motor can be controlled by using these pins: DIR, STCK, RST, EN, and FAULT.
The DIR pin determines the direction of the rotation. If set to a HIGH logic level, the internal microstepping counter will increase its value with each pulse coming through the STCK pin. The LOW logic level on this pin will cause the microstepping sequencer to decrease its counter. DIR pin is routed both to the mikroBUS™ pin AN (labeled as DIR).
STCK pin has already been explained above: a pulse on this pin will cause the microstepping sequencer to increase or decrease its counter, depending on the state of the DIR pin.
SW1, SW2, and SW3 switches on the Click board™ are used to determine the step size. They have MODE 1, MODE 2, and MODE 3 pins routed to them, respectively. All these switches can be used to set the mode at any moment during the operation. The changes are applied immediately. The datasheet of the STSPIN820 IC offers a truth-table which contains settings of these switches for each microstepping mode.
The STBY/RESET (RST) pin of the STSPIN820 is used to set both bridge outputs in HIGH-Z mode, disconnecting the power supply from the H-Bridges. This pin allows lower average power consumption as no current can flow from the power supply to the motor. This pin is routed to the RST pin of the mikroBUS™. The control logic circuitry will be reset when leaving the standby mode.
The EN/FAULT (EN) pin has a double purpose: when set to a high logic level, it acts as a chip enable, allowing the device to operate. In the case of a fault condition on the IC, it will be asserted to a LOW logic level, acting as an interrupt pin. After a timeout period defined by the external capacitor and resistor values, a restart attempt will be made. This pin is routed to both CS and INT pin of the mikroBUS™, allowing the host MCU to use both functions. These pins are labeled as EN and FLT on the Click board™, respectively.
The motor power supply can be connected to the input terminal labeled as VIN and should be within the range of 7V to 45V. Stepper motor coils can be connected to the terminals labeled as A1, B2, B1, and A2. The Click board™ requires an external power supply for the motor in order to work. However, it also requires 3.3V from the mikroBUS™ rail.
Type
Stepper
Applications
Perfectly suited for rapid development of various stepper motor applications, including ATM-related applications, toys, 3D printers, mechatronics, robotics-related applications, etc.
On-board modules
An STSPIN820, a stepper motor driver from STSPIN8 series from STmicrocontrollers
Key Features
The STSPIN820 click fetures PWM current control, selectable micro-stepping up to 256 micro-steps, and a wide voltage range.
Interface
GPIO
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V
This table shows how the pinout on STSPIN820 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
External power supply voltage | 7 | - | 45 | V |
Motor RMS current | - | - | 1.5 | A |
Step size | 1 | - | 1:256 | step |
Note: Power dissipation should be monitored. An additional heat sink might be required when operated with high current values.
Label | Name | Default | Description |
---|---|---|---|
PWR | PWR | - | Power LED Indicator |
SW1 - SW4 | SW1 - SW4 | Up | Microstepping selection switches |
VR1 | - | - | Potentiometer for current limiting |
We provide a library for the STSPIN820 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 STSPIN820 Click driver.
Key functions
stspin820_set_direction
This function sets the motor direction by setting the DIR pin logic state.
stspin820_drive_motor
This function drives the motor for the specific number of steps at the selected speed.
stspin820_reset_device
This function resets the device by toggling the RST pin.
Example Description
This example demonstrates the use of the STSPIN820 Click by driving the motor in both directions for a desired number of steps.
void application_task ( void )
{
log_printf ( &logger, " Move 200 steps clockwise, speed: slowrnn" );
stspin820_set_direction ( &stspin820, STSPIN820_DIR_CW );
stspin820_drive_motor ( &stspin820, 200, STSPIN820_SPEED_SLOW );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf ( &logger, " Move 200 steps counter-clockwise, speed: fastrnn" );
stspin820_set_direction ( &stspin820, STSPIN820_DIR_CCW );
stspin820_drive_motor ( &stspin820, 200, STSPIN820_SPEED_FAST );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
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:
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.
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.
NOTE: Please be advised that any peripheral devices or accessories shown connected to the Click board™ are not included in the package. Check their availability in our shop or in the YMAN section below.