TOP Contributors

  1. MIKROE (2751 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (139059 times)
  2. FAT32 Library (71592 times)
  3. Network Ethernet Library (56989 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29777 times)
  8. mikroSDK (27874 times)
  9. PID Library (26858 times)
  10. microSD click (26129 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: 3526 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

Brushless 12 click

5

Brushless 12 Click is a compact add-on board suitable for controlling BLDC motors with any MCU. This board features the L6235, DMOS fully integrated 3-phase motor driver with overcurrent protection from STMicroelectronics.

[Learn More]

mikromedia for ATmega - Examples

5

Set of examples for mikromedia for ATmega.. Provided examples demonstrate working with mikromedia's various features and modules:

- Accelerometer
- MMC SD card
- MP3
- Serial Flash
- TFT
- Touch Panel
- USB UART

[Learn More]

USB Device Library

5

USB Device Library presents the user set of functions required to handle USB device peripheral. A embedded user application program uses API defined in this library to access USB device peripheral.

[Learn More]