How does it work?
DC Motor 16 Click is based on the ZXBM5210, a single chip solution for driving a single-coil reversible direct current (DC) fans and motors from Diodes Incorporated. The driver output stage is designed to minimize audible switching noise and electromagnetic interference (EMI) ensuring a low noise solution. The device has four motor operation modes: Standby, Forward, Reverse, and Brake Mode. These four modes are controlled by the FWD and REV pins routed to the RST and PWM pins of the mikroBUS™ used for controlling the motor rotation directions. In the Standby mode, all the internal circuits are turned off to minimize power consumption, while the Brake mode allows the motor to stop quickly. The power consumption in the Standby mode is less than in the Brake mode. To prevent the ZXBM5210 from entering the Standby mode during mode changes, the signal change should be completed within 125μs.
The ZXBM5210 also possesses three modes of motor speed control: VREF speed control mode, PWM speed control mode, and motor speed control by adjusting the supply voltage. Motor speed can be controlled by adjusting the duty cycle of the PWM signal while keeping the supply voltage pin at the nominal motor voltage or can be controlled by varying the supply voltage while the FWD and REV pins are set to either a logic high or low depending on needed motor direction. In PWM Mode the input voltage on the Vref pin of the ZXBM5210 must be greater than or equal to the supply voltage value.
The motor speed of the ZXBM5210 can be controlled by adjusting the DC voltage on the Vref pin. For this purpose, the DC Motor 16 click employs the MCP4161 digital potentiometer from Microchip, which allows setting the corresponding voltage value via the SPI serial interface. The potentiometer terminal B is fixed to the Zero-Scale wiper value (which corresponds to a wiper value of 0x00 for both 7-bit and 8-bit devices), while the potentiometer terminal A is fixed connected to the Full-Scale wiper value (which corresponds to a wiper value of 0x100 for 8-bit devices or 0x80 for 7-bit devices). For this reason, it was chosen that when the user selects 0x100 as the desired value, the value on the Vref pin takes the value of supply voltage from the mikroBUS™ (VCC), while in the case of selecting 0x00 on the Vref pin value is equal to the 0.2*VCC. In this mode, FWD and REV pins are only used for direction control, and therefore high-frequency PWM control signal should not be applied to those pins.
This Click board™ is designed to be operated with both 3.3V and 5V logic voltage levels that can be selected via VCC SEL jumper. This allows for both 3.3V and 5V capable MCUs to use the SPI communication lines properly. However, the Click board™ comes equipped with a library that contains 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 a reversible DC motor and actuator drive, remote control motorized toy applications, home appliances, handheld power tools, and many more.
On-board modules
DC Motor 16 Click is based on the ZXBM5210, a single chip solution for driving a single-coil reversible direct current (DC) fans and motors from Diodes Incorporated.
Key Features
Low power consumption, wide supply voltage range, under/over voltage protection, over current limit, thermal shutdown capability, and many more.
Interface
GPIO,SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on DC Motor 16 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 | Power Supply Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
DC Motor 16 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
External Supply Voltage | 3 | – | 18 | V |
FWD and REV Pin Voltage | -0.3 | – | 7 | V |
Maximum Output Current | – | 700 | 1200 | mA |
PWM Speed Control Signal Frequency | 8 | 25 | 100 | kHz |
Software Support
We provide a library for the DC Motor 16 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 16 Click driver.
Key functions
-
dcmotor16_set_direction
Set motor direction. -
dcmotor16_ctrl_vref
Control motor VRef (speed). -
dcmotor16_stop
Motor stop.
Example Description
This example shows the capabilities of the DC Motor 16 Click.
void application_task ( void ) {
uint16_t cnt;
log_printf( &logger, ">> Motor start with direction [FORWARD] <<rn" );
dcmotor16_set_direction( &dcmotor16, DCMOTOR16_DIR_FORWARD );
for( cnt = 0; cnt <= 0x0100; cnt+= 25 ) {
dcmotor16_ctrl_vref( &dcmotor16, cnt );
Delay_ms ( 250 );
}
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, ">> Motor stop rn" );
dcmotor16_stop( &dcmotor16 );
Delay_ms ( 1000 );
log_printf( &logger, ">> Motor start with direction [BACKWARD] <<rn" );
dcmotor16_set_direction( &dcmotor16, DCMOTOR16_DIR_BACKWARD );
for( cnt = 0; cnt <= 0x0100; cnt+= 25 ) {
dcmotor16_ctrl_vref( &dcmotor16, cnt );
Delay_ms ( 250 );
}
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, ">> Motor stop rn" );
dcmotor16_stop( &dcmotor16 );
Delay_ms ( 1000 );
}
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.DCMotor16
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.