TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (91 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 (139275 times)
  2. FAT32 Library (71759 times)
  3. Network Ethernet Library (57128 times)
  4. USB Device Library (47434 times)
  5. Network WiFi Library (43098 times)
  6. FT800 Library (42409 times)
  7. GSM click (29835 times)
  8. mikroSDK (28106 times)
  9. PID Library (26886 times)
  10. microSD click (26201 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: 3806 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

AccelQvar Click

0

Accel&Qvar Click is a compact add-on board for capturing precise acceleration measurements and detecting electric charge variations. This board features the LIS2DUXS12, an ultralow-power accelerometer from STMicroelectronics. Besides low power consumption, it also includes Qvar technology, artificial intelligence, and an anti-aliasing filter. This digital, 3-axis accelerometer has adjustable full scales (±2g to ±16g), output data rates (1.6Hz to 800Hz), and multiple operating modes to serve various applications.

[Learn More]

6DOF IMU Click

0

6DOF IMU Click carries ST’s LSM6DS33TR 6-axis inertial measurement unit comprising a 3-axis gyroscope and a 3-axis accelerometer. The chip is a highly accurate 6 DOF inertial measurement unit with long-term stable operation over a wide range of temperatures.

[Learn More]

LED Driver 13 Click

0

LED Driver 13 Click is a compact add-on board that simplifies the control of multiple LEDs. This board features the A80604-1, a 4-channel LED driver designed at a switching frequency of 400kHz that provides 150mA per channel from Allegro Microsystems. It is powered by an external power supply in the range of 6V to 18V, providing an output voltage of approximately 26V, which is used to power LEDs connected to LED channels. On the logical side, this board uses both 3V3 and 5V with mikroBUS™ power rails and communicates with the MCU via GPIO pins. In addition, the user is given the option of analog or digital LED dimming selection, using a PWM pin from the mikroBUS™ socket or via an onboard potentiometer/external PWM signal.

[Learn More]