TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 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 (137097 times)
  2. FAT32 Library (70236 times)
  3. Network Ethernet Library (56124 times)
  4. USB Device Library (46434 times)
  5. Network WiFi Library (42073 times)
  6. FT800 Library (41387 times)
  7. GSM click (29116 times)
  8. mikroSDK (26562 times)
  9. PID Library (26489 times)
  10. microSD click (25487 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

H-Bridge 6 click

Rating:

5

Author: MIKROE

Last Updated: 2021-08-06

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Brushed

Downloaded: 1242 times

Not followed.

License: MIT license  

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.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "H-Bridge 6 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "H-Bridge 6 click" changes.

Do you want to report abuse regarding "H-Bridge 6 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
mikroC 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

H-Bridge 6 Click

H-Bridge 6 Click

Native view of the H-Bridge 6 Click board.

View full image
H-Bridge 6 Click

H-Bridge 6 Click

Front and back view of the H-Bridge 6 Click board.

View full image

Library Description

The library covers all the necessary functions to control the H-Bridge 6 Click board™. A library performs communication with the device via the I2C interface. Using the PWM function, we can adjust the engine speed and direction.

Key functions:

  • void hbridge6_generic_write ( uint8_t reg, uint8_t tx_data ) - Generic write function.
  • uint8_t hbridge6_generic_read ( uint8_t reg ) - Generic read function.
  • void hbridge6_set_direction ( uint8_t direction ) - Set the direction function.

Examples description

The application is composed of three sections :

  • System Initialization - Initializes I2C and start to write log.
  • Application Initialization - Initialization driver enables - I2C, reset the device and set default configuration, initialization and configure the PWM, also write log.
  • Application Task - (code snippet) This is an example that demonstrates the use of H-Bridge 6 Click board™. It shows moving in the clockwise direction of rotation and moving in the counterclockwise direction of rotation from slow to fast speed. All data logs write on USB uart changes.
void application_task ( )
{
    mikrobus_logWrite( "-----------------------", _LOG_LINE );
    mikrobus_logWrite( "       Clockwise       ", _LOG_LINE );
    hbridge6_set_direction( HBRIDGE6_DIRECTION_CLOCKWISE );
    pwm_duty_cycle = 100;
    
    while ( pwm_duty_cycle < ( pwm_max_duty / 3 ) )
    {
        pwm_duty_cycle += 50;
        mikrobus_logWrite( " >", _LOG_TEXT );
        hbridge6_pwm_set_duty( pwm_duty_cycle );
        Delay_ms( 100 );
    }
    
    mikrobus_logWrite( "", _LOG_LINE );
    mikrobus_logWrite( "-----------------------", _LOG_LINE );
    mikrobus_logWrite( "         Brake         ", _LOG_LINE );
    hbridge6_set_direction( HBRIDGE6_DIRECTION_BRAKE );
    Delay_ms( 3000 );

    mikrobus_logWrite( "-----------------------", _LOG_LINE );
    mikrobus_logWrite( "    Counterclockwise   ", _LOG_LINE );
    hbridge6_set_direction( HBRIDGE6_DIRECTION_COUNTERCLOCKWISE );
    pwm_duty_cycle = 100;
    Delay_ms( 1000 );

    while ( pwm_duty_cycle < ( pwm_max_duty / 3 ) )
    {
        pwm_duty_cycle += 50;
        mikrobus_logWrite( " <", _LOG_TEXT );
        hbridge6_pwm_set_duty( pwm_duty_cycle );
        Delay_ms( 100 );
    }
    
    mikrobus_logWrite( "", _LOG_LINE );
    mikrobus_logWrite( "-----------------------", _LOG_LINE );
    mikrobus_logWrite( "         Brake         ", _LOG_LINE );
    hbridge6_set_direction( HBRIDGE6_DIRECTION_BRAKE );
    Delay_ms( 1000 );
    
    hbridge6_pwm_stop( );
    Delay_ms( 2000 );
    hbridge6_pwm_start( );
    Delay_ms( 1000 );
}


 

  • uint32_t hbridge6_pwm_init ( uint16_t freq ) - Initializes the Timer module in PWM mode.
  • void hbridge6_pwm_set_duty ( uint16_t duty ) - The function changes PWM duty ratio.
  • void hbridge6_pwm_start( ) - Starts appropriate PWM module.
  • void hbridge6_pwm_stop( ) - Stops appropriate PWM module.

Other mikroE Libraries used in the example:

  • I2C
  • PWM
  • UART

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

SPI Extend click

5

SPI Extend Click is a compact add-on board for applications that require extending the SPI communication bus over a long distance. This board features the LTC4332, an SPI slave extender device, from Analog Devices.

[Learn More]

ECG 5 click

0

ECG 5 click can be used for the development of ECG and Heart-Rate (HR) applications. The Click board™ features the AD8232, an integrated bio-signal front end. This IC has many features necessary for providing accurate ECG measurements, including very high common-mode rejection ratio, high gain with DC blocking capability, adjustable high-pass and low-pass filters, integrated right leg drive (RLD), etc.

[Learn More]

AC Current click

6

AC Current click can measure alternating currents up to 30A and it features the MCP3201 ADC (analog to digital) converter and the MCP607 CMOS Op Amp, both from Microchip. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target MCU over an SPI interface, and the AN pin on the mikroBUS line.

[Learn More]