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 (136552 times)
  2. FAT32 Library (69748 times)
  3. Network Ethernet Library (55850 times)
  4. USB Device Library (46189 times)
  5. Network WiFi Library (41812 times)
  6. FT800 Library (41005 times)
  7. GSM click (28930 times)
  8. PID Library (26386 times)
  9. mikroSDK (26292 times)
  10. microSD click (25304 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: 3258 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

Microwave 4 click

0

Microwave 4 Click is a compact add-on board that utilizes the Doppler Shift Phenomenon to sense motion. This board features the PD-V12, a miniature high-frequency microwave transceiver from Ningbo Pdlux Electronic Technology. The transmitter on this transceiver works on a 24.1GHz frequency over the flat Plane antenna.

[Learn More]

PROFET 2 7A click

0

PROFET 2 Click is a compact add-on board that contains a smart high-side power switch. This board features the BTS70082EPAXUMA1, a dual-channel, high-side power switch with embedded protection and diagnosis feature from Infineon Technologies.

[Learn More]

AWS IoT click

0

AWS IoT Click is a compact add-on board that allows users to easily connected to AWS IoT services and securely interact with cloud applications and other devices. This board features the ESP32-C3-MINI-1-N4-A, a small 2.4GHz WiFi (802.11 b/g/n) and Bluetooth® 5 module from Espressif Systems that use ESP32C3 series of SoC RISCV single-core microprocessor (ESP32-C3FN4) with 4MB flash in a single chip package. The module uses UART communication alongside several other features like standalone possibility via USB interface, firmware boot, JTAG for debugging, and others.

[Learn More]