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: 2020-11-06
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Buck-Boost
Downloaded: 1882 times
Not followed.
License: MIT license
Buck & Boost Click is a compact add-on board that contains a configurable power management device. This board features the MIC7401, a highly-integrated power-management IC featuring five synchronous buck regulators, one boost regulator, and a high-speed I2C interface with an internal EEPROM memory from Microchip.
Do you want to subscribe in order to receive notifications regarding "Buck & Boost click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Buck & Boost click" changes.
Do you want to report abuse regarding "Buck & Boost click".
Library Description
The library covers all the necessary functions to control Buck & Boost Click board™. Library performs a standard I2C interface communication.
Key functions:
void buckandboost_device_enable ( uint8_t state )
- Enable device function.(uint8_t out_value )
- Set buck output voltage function.(buckandboost_status_t *s_data )
- Get status function.Examples description
The application is composed of three sections :
void application_task ( )
{
check_status = buckandboost_set_buck_out_voltage
( BUCKANDBOOST_OUTPUT_CH_1, BUCKANDBOOST_BUCK_OUTPUT_VOLTAGE_1800mV );
Delay_ms( 10 );
if ( check_status == BUCKANDBOOST_STATUS_OK )
{
mikrobus_logWrite( " Output Voltage 1 : 1.8V ", _LOG_LINE );
mikrobus_logWrite( "- - - - - - - - - - - - - - ", _LOG_LINE );
}
buckandboost_send_cmd ( BUCKANDBOOST_CMD_SAVECONFIG );
buckandboost_get_status ( BUCKANDBOOST_OUTPUT_CH_1, &status_data );
display_status( );
Delay_ms( 2000 );
check_status = buckandboost_set_buck_out_voltage
( BUCKANDBOOST_OUTPUT_CH_2, BUCKANDBOOST_BUCK_OUTPUT_VOLTAGE_1100mV );
Delay_ms( 10 );
if ( check_status == BUCKANDBOOST_STATUS_OK )
{
mikrobus_logWrite( " Output Voltage 2 : 1.1V ", _LOG_LINE );
mikrobus_logWrite( "- - - - - - - - - - - - - - ", _LOG_LINE );
}
buckandboost_send_cmd ( BUCKANDBOOST_CMD_SAVECONFIG );
buckandboost_get_status ( BUCKANDBOOST_OUTPUT_CH_2, &status_data );
display_status( );
Delay_ms( 2000 );
check_status = buckandboost_set_buck_out_voltage
( BUCKANDBOOST_OUTPUT_CH_3, BUCKANDBOOST_BUCK_OUTPUT_VOLTAGE_1800mV );
Delay_ms( 10 );
if ( check_status == BUCKANDBOOST_STATUS_OK )
{
mikrobus_logWrite( " Output Voltage 3 : 1.8V ", _LOG_LINE );
mikrobus_logWrite( "- - - - - - - - - - - - - - ", _LOG_LINE );
}
buckandboost_get_status ( BUCKANDBOOST_OUTPUT_CH_3, &status_data );
display_status( );
Delay_ms( 2000 );
check_status = buckandboost_set_buck_out_voltage
( BUCKANDBOOST_OUTPUT_CH_4, BUCKANDBOOST_BUCK_OUTPUT_VOLTAGE_1050mV );
Delay_ms( 10 );
if ( check_status == BUCKANDBOOST_STATUS_OK )
{
mikrobus_logWrite( " Output Voltage 4 : 1.05V ", _LOG_LINE );
mikrobus_logWrite( "- - - - - - - - - - - - - - ", _LOG_LINE );
}
buckandboost_get_status ( BUCKANDBOOST_OUTPUT_CH_4, &status_data );
display_status( );
Delay_ms( 2000 );
check_status = buckandboost_set_buck_out_voltage
( BUCKANDBOOST_OUTPUT_CH_5, BUCKANDBOOST_BUCK_OUTPUT_VOLTAGE_1250mV );
Delay_ms( 10 );
if ( check_status == BUCKANDBOOST_STATUS_OK )
{
mikrobus_logWrite( " Output Voltage 5 : 1.25V ", _LOG_LINE );
mikrobus_logWrite( "- - - - - - - - - - - - - - ", _LOG_LINE );
}
buckandboost_get_status ( BUCKANDBOOST_OUTPUT_CH_5, &status_data );
display_status( );
Delay_ms( 2000 );
check_status = buckandboost_set_boost_out_voltage
( BUCKANDBOOST_BOOST_OUTPUT_VOLTAGE_9000mV );
Delay_ms( 10 );
if ( check_status == BUCKANDBOOST_STATUS_OK )
{
mikrobus_logWrite( " Output Voltage 6 : 9.00V ", _LOG_LINE );
mikrobus_logWrite( "- - - - - - - - - - - - - - ", _LOG_LINE );
}
buckandboost_get_status ( BUCKANDBOOST_OUTPUT_CH_6, &status_data );
display_status( );
Delay_ms( 2000 );
}
void display_status ( void )
- Display status.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.