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-19
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Buck
Downloaded: 3302 times
Not followed.
License: MIT license
Buck 13 Click is a high-efficiency step-down converter which provides a highly regulated output voltage derived from the connected power source, rated from 4.5V to 5.5V.
Do you want to subscribe in order to receive notifications regarding "Buck 13 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Buck 13 click" changes.
Do you want to report abuse regarding "Buck 13 click".
Library Description
This library performs a control of the Buck 13 click board, which is used to convert the input DC voltage, in the range from 6.5V to 50V, to output DC voltage of 3.3V, with maximal current of 3A. Library uses SPI serial interface to allow the ADC output reading from the Buck 13. For more details check documentation.
Key functions:
void buck13_spiDriverInit( T_BUCK13_P gpioObj, T_BUCK13_P spiObj )
- This function initializes SPI serial interface.void buck13_enable( T_BUCK13_STATE pwr_state )
- This function allows user to perform a control of the Buck 13 output.uint16_t buck13_getVoltage( void )
- This function returns the output voltage value calculated to millivolts.Examples description
The application is composed of three sections :
void applicationTask()
{
rx_dat = UART_Rdy_Ptr();
if (rx_dat != 0)
{
rx_dat = UART_Rd_Ptr();
switch (rx_dat)
{
case 'e' :
{
if (out_state == _BUCK13_DISABLE)
{
buck13_enable( _BUCK13_ENABLE );
out_state = _BUCK13_ENABLE;
mikrobus_logWrite( "** Buck 13 output is enabled now.", _LOG_LINE );
}
else
{
mikrobus_logWrite( "** Buck 13 output is already enabled.", _LOG_LINE );
}
break;
}
case 'd' :
{
if (out_state == _BUCK13_ENABLE)
{
buck13_enable( _BUCK13_DISABLE );
out_state = _BUCK13_DISABLE;
mikrobus_logWrite( "** Buck 13 output is disabled now.", _LOG_LINE );
}
else
{
mikrobus_logWrite( "** Buck 13 output is already disabled.", _LOG_LINE );
}
break;
}
case 'v' :
{
out_voltage = buck13_getVoltage();
WordToStr( out_voltage, text );
Ltrim( text );
mikrobus_logWrite( "** VOUT = ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( " mV.", _LOG_LINE );
break;
}
case 'c' :
{
writeCmd();
break;
}
default :
{
mikrobus_logWrite( "***** Invalid command. *****", _LOG_LINE );
writeCmd();
break;
}
}
}
}
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.