TOP Contributors

  1. MIKROE (2650 codes)
  2. Alcides Ramos (350 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136545 times)
  2. FAT32 Library (69739 times)
  3. Network Ethernet Library (55844 times)
  4. USB Device Library (46180 times)
  5. Network WiFi Library (41803 times)
  6. FT800 Library (40990 times)
  7. GSM click (28923 times)
  8. PID Library (26385 times)
  9. mikroSDK (26286 times)
  10. microSD click (25300 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

BATT-MAN 3 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.5

mikroSDK Library: 2.0.0.0

Category: Buck-Boost

Downloaded: 57 times

Not followed.

License: MIT license  

BATT-MAN 3 Click is a compact add-on board representing an advanced battery management solution. This board features the ADP5350, a power management IC with inductive boost LED, and three LDO regulators from Analog Devices. This I2C programmable board supports USB optimized for USB voltage input. It combines one high-performance buck regulator for single Li-Ion/Li-Ion polymer battery charging, a fuel gauge, a highly programmable boost regulator for LED backlight illumination, and three 150mA LDO regulators.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "BATT-MAN 3 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "BATT-MAN 3 click" changes.

Do you want to report abuse regarding "BATT-MAN 3 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


BATT-MAN 3 click

BATT-MAN 3 Click is a compact add-on board representing an advanced battery management solution. This board features the ADP5350, a power management IC with inductive boost LED, and three LDO regulators from Analog Devices. This I2C programmable board supports USB optimized for USB voltage input. It combines one high-performance buck regulator for single Li-Ion/Li-Ion polymer battery charging, a fuel gauge, a highly programmable boost regulator for LED backlight illumination, and three 150mA LDO regulators.

battman3_click.png

click Product page


Click library

  • Author : Luka Filipovic
  • Date : Oct 2021.
  • Type : I2C type

Software Support

We provide a library for the BATT-MAN3 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 BATT-MAN3 Click driver.

Standard key functions :

  • battman3_cfg_setup Config Object Initialization function.

    void battman3_cfg_setup ( battman3_cfg_t *cfg );
  • battman3_init Initialization function.

    err_t battman3_init ( battman3_t *ctx, battman3_cfg_t *cfg );
  • battman3_default_cfg Click Default Configuration function.

    err_t battman3_default_cfg ( battman3_t *ctx );

Example key functions :

  • battman3_get_battery_voltage Read battery voltage level.

    err_t battman3_get_battery_voltage ( battman3_t *ctx, float *vout );
  • battman3_set_ldo_vout Set voltage output on LDO.

    err_t battman3_set_ldo_vout ( battman3_t *ctx, battman3_ldo_t ldo, battman3_ldo_vout_t vout );
  • battman3_set_charge_termination_voltage Set charge termination voltage.

    err_t battman3_set_charge_termination_voltage ( battman3_t *ctx, float voltage );

Example Description

This example showcases ability of device to charge battery, and outputs and supply 4 different devices with 3 LDO's and 1 boost channel.

The demo application is composed of two sections :

Application Init

Initialization of the communication modules(UART, I2C) and 3 additional input pins(power good, battery ok, and interrupt). Configures device to enable charging, battery voltage monitoring, sets charging termination to 3.7V, charging threshold to 3.1V and dead battery to 2.5V. Enables all 3 LDO's( channel 1 -> 3.3V, channel 2 -> 1.5V, and channel 3 -> 2.5V ).


void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    battman3_cfg_t battman3_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    battman3_cfg_setup( &battman3_cfg );
    BATTMAN3_MAP_MIKROBUS( battman3_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == battman3_init( &battman3, &battman3_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( BATTMAN3_ERROR == battman3_default_cfg ( &battman3 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    uint8_t temp_data = 0;

    battman3_reg_read( &battman3, BATTMAN3_REG_MANUFACTURE_AND_MODEL_ID, &temp_data );
    log_printf( &logger, " > ID: 0x%.2X\r\n", ( uint16_t )temp_data );
    battman3_reg_read( &battman3, BATTMAN3_REG_SILICON_REVSION, &temp_data );
    log_printf( &logger, " > REV: 0x%.2X\r\n", ( uint16_t )temp_data );

    //Charging voltage termination
    battman3_set_charge_termination_voltage( &battman3, 3.7 );
    //Charging voltage threshold
    battman3_set_charge_voltage_threshold( &battman3, BATTMAN3_VTRK_DEAD_2p5V, 3.1 );
    //LDO 1
    battman3_set_ldo_state( &battman3, BATTMAN3_LDO1, BATTMAN3_ENABLE );
    battman3_set_ldo_vout( &battman3, BATTMAN3_LDO1, BATTMAN3_LDO_3p30V );
    //LDO 2
    battman3_set_ldo_state( &battman3, BATTMAN3_LDO2, BATTMAN3_ENABLE );
    battman3_set_ldo_vout( &battman3, BATTMAN3_LDO2, BATTMAN3_LDO_1p50V );
    //LDO 3
    battman3_set_ldo_state( &battman3, BATTMAN3_LDO3, BATTMAN3_ENABLE );
    battman3_set_ldo_vout( &battman3, BATTMAN3_LDO3, BATTMAN3_LDO_2p50V );

    log_info( &logger, " Application Task " );
    Delay_ms ( 500 );
}

Application Task

Reads battery voltage level and logs it. Besides that reads status and logs every change on charging and battery status. If power good flag occurs(PGD pin goes low) disables LDO's, and reenables them when battery is full(when battery reaches charging termination voltage).


void application_task ( void ) 
{
    static uint8_t counter = 0;
    static uint8_t ldo_enable = 1;
    float vbat = 0; 

    if ( !battman3_get_power_good( &battman3 ) && ldo_enable )
    {
        battman3_ldo( BATTMAN3_DISABLE );
        log_printf( &logger, " > Power is not good - LDO disabled\r\n" );
        ldo_enable = 0;
    }
    else if ( battman3_get_power_good( &battman3 ) && !ldo_enable )
    {
        battman3_ldo( BATTMAN3_ENABLE );
        log_printf( &logger, " > Power is good - LDO enabled\r\n" );
        ldo_enable = 1;
    }

    battman3_charge_status( );

    if ( counter >= LOG_THRESHOLD_3SEC )
    {
        counter = 0;
        battman3_get_battery_voltage( &battman3, &vbat );
        log_printf( &logger, " > Battery voltage: %.2f\r\n", vbat );  
        log_printf( &logger, "****************************************************\r\n" );
    }
    counter++;
    Delay_ms ( 100 );
}

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.BATT-MAN3

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.


ALSO FROM THIS AUTHOR

Keylock click

1

Keylock click carries a processed sealed key lock mechanism that can be set in three different positions. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over the PWM, INT, and AN pin on the mikroBUSâ„¢ line.

[Learn More]

DAC 9 click

0

DAC 9 Click is a compact add-on board that contains a fully-featured, highly accurate digital-to-analog converter. This board features the DAC80501, a 16-bit voltage-output digital-to-analog converter with precision internal reference from Texas Instruments. It supports both I2C and SPI serial interface and offers a linearity of < 1 LSB. It also includes a 2.5V internal reference, giving full-scale output voltage ranges of 1.25V, 2.5V, or 5V, incorporate a Power-On Reset function, consume a low current of 1mA, and include a Power-Down feature that reduces current consumption to typically 15μA at 5V.

[Learn More]

10x10 RGB click

0

10x10 RGB Click is a matrix of 100 intelligent RGB elements, forming a 10x10 display screen. These LED elements feature internal logic, which allows them to communicate directly with the MCU.

[Learn More]