Smart Buck 7 Click
Smart Buck 7 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.
Click Library
- Author : Stefan Filipovic
- Date : May 2025.
- Type : I2C type
Software Support
Example Description
This example demonstrates the use of the Smart Buck 7 Click board. The application cyclically enables different combinations of the four buck converter outputs (1.2V, 1.8V, 2.5V, and 3.3V) and logs which outputs are currently active. It also monitors the PG (Power Good) pin and logs any fault conditions, including undervoltage and over-temperature events.
Example Libraries
- MikroSDK.Board
- MikroSDK.Log
- Click.SmartBuck7
Example Key Functions
- smartbuck7_cfg_setup This function initializes Click configuration structure to initial values.
void smartbuck7_cfg_setup(smartbuck7_cfg_t *cfg)
Smart Buck 7 configuration object setup function.
Smart Buck 7 Click configuration object.
Definition smartbuck7.h:185
- smartbuck7_init This function initializes all necessary pins and peripherals used for this Click board.
err_t smartbuck7_init(smartbuck7_t *ctx, smartbuck7_cfg_t *cfg)
Smart Buck 7 initialization function.
Smart Buck 7 Click context object.
Definition smartbuck7.h:165
- smartbuck7_default_cfg This function executes a default configuration of Smart Buck 7 Click board.
err_t smartbuck7_default_cfg(smartbuck7_t *ctx)
Smart Buck 7 default configuration function.
- smartbuck7_get_pg_pin This function reads the logic level of the PG pin.
uint8_t smartbuck7_get_pg_pin(smartbuck7_t *ctx)
Smart Buck 7 get power-good pin function.
- smartbuck7_enable_buck This function enables one or more buck regulators by setting their control bits.
err_t smartbuck7_enable_buck(smartbuck7_t *ctx, uint8_t buck_sel)
Smart Buck 7 enable selected buck function.
- smartbuck7_disable_buck This function disables one or more buck regulators by clearing their control bits.
err_t smartbuck7_disable_buck(smartbuck7_t *ctx, uint8_t buck_sel)
Smart Buck 7 disable selected buck function.
Application Init
Initializes the logger and the Smart Buck 7 Click driver, and applies the default configuration.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define SMARTBUCK7_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition smartbuck7.h:140
void application_init(void)
Definition main.c:46
@ SMARTBUCK7_ERROR
Definition smartbuck7.h:204
Application Task
Cycles through various buck output combinations, logs the enabled outputs, checks the PG pin for fault indication, and logs any detected fault status.
{
{
log_printf( &logger, "\r\n Fault indication detected via PG pin!\r\n" );
{
smartbuck7_display_status ( status );
}
}
{
{
log_printf( &logger, "\r\n Outputs enabled: - NONE -\r\n" );
}
}
{
log_printf( &logger, "\r\n Outputs enabled: -" );
{
log_printf( &logger, " 3.3V -" );
}
{
log_printf( &logger, " 1.2V -" );
}
{
log_printf( &logger, " 1.8V -" );
}
{
log_printf( &logger, " 2.5V -" );
}
log_printf( &logger, "\r\n" );
}
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
#define SMARTBUCK7_BUCK_1
Definition smartbuck7.h:97
#define SMARTBUCK7_BUCK_4
Smart Buck 7 buck selection setting.
Definition smartbuck7.h:94
#define SMARTBUCK7_BUCK_2
Definition smartbuck7.h:96
#define SMARTBUCK7_BUCK_3
Definition smartbuck7.h:95
#define SMARTBUCK7_BUCK_ALL
Definition smartbuck7.h:98
err_t smartbuck7_read_status(smartbuck7_t *ctx, smartbuck7_status_t *status)
Smart Buck 7 read status registers function.
err_t smartbuck7_clear_status(smartbuck7_t *ctx)
Smart Buck 7 clear status flags function.
void application_task(void)
Definition main.c:82
@ SMARTBUCK7_OK
Definition smartbuck7.h:203
Smart Buck 7 Click status object.
Definition smartbuck7.h:154
Note
Ensure all outputs are properly loaded and that the input voltage is within recommended levels to evaluate fault detection reliably.
Application Output
This Click board can be interfaced and monitored in two ways:
- Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
- UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.
Additional Notes and Information
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.