stepper23  2.1.0.0
Main Page

Stepper 23 Click

Stepper 23 Click is a compact add-on board designed to drive small stepping motors in consumer electronics and industrial equipment applications. This board features the TB67S569FTG, a BiCD constant-current 2-phase bipolar stepping motor driver IC from Toshiba Semiconductor. Key features include a PWM chopper-type 2-phase bipolar drive system, high withstand voltage of up to 34V operating, and a maximum operating current of 1.8A per phase. The board also integrates safety mechanisms such as over-temperature, over-current, and low-supply voltage detection. Additional control is provided by the PCA9555A port expander via I2C, enabling functions like decay and torque modes, step resolution settings, and many more.

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Jun 2024.
  • Type : I2C type

Software Support

We provide a library for the Stepper 23 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 23 Click driver.

Standard key functions :

Example key functions :

Example Description

This example demonstrates the use of the Stepper 23 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.

void application_init ( void )
{
log_cfg_t log_cfg;
stepper23_cfg_t stepper23_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
stepper23_cfg_setup( &stepper23_cfg );
STEPPER23_MAP_MIKROBUS( stepper23_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == stepper23_init( &stepper23, &stepper23_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( STEPPER23_ERROR == stepper23_default_cfg ( &stepper23 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}

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.

void application_task ( void )
{
log_printf ( &logger, " Move 200 full steps clockwise, speed: slow\r\n\n" );
Delay_ms ( 1000 );
log_printf ( &logger, " Move 200 half steps counter-clockwise, speed: medium\r\n\n" );
Delay_ms ( 1000 );
log_printf ( &logger, " Move 400 quarter steps counter-clockwise, speed: fast\r\n\n" );
Delay_ms ( 1000 );
}

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.Stepper23

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 MikroElektronika compilers.


stepper23_cfg_setup
void stepper23_cfg_setup(stepper23_cfg_t *cfg)
Stepper 23 configuration object setup function.
stepper23_set_direction
void stepper23_set_direction(stepper23_t *ctx, uint8_t dir)
Stepper 23 set direction function.
stepper23_default_cfg
err_t stepper23_default_cfg(stepper23_t *ctx)
Stepper 23 default configuration function.
STEPPER23_SPEED_MEDIUM
#define STEPPER23_SPEED_MEDIUM
Definition: stepper23.h:171
STEPPER23_SPEED_SLOW
#define STEPPER23_SPEED_SLOW
Definition: stepper23.h:170
application_task
void application_task(void)
Definition: main.c:66
STEPPER23_MODE_QUARTER_STEP
#define STEPPER23_MODE_QUARTER_STEP
Definition: stepper23.h:142
stepper23_drive_motor
void stepper23_drive_motor(stepper23_t *ctx, uint32_t steps, uint8_t speed)
Stepper 23 driver motor function.
STEPPER23_ERROR
@ STEPPER23_ERROR
Definition: stepper23.h:260
stepper23_init
err_t stepper23_init(stepper23_t *ctx, stepper23_cfg_t *cfg)
Stepper 23 initialization function.
STEPPER23_SPEED_FAST
#define STEPPER23_SPEED_FAST
Definition: stepper23.h:172
STEPPER23_DIR_CW
#define STEPPER23_DIR_CW
Stepper 23 direction setting.
Definition: stepper23.h:122
STEPPER23_MAP_MIKROBUS
#define STEPPER23_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: stepper23.h:201
stepper23_t
Stepper 23 Click context object.
Definition: stepper23.h:217
application_init
void application_init(void)
Definition: main.c:30
STEPPER23_MODE_HALF_STEP_TYPE_A
#define STEPPER23_MODE_HALF_STEP_TYPE_A
Definition: stepper23.h:140
STEPPER23_DIR_CCW
#define STEPPER23_DIR_CCW
Definition: stepper23.h:123
stepper23_set_step_mode
err_t stepper23_set_step_mode(stepper23_t *ctx, uint8_t mode)
Stepper 23 set step mode function.
stepper23_cfg_t
Stepper 23 Click configuration object.
Definition: stepper23.h:239
STEPPER23_MODE_FULL_STEP
#define STEPPER23_MODE_FULL_STEP
Stepper 23 step resolution setting.
Definition: stepper23.h:136