Buck 14 click
The Buck 14 Click is a Click boardâ„¢ based around the BMR4613001/001, a PoL regulator from Flex. It's high-efficiency step-down converter which provides a highly regulated output voltage derived from the connected power source, rated from 4.5 to 14V.
click Product page
Click library
- Author : MikroE Team
- Date : Jan 2020.
- Type : I2C type
Software Support
We provide a library for the Buck14 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
Library Description
This library contains API for Buck14 Click driver.
Standard key functions :
- Config Object Initialization function.
void buck14_cfg_setup ( buck14_cfg_t *cfg );
- Initialization function.
BUCK14_RETVAL buck14_init ( buck14_t *ctx, buck14_cfg_t *cfg );
- Click Default Configuration function.
void buck14_default_cfg ( buck14_t *ctx );
Example key functions :
- This function sets state of the power control pin on cs.
void buck14_power_ctrl ( buck14_t *ctx, uint8_t state );
- This function gets manufacturer id.
uint8_t buck14_salert ( buck14_t *ctx );
- This function sets output V.
uint8_t buc14_write_vout ( buck14_t *ctx, float vout );
Examples Description
This app enables usage of high-efficiency step-down converter.
The demo application is composed of two sections :
Application Init
Configure device.
{
log_cfg_t log_cfg;
uint8_t write_data;
uint8_t status_data;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
Delay_ms ( 300 );
log_printf( &logger, "-Device ID OK!\r\n" );
log_printf( &logger, " ***** App init ***** \r\n" );
log_printf( &logger, "----------------------\r\n" );
Delay_ms ( 100 );
}
#define BUCK14_CMD_OPERATION
Definition buck14.h:96
#define BUCK14_CTRL_ENABLE_NO_MARGIN
Definition buck14.h:248
#define BUCK14_MAP_MIKROBUS(cfg, mikrobus)
Definition buck14.h:66
#define BUCK14_PIN_STATE_HIGH
Definition buck14.h:268
void buck14_reset(buck14_t *ctx)
Reset function.
void buck14_power_ctrl(buck14_t *ctx, uint8_t state)
Set power ctrl function.
uint8_t buck14_check_mfr_id(buck14_t *ctx)
Fucntion for checking manufacturer id.
void buck14_default_cfg(buck14_t *ctx)
Click Default Configuration function.
void buck14_generic_write(buck14_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
BUCK14_RETVAL buck14_init(buck14_t *ctx, buck14_cfg_t *cfg)
Initialization function.
void buck14_cfg_setup(buck14_cfg_t *cfg)
Config Object Initialization function.
void application_init(void)
Definition main.c:65
void error_handler(uint8_t stat_data)
Definition main.c:37
Click configuration structure definition.
Definition buck14.h:325
Application Task
Sends 4 different commands for VOUT in span of 8sec
{
uint8_t status_data;
float vout_value;
vout_value = 1.2;
{
}
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
vout_value = 3.7;
{
}
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
vout_value = 2.5;
{
}
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
vout_value = 4.5;
{
}
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, "```````````````\r\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
#define BUCK14_SUCCESSFUL
Definition buck14.h:276
uint8_t buc14_write_vout(buck14_t *ctx, float vout)
Set Vout function.
void application_task(void)
Definition main.c:109
void read_vout_data(buck14_t *ctx)
Definition main.c:55
Note
When you send data you should send LSB first. Device input V should be beetween 4.5 - 14 V. Device output V could be from 0.5 - 5 V deepending from limits you set currently it is set to 1V.
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
Other mikroE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Buck14
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.