Experience the difference. Add brushed motor control and witness the transformation in your projects, amplifying their speed, precision, and overall potential!
A
A
Hardware Overview
How does it work?
DC Motor 17 Click is based on the TC78H660FTG, a dual H Bridge driver for one or two DC brushed motors incorporating a DMOS output transistor with low on-resistance from Toshiba Semiconductor. This driver is a PWM-controlled constant-current drive with supply voltages from 2.5 to 16V and 2A maximum output current. It features a built-in dual H-bridge, sense-resistor less current control architecture (advanced current detection system), and a VCC regulator for the internal circuit. Besides, it offers thermal shutdown, overcurrent detection, Undervoltage lockout error detections (with error detection flag function), and several selectable operational modes (Forward, Reverse, Stop, and Brake) controlled by four GPIO pins routed on the RST, AN, PWM, and INT pins of the mikroBUS™ socket. The TC78H660FTG possesses two operational modes, IN Input Mode and PHASE Input Mode, whose selection can be achieved via headers Control Mode pin labeled as MODE. PHASE Mode represents the default mode of this Click board™, and the Control Mode is set up by the input state of the MODE pin after releasing the SBY pin. This way, the MODE pin is used as the Enable signal
while the direction selection is realized via GPIO pins routed on the mikroBUS™ socket. The pin labeled as ERR represents the Error Detection Flag. When TC78H660FTG detects some errors, the ERR pin outputs a low level to the peripheral block. In Normal status, since the internal MOSFET is OFF, the logic level of the ERR pin is equal to the MODE control voltage from outside. When some event like thermal shutdown or overcurrent occurs, the ERR pin will become low (the internal MOSFET is ON). When the error detection is released by reasserting the external power supply or setting the device to Standby Mode, ERR pins show Normal Status. In the case of constant current control, the rate of Mixed Decay Mode, which determines the current ripple, is fixed at 37.5%. Peak current can be set by the voltage value of the VREF pin obtained by the MAX6100, a low-cost, low-dropout, micropower voltage reference IC from Analog Devices. This series-mode voltage reference draws only 90μA of supply current and can source 5mA and sink 2mA of load current. The current threshold point for the VREF pin of the TC78H660FTG, alongside MAX6100, can be set manually using an onboard trimmer labeled VR1.
As mentioned in the product description, DC Motor 17 Click communicates with MCU using several GPIO pins. Also, this Click board™ has a Standby pin labeled as SBY routed to the CS pin of the mikroBUS™ socket used to switch to Standby mode by toggling the pin. When the SBY pin is low, TC78H660FTG stops supplying the power to the logic circuit. The difference in DC Motor modes between IN and PHASE Input Modes needs to be especially emphasized. In addition to motor modes such as Forward, Reverse, Stop, and Standby, only IN Input Mode has another additional, Short Brake Mode. More information on the Motor Mode Selection can be found in the attached datasheet. 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. Additionally, there is a possibility for motor-driver power supply selection via jumper labeled as VM SEL to supply TC78H660FTG from an external input terminal in the range from 2.5 to 16V or with voltage levels used from mikroBUS™ power supply pins.
Features overview
Development board
Nucleo 32 with STM32F031K6 MCU board provides an affordable and flexible platform for experimenting with STM32 microcontrollers in 32-pin packages. Featuring Arduino™ Nano connectivity, it allows easy expansion with specialized shields, while being mbed-enabled for seamless integration with online resources. The
board includes an on-board ST-LINK/V2-1 debugger/programmer, supporting USB reenumeration with three interfaces: Virtual Com port, mass storage, and debug port. It offers a flexible power supply through either USB VBUS or an external source. Additionally, it includes three LEDs (LD1 for USB communication, LD2 for power,
and LD3 as a user LED) and a reset push button. The STM32 Nucleo-32 board is supported by various Integrated Development Environments (IDEs) such as IAR™, Keil®, and GCC-based IDEs like AC6 SW4STM32, making it a versatile tool for developers.
Microcontroller Overview
MCU Card / MCU

