How does it work?
DC Motor 12 Click is based on the TB9054FTG, a dual-channel, H-bridge, brushed DC motor driver from Toshiba Semiconductor. The TB9054FTG allows a dual configuration with two motors with 5A current ratings per channel or one 10A channel drive in a Parallel mode of operation. It is also rated for an operating voltage range from 4.5V to 28V, with the motor controlled directly through an SPI serial interface or PWM signal from an unpopulated header. The PWM control with low on-resistance enables highly efficient motor drive output, ensuring reliable operation for highly competitive automotive applications.
Besides the SPI communication, several GPIO pins connected to the mikroBUS™ socket pins are also used to control the TB9054FTG associated with the PCA9538A I2C-configurable port expander, such as Sleep Mode pin and DC motor channels current monitor routed to the RST and AN pins (SLP and CM) of the mikroBUS™ socket. 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.
As mentioned, this Click board™ supports double or single DC motor configuration. To select the motor control and operational modes, the corresponding switches on the board marked with SW1-SW4 are used. The first two represent the switches for motor control selection – more precisely, the choice of control directly by the PWM signal or through the SPI interface – while the second two represent the selection of the motor operational mode. There are four possible modes, i.e., Small Mode (two separated channels), Large Mode (two channels are connected and support one DC motor), Half Mode, and Prohibited Mode, where the channels are completely disabled.
The control and PWM signals can also be brought externally via the onboard header J1. In that case, the PWM1 and PWM2 pins specify forward, reverse, or brake modes for motor 1, and the PWM3 and PWM4 pins specify these modes for motor 2. The enable EN pins select the drive or stop mode for the motor. A broad range of configuration options for this driver, control, and mode selections, can be found in the attached datasheet. This Click board™ also has additional LEDs for anomaly indication. Suppose a state such as an overtemperature or overcurrent/under voltage is detected. In that case, such anomaly is indicated by red LEDs marked as DIAG1 and DIAG2 associated with the interrupt pin.
The DC Motor 12 supports an external power supply for the TB9054FTG, which can be connected to the input terminal labeled as VM and should be within the range of 4.5V to 28V, while the DC motor coils can be connected to the terminals labeled from OUT1 up to OUT4.
This Click board™ can operate on both 3.3V and 5V logic voltage levels selected via the VCC SEL jumper. Therefore, both 3.3V and 5V capable MCUs to use the communication lines properly. 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 automotive applications (AEC-Q100 Grade 1 qualified), such as control of the throttle valve, engine valves, retractable door mirrors, and seat heater
On-board modules
TB9054FTG – brushed DC motor driver from Toshiba Semiconductor
Key Features
Driver for one or two DC motors, direct PWM control or through SPI interface, selectable motor control functions and operational modes, Sleep mode and current monitoring, full protection and diagnostics, and more
Interface
I2C,PWM,SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V,5V,External
Pinout diagram
This table shows how the pinout on DC Motor 12 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 |
LD2-LD3 | DIAG1-DIAG2 | – | Diagnostic LED Indicators |
JP1 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2-JP3 | ADDR SEL | Left | I2C Address Selection 0/1: Left position 0, Right position 1 |
J1 | J1 | Unpopulated | External PWM/Control Signals Header |
SW1-SW2 | SW1-SW2 | Up | Motor Control Selection |
SW3-SW4 | SW3-SW4 | Down | Mode Selection |
DC Motor 12 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
External Supply Voltage | 4.5 | – | 28 | V |
Output Current | 5 | 6.5 | 10 | A |
Operating Temperature Range | -40 | +25 | +125 | °C |
Software Support
We provide a library for the DC Motor 12 Click as well as a demo application (example), developed using Mikroe compilers. The demo can run on all the main Mikroe development boards.
The package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on the Mikroe github account.
Library Description
This library contains API for DC Motor 12 Click driver.
Key functions
-
dcmotor12_get_motor_current
DC Motor 12 get motor current function. -
dcmotor12_set_ch1_operation_mode
DC Motor 12 set ch1 operation mode function. -
dcmotor12_set_cm_sel_pin
DC Motor 12 set cm sel pin function.
Example Description
This example demonstrates the use of DC Motor 12 Click board™ by controlling the speed of DC motor over PWM duty cycle as well as displaying the motor current consumption.
void application_task ( void )
{
if ( DCMOTOR12_OK == dcmotor12_set_ch1_operation_mode ( &dcmotor12, DCMOTOR12_MODE_OUTPUT_OFF ) )
{
log_printf ( &logger, " MODE: OFFrn" );
Delay_ms ( 3000 );
}
if ( DCMOTOR12_OK == dcmotor12_set_ch1_operation_mode ( &dcmotor12, DCMOTOR12_MODE_FORWARD ) )
{
dcmotor12_set_cm_sel_pin ( &dcmotor12, DCMOTOR12_PIN_LOW_LEVEL );
for ( uint16_t duty = 0; duty <= DCMOTOR12_CONFIG56_DUTY_PERIOD_MAX; duty += 100 )
{
float current;
log_printf ( &logger, " MODE: FORWARDrn" );
if ( DCMOTOR12_OK == dcmotor12_set_ch1_duty_period ( &dcmotor12, duty ) )
{
log_printf ( &logger, " Duty: %urn", duty );
}
if ( DCMOTOR12_OK == dcmotor12_get_motor_current ( &dcmotor12, ¤t ) )
{
log_printf ( &logger, " Current: %.3f Arnn", current );
}
Delay_ms ( 500 );
}
}
if ( DCMOTOR12_OK == dcmotor12_set_ch1_operation_mode ( &dcmotor12, DCMOTOR12_MODE_BRAKE ) )
{
log_printf ( &logger, " MODE: BRAKErn" );
Delay_ms ( 3000 );
}
if ( DCMOTOR12_OK == dcmotor12_set_ch1_operation_mode ( &dcmotor12, DCMOTOR12_MODE_REVERSE ) )
{
dcmotor12_set_cm_sel_pin ( &dcmotor12, DCMOTOR12_PIN_HIGH_LEVEL );
for ( uint16_t duty = 0; duty <= DCMOTOR12_CONFIG56_DUTY_PERIOD_MAX; duty += 100 )
{
float current;
log_printf ( &logger, " MODE: REVERSErn" );
if ( DCMOTOR12_OK == dcmotor12_set_ch1_duty_period ( &dcmotor12, duty ) )
{
log_printf ( &logger, " Duty: %urn", duty );
}
if ( DCMOTOR12_OK == dcmotor12_get_motor_current ( &dcmotor12, ¤t ) )
{
log_printf ( &logger, " Current: %.3f Arnn", current );
}
Delay_ms ( 500 );
}
}
}
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 the Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.DCMotor12
Additional notes and informations
Depending on the development board you are using, you may need a 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 by mikroSDK – MikroElektronika’s Software Development Kit. mikroSDK should be downloaded from the LibStock™ and installed for the compiler you are using to ensure proper operation of mikroSDK compliant Click board™ demo applications.
For more information about mikroSDK, visit the official page.