Control bipolar stepper motors in projects that demand high-precision positioning and movement control
A
A
Hardware Overview
How does it work?
Stepper 24 Click is based on the TB67S589FTG, a BiCD constant-current 2-phase bipolar stepping motor driver IC from Toshiba Semiconductor. The TB67S589FTG features a PWM chopper-type 2-phase bipolar drive system and leverages the BiCD process with MOSFETs for output power transistors. Noteworthy features include the Advanced Dynamic Mixed Decay (ADMD) function for efficient PWM constant-current drive, high withstand voltage, and current capability withstanding voltage of up to 34V operating supplied externally via the VM terminal within a range of 10 to 34V, supporting a maximum operating current of 2.7A per phase (absolute maximum rating of 3A). It also integrates safety mechanisms such as over-temperature detection (TSD), over-current detection (ISD), and low supply voltage detection (UVLO). This Click board™ makes the perfect solution for small stepping motors in various applications such as consumer electronics and industrial equipment. The current value in the PWM constant-current mode is set by the reference voltage obtained by the MCP1501, a high-precision voltage regulator. Also, the current threshold point of the TB67S589FTG, alongside MCP1501, can be set manually using an onboard trimmer labeled VR. The control of the Stepper 23 Click is managed through specific pins on the mikroBUS™ socket: The CLK clock signal, routed to the default PWM position, advances the motor's
current step and electrical angle with each rising edge. The Enable pin, EN pin, controls the activation state of the output A and B stepping motor drive channels. Additionally, the DIR pin determines the rotation direction of the stepping motor, with a HIGH logic level indicating forward rotation and a LOW logic level indicating reverse rotation. Due to the limited number of control pins on the mikroBUS™ for managing the TB67S589FTG, the Stepper 24 Click also incorporates the PCA9555A port expander. This port expander, interfacing via the I2C interface, provides additional control over the TB67S589FTG and its functions. One of the key functions enabled through this port expander is the Decay mode. The selectable mixed decay function allows to switch between four decay modes MIXED, SLOW, FAST, and ADMD (Advanced Dynamic Mixed Decay technology from Toshiba). This optimization enhances the performance and efficiency of the stepping motor. Additionally, the Torque mode pins set the motor's torque by adjusting the logical levels of both TRQ pins. It is possible to set the torque to 100%, 75%, 50%, or 25% without changing the reference voltage level of the current regulator . The RST pin resets the electrical angle in the internal counter to an initial position. Furthermore, the MO pin indicates the achievement of the initial electrical angle position. Besides these functions, the port expander also controls the
DMODE pins, which set the step resolution to full, half-step, quarter-step, 1/8, 1/16, or 1/32. The Sleep mode function allows switching between power-saving mode (consumes only 0.03uA typical) and normal operation mode. By setting the Sleep mode and then returning to the normal operation mode, it is possible to recover from the forced OFF-state caused by the overheating or over-current detection circuit operation. Alternatively these functions can also be controlled manually via a multifunctional switch, where selecting a particular switch position (1 for Sleep Mode; 2, 3, 4 for Step Resolution Setting) allows for easy and efficient management of the board's operations. The board also includes two LED status indicators: a TSD orange LED for overtemperature conditions and an ISD red LED for overcurrent conditions. The PCA9538A allows choosing 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, alongside its interrupt feature routed to the INT pin of the mikroBUS™ socket. 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
PIC18F57Q43 Curiosity Nano evaluation kit is a cutting-edge hardware platform designed to evaluate microcontrollers within the PIC18-Q43 family. Central to its design is the inclusion of the powerful PIC18F57Q43 microcontroller (MCU), offering advanced functionalities and robust performance. Key features of this evaluation kit include a yellow user LED and a responsive
mechanical user switch, providing seamless interaction and testing. The provision for a 32.768kHz crystal footprint ensures precision timing capabilities. With an onboard debugger boasting a green power and status LED, programming and debugging become intuitive and efficient. Further enhancing its utility is the Virtual serial port (CDC) and a debug GPIO channel (DGI
GPIO), offering extensive connectivity options. Powered via USB, this kit boasts an adjustable target voltage feature facilitated by the MIC5353 LDO regulator, ensuring stable operation with an output voltage ranging from 1.8V to 5.1V, with a maximum output current of 500mA, subject to ambient temperature and voltage constraints.
Microcontroller Overview
MCU Card / MCU

