TOP Contributors

  1. MIKROE (2745 codes)
  2. Alcides Ramos (371 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 (138914 times)
  2. FAT32 Library (71500 times)
  3. Network Ethernet Library (56914 times)
  4. USB Device Library (47269 times)
  5. Network WiFi Library (42993 times)
  6. FT800 Library (42282 times)
  7. GSM click (29724 times)
  8. mikroSDK (27668 times)
  9. PID Library (26828 times)
  10. microSD click (26087 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 17 click

Rating:

0

Author: MIKROE

Last Updated: 2024-07-04

Package Version: 2.1.0.33

mikroSDK Library: 2.0.0.0

Category: Brushed

Downloaded: 356 times

Not followed.

License: MIT license  

DC Motor 17 Click is a compact add-on board that contains a brushed DC motor driver. This board features the TC78H660FTG, a dual H Bridge driver for one or two brushed motors that incorporate a DMOS with low on-resistance in output transistors from Toshiba Semiconductor. This IC is a PWM controlled constant-current drive with supply voltages from 2.5V to 16V and 2A of output current. It features a sense-resistor less current control architecture and VCC regulator for the internal circuit. Also offers multi-error detect functions with error detection flag output function. This Click board™ is suitable for driving DC motors, controlling the direction of the rotation, as well as brake and regulate the motor current.

No Abuse Reported

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

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

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

  • Information
  • Comments (0)

mikroSDK Library Blog


DC Motor 17 click

DC Motor 17 Click is a compact add-on board that contains a brushed DC motor driver. This board features the TC78H660FTG, a dual H Bridge driver for one or two brushed motors that incorporate a DMOS with low on-resistance in output transistors from Toshiba Semiconductor.

dcmotor17_click.png

click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Nov 2020.
  • Type : GPIO type

Software Support

We provide a library for the DcMotor17 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on mikroE github account.

Library Description

This library contains API for DcMotor17 Click driver.

Standard key functions :

Config Object Initialization function.

void dcmotor17_cfg_setup ( dcmotor17_cfg_t *cfg );

Initialization function.

err_t dcmotor17_init ( dcmotor17_t *ctx, dcmotor17_cfg_t *cfg );

Click Default Configuration function.

void dcmotor17_default_cfg ( dcmotor17_t *ctx );

Example key functions :

DC Motor 17 stop motor function.

dcmotor17_retval_t dcmotor17_stop ( dcmotor17_t *ctx, uint8_t sel_out );

DC Motor 17 forward function.

dcmotor17_retval_t dcmotor17_forward ( dcmotor17_t *ctx, uint8_t sel_out );

DC Motor 17 reverse function.

dcmotor17_retval_t dcmotor17_reverse ( dcmotor17_t *ctx, uint8_t sel_out );

Examples Description

The library covers all the necessary functions to control DC Motor 17 Click board. Library performs a standard GPIO interface communication. DC Motor 17 Click board is a dual H Bridge driver IC for one or two DC brushed motors which incorporates DMOS with low on-resistance in output transistors.

The demo application is composed of two sections :

Application Init

Initializes GPIO driver, set default configuration and start to write log.

void application_init ( void ) {
    log_cfg_t log_cfg;              /**< Logger config object. */
    dcmotor17_cfg_t dcmotor17_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_printf( &logger, "----------------------------\r\n" );
    log_printf( &logger, "      DC Motor 17 click     \r\n" );
    log_printf( &logger, "----------------------------\r\n" );
    log_info( &logger, " Application Init " );

    // Click initialization.

    dcmotor17_cfg_setup( &dcmotor17_cfg );
    DCMOTOR17_MAP_MIKROBUS( dcmotor17_cfg, MIKROBUS_1 );
    if ( dcmotor17_init( &dcmotor17, &dcmotor17_cfg ) == DIGITAL_OUT_UNSUPPORTED_PIN ) {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }
    dcmotor17_default_cfg ( &dcmotor17 );
    log_info( &logger, " Application Task " );
}

Application Task

This is an example that demonstrates the use of the DC Motor 17 click board. This example demonstrates the use of DC Motor 17 click, we first control motion A by driving it forward motion for 5 seconds, than applying short brakes it for 2 second, then driving it in reverse for 5 seconds and stop the motor for 2 seconds. In the second part of the example, we control motion B by the same principle. Results are being sent to the Usart Terminal where you can track their changes.

void application_task ( void ) {
    log_printf( &logger, "----------------------------\r\n" );
    log_printf( &logger, "          Motor A           \r\n" );
    log_printf( &logger, "----------------------------\r\n" );
    log_printf( &logger, "  Start the motor forward.  \r\n" );
    dcmotor17_forward( &dcmotor17, DCMOTOR17_SEL_OUT_A );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, "----------------------------\r\n" );
    log_printf( &logger, "       Stop the motor.      \r\n" );
    dcmotor17_stop( &dcmotor17, DCMOTOR17_SEL_OUT_A );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, "----------------------------\r\n" );
    log_printf( &logger, "  Start the motor reverse.  \r\n" );
    dcmotor17_reverse( &dcmotor17, DCMOTOR17_SEL_OUT_A );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, "----------------------------\r\n" );
    log_printf( &logger, "       Stop the motor.      \r\n" );
    dcmotor17_stop( &dcmotor17, DCMOTOR17_SEL_OUT_A );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, "----------------------------\r\n" );
    log_printf( &logger, "          Motor B           \r\n" );
    log_printf( &logger, "----------------------------\r\n" );
    log_printf( &logger, "  Start the motor forward.  \r\n" );
    dcmotor17_forward( &dcmotor17, DCMOTOR17_SEL_OUT_B );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, "----------------------------\r\n" );
    log_printf( &logger, "       Stop the motor.      \r\n" );
    dcmotor17_stop( &dcmotor17, DCMOTOR17_SEL_OUT_B );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, "----------------------------\r\n" );
    log_printf( &logger, "  Start the motor reverse.  \r\n" );
    dcmotor17_reverse( &dcmotor17, DCMOTOR17_SEL_OUT_B );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, "----------------------------\r\n" );
    log_printf( &logger, "       Stop the motor.      \r\n" );
    dcmotor17_stop( &dcmotor17, DCMOTOR17_SEL_OUT_B );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on mikroE github account.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.DcMotor17

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 Mikroelektronika compilers.


ALSO FROM THIS AUTHOR

IR Grid 2 click

0

IR Grid 2 click is a thermal imaging sensor. It has an array of 768 very sensitive factory calibrated IR elements (pixels), arranged in 32 rows of 24 pixels. Each one of them is measuring an object temperature up to 300˚C within its local Field of View (FOV). The MLX90640ESF-BAB IR sensor used on this Click board™ has just four pins, and it is mounted inside of the industry standard TO39 package. It is equipped with 2Kbit of EEPROM for storing the compensation and calibration parameters.

[Learn More]

Thunder EMU click

0

Thunder EMU Click is a compact add-on board that can be used to emulate lightning. This board features circuits that generate an RF signal that mimics lightning strikes. It is a thunder emulator board that allows you to mimic lightning signals that can represent different distances, thus enabling you to debug your lightning detector application for all kinds of scenarios. The RF signal has an effective range of about 5 – 15cm from the emulator antenna of this Click board™ to the sensor antenna.

[Learn More]

LTE IoT click

5

LTE IoT click is a Click board that allows connection to the LTE and 2G networks, featuring the compact form-factor SARA R410 LTE/2G module, which offers two LTE technologies aimed at Machine to Machine communication (M2M) and the Internet of Things (IoT).

[Learn More]