charger6 2.0.0.0
Main Page

Charger 6 click

Charger 6 Click is a compact add-on board that represents a single-cell battery charger. This board features the BQ25601, an I2C controlled battery charger for high input voltage and narrow voltage DC power path management from Texas Instruments. This buck charger supports USB, and it’s optimized for USB voltage input. The low impedance power path optimizes switch-mode operation efficiency, reduces battery charging time, and extends battery life during discharge. It also has a programmable current limiting, allowing it to use an external power supply rated up to 13.5V. This Click board™ is suitable as a Li-Ion and Li-polymer battery charger for portable devices and accessories, power tools, and more.

click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Feb 2021.
  • Type : I2C type

Software Support

We provide a library for the Charger6 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on mikroE github account.

Library Description

‍This library contains API for Charger6 Click driver.

Standard key functions :

Example key functions :

Example Description

‍This library contains API for the Charger 6 Click driver. The library contains drivers to enable/disable battery charging, set current limit, set system min voltage, set fast charge current, set charge voltage, etc.

The demo application is composed of two sections :

Application Init

‍Initializes I2C driver and set default configuration: input current limit set to 500 mA, system minimum voltage to 3500 mV, fast charge current set to 360 mA, charge voltage to 4112 mV and enable battery charging.

void application_init ( void ) {
log_cfg_t log_cfg;
charger6_cfg_t charger6_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
charger6_cfg_setup( &charger6_cfg );
CHARGER6_MAP_MIKROBUS( charger6_cfg, MIKROBUS_1 );
err_t init_flag = charger6_init( &charger6, &charger6_cfg );
if ( init_flag == I2C_MASTER_ERROR ) {
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
charger6_default_cfg ( &charger6 );
log_info( &logger, " Application Task " );
Delay_ms ( 1000 );
log_printf( &logger, "-------------------------------\r\n" );
log_printf( &logger, " Set Current Limit : 500 mA \r\n" );
Delay_ms ( 100 );
log_printf( &logger, " Set Sys Min Voltage : 3500 mV \r\n" );
Delay_ms ( 100 );
log_printf( &logger, " Set Fast Chg Current: 360 mA \r\n" );
Delay_ms ( 100 );
log_printf( &logger, " Set Charge Voltage : 4112 mV \r\n" );
charger6_set_charge_voltage( &charger6, 4112 );
Delay_ms ( 100 );
log_printf( &logger, " >> Enable Battery Charging << \r\n" );
Delay_ms ( 1000 );
log_printf( &logger, "-------------------------------\r\n" );
log_printf( &logger, " >>> Status <<< \r\n" );
log_printf( &logger, "-------------------------------\r\n" );
}
#define CHARGER6_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition charger6.h:425
err_t charger6_set_charge_voltage(charger6_t *ctx, uint16_t charge_voltage)
Charger 6 set charge voltage function.
err_t charger6_set_input_current_limit(charger6_t *ctx, uint16_t current_limit)
Charger 6 set input current limit function.
void charger6_enable_battery_charging(charger6_t *ctx)
Charger 6 charge enable function.
void application_init(void)
Definition main.c:148

Application Task

This example monitors the operation of the Charger 6 Click and all its charging states.

  • The user can observe information such as charging status, selected mode,
  • charging current value, and the momentary value
  • of the supply voltage relative to the battery voltage.
  • Results are being sent to the Usart Terminal where you can track their changes.
void application_task ( void ) {
Delay_ms ( 100 );
Delay_ms ( 100 );
Delay_ms ( 100 );
Delay_ms ( 100 );
Delay_ms ( 100 );
log_printf( &logger, "-------------------------------\r\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
void application_task(void)
Definition main.c:207
void display_power_good_status(void)
Definition main.c:67
void display_chrg_fault_status(void)
Definition main.c:122
void display_vsys_status(void)
Definition main.c:85
void display_chrg_status(void)
Definition main.c:39
void display_bat_status(void)
Definition main.c:104

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on mikroE github account.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Charger6

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. UART terminal is available in all Mikroelektronika compilers.