TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (351 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136694 times)
  2. FAT32 Library (69915 times)
  3. Network Ethernet Library (55929 times)
  4. USB Device Library (46254 times)
  5. Network WiFi Library (41882 times)
  6. FT800 Library (41138 times)
  7. GSM click (28974 times)
  8. PID Library (26407 times)
  9. mikroSDK (26350 times)
  10. microSD click (25351 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

DC Motor 11 click

Rating:

5

Author: MIKROE

Last Updated: 2019-07-22

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Brushed

Downloaded: 3095 times

Not followed.

License: MIT license  

DC Motor 11 Click is a brushed DC motor driver with the current limiting and current sensing. It is based on the DRV8830, an integrated H-Bridge driver IC, optimized for motor driving applications.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "DC Motor 11 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "DC Motor 11 click" changes.

Do you want to report abuse regarding "DC Motor 11 click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

DC Motor 11 click

DC Motor 11 click

Native view of the DC Motor 11 click board.

View full image
DC Motor 11 click

DC Motor 11 click

Front and back view of the DC Motor 11 click board.

View full image

Library Description

The library contains all the necessary functions for full DC motor control.

Key functions:

  • void dcmotor11_control(uint8_t dir, uint8_t speed) - Motor Control.
  • void dcmotor11_stop() - Motor Stop.
  • uint8_t dcmotor11_getFault() - Get Fault.

Examples description

The application is composed of three sections :

  • System Initialization - Initialzes I2C module and sets INT pin as INPUT
  • Application Initialization - Initialization driver init and sets first motor settings.
  • Application Task - Waits for valid user input and executes functions based on set of valid commands.
  • Commands : '+' - Voltage (Speed) up '-' - Voltage (Speed) down 's' - Motor State - Stop/Start 'd' - Direction - Forword/Backword
void applicationTask()
{
    uint8_t dataReady_;
    char receivedData_;

    dataReady_ = UART_Rdy_Ptr( );

    if (dataReady_ != 0)
    {
        receivedData_ = UART_Rd_Ptr( );

        switch (receivedData_)
        {
            case '+' :
            {
                /* Speed increase */
                motorSpeed += 4;
                if(motorSpeed >= _DCMOTOR11_VSET_4820mV)
                {
                    mikrobus_logWrite("---- MAX SPEED ----", _LOG_LINE);
                    motorSpeed = _DCMOTOR11_VSET_4820mV;
                    dcmotor11_control(motorDir, motorSpeed);
                }
                else
                {
                    mikrobus_logWrite("---- Speed increase ----", _LOG_TEXT);
                    
                    mikrobus_logWrite(" MOTOR SPEED: ", _LOG_TEXT);
                    IntToStr(motorSpeed, demoText);
                    mikrobus_logWrite(demoText, _LOG_LINE);
                    
                    dcmotor11_control(motorDir, motorSpeed);
                }
                break;
            }
            case '-' :
            {
                /* Speed decrease */
                motorSpeed -= 4;
                if( motorSpeed < _DCMOTOR11_VSET_480mV )
                {
                    mikrobus_logWrite("---- MIN SPEED ----", _LOG_LINE);
                    motorSpeed = _DCMOTOR11_VSET_480mV;
                }
                else
                {
                    mikrobus_logWrite("---- Speed decrease ----", _LOG_TEXT);
                    
                    mikrobus_logWrite(" MOTOR SPEED: ", _LOG_TEXT);
                    IntToStr(motorSpeed, demoText);
                    mikrobus_logWrite(demoText, _LOG_LINE);
                    
                    dcmotor11_control(motorDir, motorSpeed);
                }
                break;
            }
            case 's' :
            {
                /* Stop / Start */
                if(fMotorState == 1)
                {
                     mikrobus_logWrite("---- Stop Motor!!! ----", _LOG_LINE);
                     fMotorState = 0;
                     dcmotor11_stop();
                }
                else
                {
                    mikrobus_logWrite("---- Start Motor ----", _LOG_LINE);
                    fMotorState = 1;
                    motorSpeed = _DCMOTOR11_VSET_480mV;
                    dcmotor11_control(motorDir, motorSpeed);
                }
                break;
            }
            case 'd' :
            {
                /* Direction - Forward / Backword */
                if(motorDir == 2)
                {
                     mikrobus_logWrite("---- Direction - [FORWARD] ----", _LOG_LINE);
                     motorDir = 1;
                     dcmotor11_control(motorDir, motorSpeed);
                }
                else
                {
                    mikrobus_logWrite("---- Direction - [BACKWARD] ----", _LOG_LINE);
                    motorDir = 2;
                    dcmotor11_control(motorDir, motorSpeed);
                }
                break;
            }
        }
    }
}


The full application code, and ready to use projects can be found on our LibStock page.

Other mikroE Libraries used in the example:

  • I2C
  • UART
  • Conversions

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

Environment 2 click

0

Environment 2 Click is a compact add-on board containing best-in-class SHT humidity and SGP air-quality sensing solutions from Sensirion. This board features SHT40 and SGP40, a high-accuracy ultra-low-power relative humidity, and a temperature sensor combined with MOx based gas sensor. The SHT40 sensor offers linearized digital output, provides constant temperature accuracy, up to 0.1°C, and shows the best performance when operated within the temperature and humidity range of 5-60°C and 20-80%RH, while the SGP40, a digital gas sensor, features a temperature-controlled micro hot-plate providing a humidity-compensated VOC-based indoor air quality signal. This Click board™ is suitable for indoor air quality and various temperature and humidity-related applications

[Learn More]

Power/Reset click

0

Power/Reset Click is equipped with two capacitive touch pads on a single click board™.

[Learn More]

H-Bridge 6 click

0

H-Bridge 6 Click is a compact add-on board that contains a DC motor driver for automotive applications. This board features the VNHD7008AY, an H-bridge motor driver for automotive DC motor driving from STMicroelectronics. The VNHD7008AY, features an undervoltage shutdown, load current limitation, overload active power limitation, overtemperature shutdown, and more.

[Learn More]