TOP Contributors

  1. MIKROE (2650 codes)
  2. Alcides Ramos (350 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 (136539 times)
  2. FAT32 Library (69736 times)
  3. Network Ethernet Library (55842 times)
  4. USB Device Library (46178 times)
  5. Network WiFi Library (41801 times)
  6. FT800 Library (40989 times)
  7. GSM click (28923 times)
  8. PID Library (26384 times)
  9. mikroSDK (26281 times)
  10. microSD click (25299 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

Brushless 20 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.9

mikroSDK Library: 2.0.0.0

Category: Brushless

Downloaded: 72 times

Not followed.

License: MIT license  

Brushless 20 Click is a compact add-on board that controls brushless DC (BLDC) motors with any MCU. This board features the DRV8313, a fully integrated three-phase BLDC motor driver from Texas Instruments. It provides three individually controllable half-H-bridge drivers intended to drive a three-phase BLDC motor, solenoids, or other loads. Each output driver channel consists of N-channel power MOSFETs configured in a 1/2-H-bridge configuration. Besides, it has a wide operating voltage range from 8V to 60V, alongside several built-in protection circuits such as undervoltage, charge pump faults, overcurrent, and overtemperature.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Brushless 20 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Brushless 20 click" changes.

Do you want to report abuse regarding "Brushless 20 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Brushless 20 click

Brushless 20 Click is a compact add-on board that controls brushless DC (BLDC) motors with any MCU. This board features the DRV8313, a fully integrated three-phase BLDC motor driver from Texas Instruments. It provides three individually controllable half-H-bridge drivers intended to drive a three-phase BLDC motor, solenoids, or other loads. Each output driver channel consists of N-channel power MOSFETs configured in a 1/2-H-bridge configuration. Besides, it has a wide operating voltage range from 8V to 60V, alongside several built-in protection circuits such as undervoltage, charge pump faults, overcurrent, and overtemperature.

brushless20_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Jul 2022.
  • Type : I2C type

Software Support

We provide a library for the Brushless 20 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 Brushless 20 Click driver.

Standard key functions :

  • brushless20_cfg_setup Config Object Initialization function.

    void brushless20_cfg_setup ( brushless20_cfg_t *cfg );
  • brushless20_init Initialization function.

    err_t brushless20_init ( brushless20_t *ctx, brushless20_cfg_t *cfg );
  • brushless20_default_cfg Click Default Configuration function.

    err_t brushless20_default_cfg ( brushless20_t *ctx );

Example key functions :

  • brushless20_perform_com_sequence This function performs a single commutation sequence for the selected rotation direction at a desired speed.

    err_t brushless20_perform_com_sequence ( brushless20_t *ctx, uint8_t dir, uint8_t speed );
  • brushless20_drive_motor This function drives the motor for a desired time by performing multiple commutation sequences for the selected rotation direction at a desired speed.

    err_t brushless20_drive_motor ( brushless20_t *ctx, uint8_t dir, uint8_t speed, uint32_t time_ms );
  • brushless20_get_fault_pin This function returns the fault pin logic state.

    err_t brushless20_get_fault_pin ( brushless20_t *ctx );

Example Description

This example demonstrates the use of the Brushless 20 click board by driving the motor in both directions at different speeds.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the click default configuration.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    brushless20_cfg_t brushless20_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_info( &logger, " Application Init " );

    // Click initialization.
    brushless20_cfg_setup( &brushless20_cfg );
    BRUSHLESS20_MAP_MIKROBUS( brushless20_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == brushless20_init( &brushless20, &brushless20_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( BRUSHLESS20_ERROR == brushless20_default_cfg ( &brushless20 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
}

Application Task

Drives the motor in both directions and changes the motor speed every 3 seconds approximately. The current driving direction and speed will be displayed on the USB UART.

void application_task ( void )
{
    log_printf ( &logger, "\r\n Driving motor clockwise \r\n" );
    for ( uint8_t speed = BRUSHLESS20_SPEED_MIN; speed <= BRUSHLESS20_SPEED_MAX; speed += 20 )
    {
        log_printf ( &logger, " Speed: %u\r\n", ( uint16_t ) speed );
        if ( BRUSHLESS20_OK != brushless20_drive_motor ( &brushless20, BRUSHLESS20_DIR_CW, speed, 3000 ) )
        {
            log_error ( &logger, " Drive motor " );
        }
    }
    Delay_ms ( 1000 );
    log_printf ( &logger, "\r\n Driving motor counter-clockwise \r\n" );
    for ( uint8_t speed = BRUSHLESS20_SPEED_MIN; speed <= BRUSHLESS20_SPEED_MAX; speed += 20 )
    {
        log_printf ( &logger, " Speed: %u\r\n", ( uint16_t ) speed );
        if ( BRUSHLESS20_OK != brushless20_drive_motor ( &brushless20, BRUSHLESS20_DIR_CCW, speed, 3000 ) )
        {
            log_error ( &logger, " Drive motor " );
        }
    }
    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.Brushless20

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

RS485 7 click

0

RS485 7 Click is a compact add-on board that enables communication over an RS485 network. This board features the THVD1424, a full duplex RS485 transceiver with a selectable data rate from Texas Instruments. The THVD1424 offers several pin-controlled features, including an on-chip 120Ω termination resistor, slew rate control, and the ability to switch between half and full duplex mode. With its high immunity to IEC Contact Discharge ESD events, the bus pins require no additional system-level protection components. Additionally, the chip is known for its low power consumption and glitch-free power-up/power-down functionality, which enables hot plug-in capability.

[Learn More]

CDC click

0

CDC Click is a compact add-on board that allows your application do a conversion of capacitance to a digital format. This board features the PCAP04, a capacitance-to-digital converter (CDC) from ScioSense. It also includes an integrated digital signal processor (DSP) for on-chip data post-processing. The converter has high flexibility and allows you to convert grounded capacitors and floating capacitors to a digital format. It has up to 50KHz sampling rate in up to 20-bit resolution.

[Learn More]

mikromedia plus for STM32 and SpeakUp Chess

6

We challenge you to beat an STM32 it in a blitz game. Our chief of software can do it fairly consistently. How well will you fare? You can use the SpeakUp to speak out your moves while you skim a book on chess openings.

[Learn More]