With a compact design and reliable performance, our integrated motor-driver solution takes the hassle out of managing bipolar stepper motors
A
A
Hardware Overview
How does it work?
Stepper 11 Click is based on the TB9120AFTG, a constant-current 2-phase stepping motor driver for automotive applications from Toshiba Semiconductor. The TB9120AFTG incorporates low on-resistance DMOS FETs, which can deliver a 2A maximum current. A built-in mixed decay mode helps to stabilize the current waveforms. Numerous protection mechanisms are also incorporated, such as over-current and over-temperature detection, thermal shutdown, and stall detection. Thanks to the many micro-steps they support, motor noise can be significantly reduced with smoother operation and more precise control. It is suited to a wide range of general automotive applications using stepping motors and supports an operational temperature range covering -40°C to 125°C. The current value is set by the reference voltage obtained by the MCP1804, a low-dropout voltage regulator. The current threshold point for the VREF pin of the TB9120AFTG, alongside MCP1804, can be set manually using an onboard trimmer labeled VR1. Alongside I2C communication, several GPIO pins connected to the mikroBUS™ socket pins are also used to forward the information to the MCU,
associated with the PCA9538A port expander with a maximum frequency of 400kHz. The PCA9538A also allows the choice of the least significant bit (LSB) of its I2C slave address by positioning SMD jumpers labeled as ADDR SEL to an appropriate position marked as 0 and 1. The Enable pin, labeled as EN and routed to the CS pin of the mikroBUS™ socket, optimizes power consumption and is used for power ON/OFF purposes. All circuits, including the interface pins, are inactive in this state, and the TB9120AFTG is in the form of minimum power consumption. A simple DIR pin routed to the AN pin on the mikroBUS™ socket allows MCU to manage the direction of the stepper motor (clockwise or counterclockwise). At the same time, the onboard switches labeled from SW1-SW3 enable users to set the excitation mode, stepper motor step resolution, and SW4-SW5 sets torque and rotational force. In addition to these features, this Click board™ also uses the CLK step clock pin, routed to the PWM pin of the mikroBUS™ socket, for PWM constant-current control, allowing stable output waveforms in mixed decay mode. The RST pin of the mikroBUS™ socket initializes an
electrical angle in the internal counter to set an initial position. Achieving an initial position is indicated via an onboard blue LED labeled as MO. This Click board™ also has two additional LEDs for anomaly indication. Suppose a state such as a motor load open, overtemperature, or overcurrent is detected. In that case, such anomaly is indicated by a red LED marked as DIAG, while an orange LED labeled SD indicates when a stall (step-out) situation is detected. The motor-stall detection threshold can be manually set manually using an onboard trimmer labeled VR2. The Stepper 11 Click supports an external power supply for the TB9120AFTG, which can be connected to the input terminal labeled as VM and should be within the range of 7V to 18V, 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. 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
Fusion for ARM v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports a wide range of microcontrollers, such as different ARM® Cortex®-M based MCUs regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer over WiFi. The development board is well organized and designed so that the end-user has all the necessary elements, such as switches, buttons, indicators, connectors, and others, in one place. Thanks to innovative manufacturing technology, Fusion for ARM v8 provides a fluid and immersive working experience, allowing access anywhere and under any
circumstances at any time. Each part of the Fusion for ARM v8 development board contains the components necessary for the most efficient operation of the same board. An advanced integrated CODEGRIP programmer/debugger module offers many valuable programming/debugging options, including support for JTAG, SWD, and SWO Trace (Single Wire Output)), and seamless integration with the Mikroe software environment. Besides, it also includes a clean and regulated power supply module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via the USB Type-C (USB-C) connector.
Communication options such as USB-UART, USB HOST/DEVICE, CAN (on the MCU card, if supported), and Ethernet is also included. In addition, it also has the well-established mikroBUS™ standard, a standardized socket for the MCU card (SiBRAIN standard), and two display options for the TFT board line of products and character-based LCD. Fusion for ARM v8 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development 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
Type
8th Generation
Architecture
ARM Cortex-M4
MCU Memory (KB)
256
Silicon Vendor
STMicroelectronics
Pin count
100
RAM (Bytes)
40960
You complete me!
Accessories
The 28BYJ-48 is an adaptable 5VDC stepper motor with a compact design, ideal for various applications. It features four phases, a speed variation ratio of 1/64, and a stride angle of 5.625°/64 steps, allowing precise control. The motor operates at a frequency of 100Hz and has a DC resistance of 50Ω ±7% at 25°C. It boasts an idle in-traction frequency greater than 600Hz and an idle out-traction frequency exceeding 1000Hz, ensuring reliability in different scenarios. With a self-positioning torque and in-traction torque both exceeding 34.3mN.m at 120Hz, the 28BYJ-48 offers robust performance. Its friction torque ranges from 600 to 1200 gf.cm, while the pull-in torque is 300 gf.cm. This motor makes a reliable and efficient choice for your stepper motor needs.
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
Step by step
Project assembly
Track your results in real time
Application Output via UART Mode
1. Once the code example is loaded, pressing the "FLASH" button initiates the build process, and programs it on the created setup.
2. After the programming is completed, click on the Tools icon in the upper-right panel, and select the UART Terminal.
3. After opening the UART Terminal tab, first check the baud rate setting in the Options menu (default is 115200). If this parameter is correct, activate the terminal by clicking the "CONNECT" button.
4. Now terminal status changes from Disconnected to Connected in green, and the data is displayed in the Received data field.
Software Support
Library Description
This library contains API for Stepper 11 Click driver.
Key functions:
stepper11_set_step_resolution
- Set step resolution.stepper11_move_motor_angle
- Move motor in angle value.stepper11_move_motor_step
- Move motor in step value.
Open Source
Code example
This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.
/*!
* @file main.c
* @brief Stepper11 Click example
*
* # 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 resolutions for 360 degrees.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initialization of communication modules(I2C, UART) and additional pins
* for control of device. Then sets default configuration that enables
* device for motor control.
*
* ## Application Task
* Firstly it rotates motor in CW direction for 360 degrees in FULL step
* resolution. Then changes direction in CCW and rotates backwards 360 degrees
* in 2 different step resolutions (Quarter and 1/16) in 180 degrees each.
*
* @author Luka Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "stepper11.h"
static stepper11_t stepper11;
static log_t logger;
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
stepper11_cfg_t stepper11_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.
stepper11_cfg_setup( &stepper11_cfg );
STEPPER11_MAP_MIKROBUS( stepper11_cfg, MIKROBUS_1 );
err_t init_flag = stepper11_init( &stepper11, &stepper11_cfg );
if ( I2C_MASTER_ERROR == init_flag )
{
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
stepper11_default_cfg ( &stepper11 );
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
stepper11_set_step_resolution( &stepper11, STEPPER11_RESOLUTION_FULL );
stepper11_set_direction( &stepper11, 1 );
log_info( &logger, " Rotate motor CW for 360 degrees in full step" );
stepper11_move_motor_angle( &stepper11, 360, STEPPER11_SPEED_FAST );
Delay_ms( 1000 );
stepper11_set_direction( &stepper11, 0 );
stepper11_set_step_resolution( &stepper11, STEPPER11_RESOLUTION_QUARTER );
log_info( &logger, " Rotate motor CCW for 180 degrees in half step" );
stepper11_move_motor_angle( &stepper11, 180, STEPPER11_SPEED_FAST );
Delay_ms( 1000 );
stepper11_set_step_resolution( &stepper11, STEPPER11_RESOLUTION_1div16 );
log_info( &logger, " Rotate motor CCW for 180 degrees in 1/8 step" );
stepper11_move_motor_angle( &stepper11, 180, STEPPER11_SPEED_FAST );
Delay_ms( 1000 );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END