TOP Contributors

  1. MIKROE (2664 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 (137142 times)
  2. FAT32 Library (70243 times)
  3. Network Ethernet Library (56133 times)
  4. USB Device Library (46450 times)
  5. Network WiFi Library (42109 times)
  6. FT800 Library (41410 times)
  7. GSM click (29125 times)
  8. mikroSDK (26570 times)
  9. PID Library (26512 times)
  10. microSD click (25507 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: 3319 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

Brushless 21 click

0

Brushless 21 Click is a compact add-on board suitable for controlling brushless DC (BLDC) motors with any MCU. This board features the AMT49400, an advanced 3-phase, sensorless BLDC motor driver with integrated power MOSFETs from Allegro Microsystems. The AMT49400 is rated for an operating voltage range from 4V to 16V. Motor rotation speed is controlled by applying a duty cycle command to the PWM input, while a simple I2C interface is provided for setting motor-rated voltage, rated current, rated speed, resistance, and startup profiles.

[Learn More]

3G-EA click

0

3G-EA click is a versatile cellular network communication solution, featuring the compact 3G UMTS/HSPA Quectel UG95 module. This module features a full set of options for the cellular networking and communication, such as the network indication, embedded TCP/UDP stack, HTTP/HTTPS stack, full GSM/GPRS/EDGE implementation, UMTS/HSDPA/HSUPA protocol implementation and more. 3G-EA click features data-rates of 7.2 Mb/s (downlink) and 5.76 Mb/s (uplink) in HSPA mode. Onboard 16bit audio CODEC IC adds high-quality voice communication capability.

[Learn More]

Thermo 23 click

0

Thermo 23 Click is a compact add-on board that provides an accurate temperature measurement. This board features the TMP144, a high-precision digital temperature sensor from Texas Instruments. The temperature sensor in the TMP144 is the chip itself, that houses temperature sensor circuitry, 12-bit analog-to-digital converter (ADC), a control logic, and a serial interface block in one package. Characterized by its high accuracy (up to ±0.5°C typical) and high resolution of 0.0625°C, this temperature sensor provides temperature data to the host controller with a configurable UART interface.

[Learn More]