TOP Contributors

  1. MIKROE (2662 codes)
  2. Alcides Ramos (357 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 (137038 times)
  2. FAT32 Library (70167 times)
  3. Network Ethernet Library (56038 times)
  4. USB Device Library (46362 times)
  5. Network WiFi Library (41978 times)
  6. FT800 Library (41309 times)
  7. GSM click (29079 times)
  8. mikroSDK (26519 times)
  9. PID Library (26453 times)
  10. microSD click (25449 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: 3291 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

IR Reflect click

6

IR reflect click carries a GP2S700HCP reflective photointerrupter. The infrared beam from the emitter gets bounced back to the receiver when an object is placed within the detecting range of the sensor (optimal range is 3mm).

[Learn More]

LCD mini click

0

LCD mini click displays 16x2 monochrome characters on an LMB162XFW LCD display. It features the MCP23S17 port expander and the MCP4161 digital potentiometer, both from Microchip. LCD mini click is designed to run on either 3.3V or 5V power supply.

[Learn More]

Ambient 15 click

0

Ambient 15 Click is a compact add-on board used to measure the amount of the present ambient light. This board features the TSL2584TSV, a very-high sensitivity light-to-digital converter with an I2C interface that transforms light intensity into a digital output signal from AMS-AG. The TSL2584TSV’s near-photopic response produces a highly accurate lux measurement up to 33klx even when mounted behind dark glass. Filtering out unwanted IR light enables the sensor to measure the ambient light more accurately, thus producing a near-photopic response.

[Learn More]