How does it work?
DC Motor 23 Click is based on the TB67H480FNG, a dual-channel, H-bridge, brushed DC motor driver from Toshiba Semiconductor. The TB67H480FNG has a current limit function that monitors the current flowing in the motor. When the motor current reaches the set current value, determined using onboard VREF trimmers (VREFA and VREFB), it shifts to Decay mode, selectable by positioning the SMD jumper labeled as DECAY to an appropriate position marked as 0 and 1, for a fixed OFF time and attenuates the current. The TB67H480FNG has a built-in regulator that allows the motor to be driven by a single power supply, provides a motor output voltage rating of around 40V, and has integrated protection mechanisms such as over-current, over-temperature, and under-voltage lockout for error detection.
The setting current value can be adjusted with the torque function (100%, 71%, 38%, or 0%), controlled through the PCA9538A port expander, which establishes communication with the MCU via the I2C serial interface. When high torque is not needed, lowering the torque setting can suppress the motor current. In addition to these torque setting pins, with the help of the expander, it is also possible to control some other signals, such as the control signals for selecting the operating mode of the motor driver. These pins, in combination with ENA and ENB pins, routed to default positions of CS and PWM pins of the mikroBUS™ socket, enable operational modes like CW, CCW, or short-brake.
The PCA9538A also 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. Besides, all circuits can be stopped using the Sleep function, routed to default positions of the AN pin of the mikroBUS™ socket, and thus enable power saving mode, while the RST pin provides a general-purpose reset function.
The DC Motor 23 Click supports an external power supply for the TB67H480FNG, which can be connected to the input terminal labeled as VM and should be within the range of 8.2V to 44V, while the two brushed or one stepping 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
Brushed
Applications
Can be used for driving two brushed or one stepping motors in various applications such as consumer electronics and industrial equipment
On-board modules
TB67H480FNG – dual-channel, H-bridge, brushed DC motor driver from Toshiba Semiconductor
Key Features
Low power consumption, BiCD-based structure, high breakdown voltage/large current, power saving function, various protection features, selectable decay mode, error detection function, and more
Interface
GPIO,I2C
Feature
No 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 DC Motor 23 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 | DECAY | Left | Decay Mode Selection 0/1: Left position 0, Right position 1 |
JP3-JP4 | ADDR SEL | Left | I2C Address Selection 0/1: Left position 0, Right position 1 |
VREFA | VREFA | – | Motor A Current Threshold Trimmer |
VREFB | VREFB | – | Motor B Current Threshold Trimmer |
DC Motor 23 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
External Supply Voltage VM | 8.2 | 24 | 44 | V |
Maximum Output Voltage | – | – | 40 | V |
Maximum Output Current | – | – | 2 | A |
Software Support
We provide a library for the DC Motor 23 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 DC Motor 23 Click driver.
Key functions
-
dcmotor23_set_clockwise
DC Motor 23 set clockwise function. -
dcmotor23_set_counter_clockwise
DC Motor 23 set counter clockwise function. -
dcmotor23_set_decay
DC Motor 23 set decay function.
Example Description
This example demonstrates the use of DC Motor 23 click board™. by driving the motors in both direction every 3 seconds.
void application_task ( void )
{
if ( DCMOTOR23_OK == dcmotor23_set_clockwise( &dcmotor23, DCMOTOR23_SEL_OUT_A ) )
{
log_printf ( &logger, " OUTA: Clockwisern" );
}
if ( DCMOTOR23_OK == dcmotor23_set_clockwise( &dcmotor23, DCMOTOR23_SEL_OUT_B ) )
{
log_printf ( &logger, " OUTB: Clockwisernn" );
}
Delay_ms ( 3000 );
if ( DCMOTOR23_OK == dcmotor23_set_decay( &dcmotor23, DCMOTOR23_SEL_OUT_A ) )
{
log_printf ( &logger, " OUTA: Decayrn" );
}
if ( DCMOTOR23_OK == dcmotor23_set_decay( &dcmotor23, DCMOTOR23_SEL_OUT_B ) )
{
log_printf ( &logger, " OUTB: Decayrnn" );
}
Delay_ms ( 3000 );
if ( DCMOTOR23_OK == dcmotor23_set_counter_clockwise( &dcmotor23, DCMOTOR23_SEL_OUT_A ) )
{
log_printf ( &logger, " OUTA: Counter-Clockwisern" );
}
if ( DCMOTOR23_OK == dcmotor23_set_counter_clockwise( &dcmotor23, DCMOTOR23_SEL_OUT_B ) )
{
log_printf ( &logger, " OUTB: Counter-Clockwisernn" );
}
Delay_ms ( 3000 );
if ( DCMOTOR23_OK == dcmotor23_set_decay( &dcmotor23, DCMOTOR23_SEL_OUT_A ) )
{
log_printf ( &logger, " OUTA: Decayrn" );
}
if ( DCMOTOR23_OK == dcmotor23_set_decay( &dcmotor23, DCMOTOR23_SEL_OUT_B ) )
{
log_printf ( &logger, " OUTB: Decayrnn" );
}
log_printf ( &logger, "--------------------------rn" );
Delay_ms ( 3000 );
}
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.DCMotor23
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.