TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 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 (139248 times)
  2. FAT32 Library (71743 times)
  3. Network Ethernet Library (57115 times)
  4. USB Device Library (47428 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42403 times)
  7. GSM click (29835 times)
  8. mikroSDK (28073 times)
  9. PID Library (26885 times)
  10. microSD click (26198 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 3 click

Rating:

5

Author: MIKROE

Last Updated: 2019-07-01

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Stepper

Downloaded: 3801 times

Not followed.

License: MIT license  

H-Bridge 3 Click is designed for the control of small DC motors and inductive loads, it features TLE9201SG a general purpose 6A H-Bridge perfectly suited for industrial and automotive applications.

No Abuse Reported

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

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

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

H-Bridge 3 Click

Native view of the H-Bridge 3 Click board.

View full image
H-Bridge 3 Click

H-Bridge 3 Click

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

View full image

Library Description

The library contains all the necessary functions for converting ADC values to real voltages and pressure values.

Key functions:

  • void hbridge3_anSet( uint8_t pin_state ) - sets AN pin state.
  • void hbridge3_rstSet( uint8_t pin_state ) - sets RST pin state.
  • uint8_t hbridge3_spi( uint8_t spi_command ) - sends SPI command and receives response to command sent.

Examples description

The application is composed of three sections :

  • System Initialization - Initializes SPI and LOG modules, AN, RST, CS and PWM pins .
  • Application Initialization - Initializes SPI driver and PWM module, sets minimum PWM duty cycle and starts PWM .
  • Application Task - Checks for user input and based on entered character executes one of additional functions. Checks for diagnosis register change and if it had changed, logs status message.
void applicationTask( )
{
    uart_flag = UART_Data_Ready( );
    if ( uart_flag == 1 )
    {
        uart_char = UART_Read( );
        switch (uart_char)
        {
            case '+' :
            {
                hbridge3_casePlus( );
                break;
            }
            case '-' :
            {
                hbridge3_caseMinus( );
                break;
            }
            case 'd' :
            {
                hbridge3_caseDiagnosis( );
                break;
            }
            case '1' :
            {
                hbridge3_caseDirection1( );
                break;
            }
            case '2' :
            {
                hbridge3_caseDirection2( );
                break;
            }
            case '0' :
            {
                hbridge3_caseOnOff( );
                break;
            }
            default :
            {
                mikrobus_logWrite( "> Invalid command", _LOG_LINE );
                break;
            }
        }
    }

    spi_response = hbridge3_spi( _HBRIDGE3_CMD_RD_DIA );
    diagnosis_new = spi_response & 0x0F;
    if (diagnosis_new != diagnosis_old)
    {
        hbridge3_logDiagnosis( diagnosis_new );
        diagnosis_old = diagnosis_new;
    }

    if (( spi_response & 0x40 ) == 0x00 )
    {
        mikrobus_logWrite( "> Overtemperature shutdown", _LOG_LINE );
    }
    if (( spi_response & 0x10 ) == 0x00 )
    {
        mikrobus_logWrite( "> Current limitation active", _LOG_LINE );
    }
}

Additional Functions :

  • void hbridge3_casePlus( ) - Increments duty cycle
  • void hbridge3_caseMinus( ) - Decrements duty cycle
  • void hbridge3_caseDiagnosis( ) - Gets diagnosis register content and logs status message
  • void hbridge3_caseDirection1( ) - Changes rotation direction to direction 1
  • void hbridge3_caseDirection2( ) - Changes rotation direction to direction 2
  • void hbridge3_caseOnOff( ) - Switches oputput MOSFETs on and off

Other mikroE Libraries used in the example:

  • SPI
  • 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

Charger 5 Click

0

Charger 5 Click is designed to charge Lithium-Ion and Lithium-Polymer batteries.

[Learn More]

GNSS 16 Click

0

GNSS 16 Click is a compact add-on board that delivers meter-level accuracy in urban environments. This Click board™ features the NEO-F10N-00B, a professional-grade L1/L5 dual-band GNSS receiver from u-blox. It features dual-band multipath mitigation technology to ensure robust signal reception and supports multiple GNSS systems, including GPS, Galileo, and BeiDou. Configurable for specific constellations, it optimizes power consumption while maintaining high performance.

[Learn More]

Rec N Play Click

0

Rec&Play Click is a digital voice recorder on a Click board™. It is based on the ISD3900, a multi-message record and playback device. It features the ChipCorder® technology, offering digital sound compression, smart message management, digitally configurable signal path, and more.

[Learn More]