Architecture
PIC
MCU Memory (KB)
128
Silicon Vendor
Microchip
Pin count
48
RAM (Bytes)
8196
You complete me!
Accessories
Curiosity Nano Base for Click boards is a versatile hardware extension platform created to streamline the integration between Curiosity Nano kits and extension boards, tailored explicitly for the mikroBUS™-standardized Click boards and Xplained Pro extension boards. This innovative base board (shield) offers seamless connectivity and expansion possibilities, simplifying experimentation and development. Key features include USB power compatibility from the Curiosity Nano kit, alongside an alternative external power input option for enhanced flexibility. The onboard Li-Ion/LiPo charger and management circuit ensure smooth operation for battery-powered applications, simplifying usage and management. Moreover, the base incorporates a fixed 3.3V PSU dedicated to target and mikroBUS™ power rails, alongside a fixed 5.0V boost converter catering to 5V power rails of mikroBUS™ sockets, providing stable power delivery for various connected devices.
The 17HD40005-22B stepper motor is a two-phase hybrid motor for high torque, high speed, and low noise performance. It features a 1m wire with optional ports on the connection end and heat shrink tubing to prevent tangling. The motor's D-shaped axle is 22mm in length. This motor operates with a chopping wave constant current drive and has a two-phase 4-wire exciting mode, allowing for both forward and reverse rotation. The power order follows AB-BC-CD-DA, viewed as clockwise from the shaft end. It has a rated current of 1.3A DC, a rated voltage of 2.4V, and a stepping angle of 1.8°, with an insulation grade of B. This stepper motor is ideal for applications requiring precise movement control and reliability.

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
This library contains API for Stepper 24 Click driver.
Key functions:
stepper24_set_direction
- This function sets the motor direction by setting the DIR pin logic state.stepper24_set_step_mode
- This function sets the step mode resolution settings.stepper24_drive_motor
- This function drives the motor for the specific number of steps at the selected speed.
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 Stepper 24 Click example
*
* # Description
* This example demonstrates the use of the Stepper 24 click board by driving the
* motor in both directions for a desired number of steps.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes the driver and performs the click default configuration.
*
* ## Application Task
* Drives the motor clockwise for 200 full steps and then counter-clockiwse for 200 half
* steps and 400 quarter steps with a 1 second delay on driving mode change. All data is
* being logged on the USB UART where you can track the program flow.
*
* @author Stefan Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "stepper24.h"
static stepper24_t stepper24;
static log_t logger;
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
stepper24_cfg_t stepper24_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.
stepper24_cfg_setup( &stepper24_cfg );
STEPPER24_MAP_MIKROBUS( stepper24_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == stepper24_init( &stepper24, &stepper24_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( STEPPER24_ERROR == stepper24_default_cfg ( &stepper24 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
log_printf ( &logger, " Move 200 full steps clockwise, speed: slow\r\n\n" );
stepper24_set_direction ( &stepper24, STEPPER24_DIR_CW );
stepper24_set_step_mode ( &stepper24, STEPPER24_MODE_FULL_STEP );
stepper24_drive_motor ( &stepper24, 200, STEPPER24_SPEED_SLOW );
Delay_ms ( 1000 );
log_printf ( &logger, " Move 200 half steps counter-clockwise, speed: medium\r\n\n" );
stepper24_set_direction ( &stepper24, STEPPER24_DIR_CCW );
stepper24_set_step_mode ( &stepper24, STEPPER24_MODE_HALF_STEP_TYPE_A );
stepper24_drive_motor ( &stepper24, 200, STEPPER24_SPEED_MEDIUM );
Delay_ms ( 1000 );
log_printf ( &logger, " Move 400 quarter steps counter-clockwise, speed: fast\r\n\n" );
stepper24_set_direction ( &stepper24, STEPPER24_DIR_CCW );
stepper24_set_step_mode ( &stepper24, STEPPER24_MODE_QUARTER_STEP );
stepper24_drive_motor ( &stepper24, 400, STEPPER24_SPEED_FAST );
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