Architecture
ARM Cortex-M0
MCU Memory (KB)
32
Silicon Vendor
STMicroelectronics
Pin count
32
RAM (Bytes)
4096
You complete me!
Accessories
Click Shield for Nucleo-32 is the perfect way to expand your development board's functionalities with STM32 Nucleo-32 pinout. The Click Shield for Nucleo-32 provides two mikroBUS™ sockets to add any functionality from our ever-growing range of Click boards™. We are fully stocked with everything, from sensors and WiFi transceivers to motor control and audio amplifiers. The Click Shield for Nucleo-32 is compatible with the STM32 Nucleo-32 board, providing an affordable and flexible way for users to try out new ideas and quickly create prototypes with any STM32 microcontrollers, choosing from the various combinations of performance, power consumption, and features. The STM32 Nucleo-32 boards do not require any separate probe as they integrate the ST-LINK/V2-1 debugger/programmer and come with the STM32 comprehensive software HAL library and various packaged software examples. This development platform provides users with an effortless and common way to combine the STM32 Nucleo-32 footprint compatible board with their favorite Click boards™ in their upcoming projects.
DC Gear Motor - 430RPM (3-6V) represents an all-in-one combination of a motor and gearbox, where the addition of gear leads to a reduction of motor speed while increasing the torque output. This gear motor has a spur gearbox, making it a highly reliable solution for applications with lower torque and speed requirements. The most critical parameters for gear motors are speed, torque, and efficiency, which are, in this case, 520RPM with no load and 430RPM at maximum efficiency, alongside a current of 60mA and a torque of 50g.cm. Rated for a 3-6V operational voltage range and clockwise/counterclockwise rotation direction, this motor represents an excellent solution for many functions initially performed by brushed DC motors in robotics, medical equipment, electric door locks, and much more.
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 DC Motor 17 Click driver.
Key functions:
dcmotor17_stop
- DC Motor 17 stop motor functiondcmotor17_forward
- DC Motor 17 forward functiondcmotor17_reverse
- DC Motor 17 reverse function
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 DC Motor 17 Click Example.
*
* # Description
* The library covers all the necessary functions to control DC Motor 17 Click board.
* Library performs a standard GPIO interface communication.
* DC Motor 17 Click board is a dual H Bridge driver IC for one or two DC brushed
* motors which incorporates DMOS with low on-resistance in output transistors.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes GPIO driver, set default configuration and start to write log.
*
* ## Application Task
* This is an example that demonstrates the use of the DC Motor 17 click board.
* This example demonstrates the use of DC Motor 17 click,
* we first control motion A by driving it forward motion for 5 seconds,
* than applying short brakes it for 2 second, then driving it in reverse for 5 seconds
* and stop the motor for 2 seconds.
* In the second part of the example, we control motion B by the same principle.
* Results are being sent to the Usart Terminal where you can track their changes.
*
* @author Nenad Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "dcmotor17.h"
static dcmotor17_t dcmotor17; /**< DC Motor 17 Click driver object. */
static log_t logger; /**< Logger object. */
void application_init ( void ) {
log_cfg_t log_cfg; /**< Logger config object. */
dcmotor17_cfg_t dcmotor17_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_printf( &logger, "----------------------------\r\n" );
log_printf( &logger, " DC Motor 17 click \r\n" );
log_printf( &logger, "----------------------------\r\n" );
log_info( &logger, " Application Init " );
// Click initialization.
dcmotor17_cfg_setup( &dcmotor17_cfg );
DCMOTOR17_MAP_MIKROBUS( dcmotor17_cfg, MIKROBUS_1 );
if ( dcmotor17_init( &dcmotor17, &dcmotor17_cfg ) == DIGITAL_OUT_UNSUPPORTED_PIN ) {
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
dcmotor17_default_cfg ( &dcmotor17 );
log_info( &logger, " Application Task " );
}
void application_task ( void ) {
log_printf( &logger, "----------------------------\r\n" );
log_printf( &logger, " Motor A \r\n" );
log_printf( &logger, "----------------------------\r\n" );
log_printf( &logger, " Start the motor forward. \r\n" );
dcmotor17_forward( &dcmotor17, DCMOTOR17_SEL_OUT_A );
Delay_ms( 5000 );
log_printf( &logger, "----------------------------\r\n" );
log_printf( &logger, " Stop the motor. \r\n" );
dcmotor17_stop( &dcmotor17, DCMOTOR17_SEL_OUT_A );
Delay_ms( 2000 );
log_printf( &logger, "----------------------------\r\n" );
log_printf( &logger, " Start the motor reverse. \r\n" );
dcmotor17_reverse( &dcmotor17, DCMOTOR17_SEL_OUT_A );
Delay_ms( 5000 );
log_printf( &logger, "----------------------------\r\n" );
log_printf( &logger, " Stop the motor. \r\n" );
dcmotor17_stop( &dcmotor17, DCMOTOR17_SEL_OUT_A );
Delay_ms( 2000 );
log_printf( &logger, "----------------------------\r\n" );
log_printf( &logger, " Motor B \r\n" );
log_printf( &logger, "----------------------------\r\n" );
log_printf( &logger, " Start the motor forward. \r\n" );
dcmotor17_forward( &dcmotor17, DCMOTOR17_SEL_OUT_B );
Delay_ms( 5000 );
log_printf( &logger, "----------------------------\r\n" );
log_printf( &logger, " Stop the motor. \r\n" );
dcmotor17_stop( &dcmotor17, DCMOTOR17_SEL_OUT_B );
Delay_ms( 2000 );
log_printf( &logger, "----------------------------\r\n" );
log_printf( &logger, " Start the motor reverse. \r\n" );
dcmotor17_reverse( &dcmotor17, DCMOTOR17_SEL_OUT_B );
Delay_ms( 5000 );
log_printf( &logger, "----------------------------\r\n" );
log_printf( &logger, " Stop the motor. \r\n" );
dcmotor17_stop( &dcmotor17, DCMOTOR17_SEL_OUT_B );
Delay_ms( 2000 );
}
void main ( void ) {
application_init( );
for ( ; ; ) {
application_task( );
}
}
// ------------------------------------------------------------------------ END