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]
Rating:
Author: MIKROE
Last Updated: 2019-07-01
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Stepper
Downloaded: 3862 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.
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".
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 :
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 :
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB 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.