How does it work?
DC Motor 15 Click is based on the DRV8874, an integrated motor driver with N-channel H-bridge, charge pump, current sensing and proportional output, current regulation, and protection circuitry from Texas Instruments. The DRV8874 operates from the external power supply from 4.5V to 37V providing a wide range of output load currents for various types of motors and loads. The charge pump feature improves efficiency by supporting N-channel MOSFET half-bridges and 100% duty cycle driving. This Click board™ also integrates current sensing, regulation, and feedback. These features allow for the DRV8874 to sense the output current without an external sense resistor or sense circuitry reducing system cost and complexity. This also allows for the device to limit the output current in the case of the motor stall or high torque events and give detailed feedback to the MCU about the load current through a current proportional output on the AN pin of the mikroBUS™ labeled as IPR.
The DRV8874 integrates an H-bridge output power stage that can be operated in different control modes set by the PMODE pin setting. The PMODE pin on this Click board™ is set to a logic low level that means that the device is latched into PH/EN mode. PH/EN mode allows for the H-bridge to be controlled with a speed and direction type of interface through two GPIO pins labeled as IN2 and IN1, routed to the PWM and CS pins of the mikroBUS™ socket. It also has a Sleep Mode that achieves ultra-low quiescent current draw by shutting down most of the internal circuitry. The SLP pin routed to the RST pin of the mikroBUS™ socket provides an ultra-low power mode to minimize current draw during system inactivity.
DC Motor 15 Click communicates with MCU using several GPIO pins as mentioned before in the product description. In addition to the pins used to adjust the speed and rotation direction of the motor, this Click board™ also has an interrupt labeled as FLT routed to the INT pin of the mikroBUS™ socket used to protect the device and the output load. The DRV8874 enters a Fault Mode when a fault is encountered, and leave the Fault Mode, and re-enter the Active Mode when the recovery condition is met.
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 GPIO 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 brushed DC and servo motor and actuator drive, home appliances, handheld power tools, and many more.
On-board modules
DC Motor 15 Click is based on the DRV8874, an integrated motor driver with N-channel H-bridge, charge pump, current sensing and proportional output, current regulation, and protection circuitry from Texas Instruments.
Key Features
High output current capability, integrated current sensing and regulation, proportional current output, selectable current regulation and control modes, low power consumption, and more.
Interface
GPIO
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 15 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 | Power Supply Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
DC Motor 15 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 4.5 | – | 3.7 | V |
Maximum Output Current | 0 | – | 6 | A |
Current sense output current | – | – | 3 | mA |
Operating Temperature Range | -40 | – | +125 | °C |
Software Support
We provide a library for the DC Motor 15 Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library covers all the necessary functions to control DC Motor 15 Click board™. DC Motor 15 Click communicates with the target board through the RST, CS, PWM and INT pins on mikroBUS™. This library offers functions for setting or clearing of RST, CS and PWM pins, and check the state of the INT pin, also user can use functions that drive motor forward and in reverse or apply brake functions.
Key functions:
void dcmotor15_forward ( );
– Function is used to drive the motor forward.void dcmotor15_reverse ( );
– Function is used to drive the motor in reverse.void dcmotor15_brake ( );
– Function is used to brake the motor.
Examples description
The application is composed of three sections :
- System Initialization – Initializes LOG structure and sets RST, CS and PWM pins as output, and INT pin as input.
- Application Initialization – Initializes GPIO driver, powers up the device and starts log.
- Application Task – This example demonstrates the use of DC Motor 15 Click by driving the connected motor forward for 5 seconds, than braking for 2 second, and driving it in reverse for 5 more seconds, braking again for 2 second afterwards.
void application_task ( ) { mikrobus_logWrite( "The motor turns forward!", _LOG_LINE ); dcmotor15_forward( ); Delay_ms( 5000 ); mikrobus_logWrite( "The motor brakes!", _LOG_LINE ); dcmotor15_brake( ); Delay_ms( 2000 ); mikrobus_logWrite( "The motor turns in reverse!", _LOG_LINE ); dcmotor15_reverse( ); Delay_ms( 5000 ); mikrobus_logWrite( "The motor brakes!", _LOG_LINE ); dcmotor15_brake( ); Delay_ms( 2000 ); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- UART
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika 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.