Intermediate
30 min

Create USB management and charging solution with LTC3553 and dsPIC33FJ256GP710A

Recharge and thrive

Charger 18 Click with EasyPIC Fusion v7

Published May 14, 2023

Click board™

Charger 18 Click

Dev. board

EasyPIC Fusion v7

Compiler

NECTO Studio

MCU

dsPIC33FJ256GP710A

Don't wait for your battery to run out - choose a fast-charging battery charger and stay powered up all day

A

A

Hardware Overview

How does it work?

Charger 18 Click is based on the LTC3553, a micropower multifunction power management integrated circuit (PMIC) for portable Li-Ion/Polymer battery-based applications from Analog Devices. It combines a USB-compatible PowerPath manager with automatic load prioritization delivering up to 400mA battery charge current from a 5V USB input. The device’s ‘instant-on’ operation ensures immediate system load power when a USB supply is available, even with a fully discharged battery. Alongside a stand-alone battery charger, it has a high-efficiency synchronous 200mA buck regulator and a 150mA low dropout linear regulator available on the onboard connectors. This Click board™ has an input current limit selection allowing the user to select between 100mA and 500mA input current limit. The choice can be made by appropriately positioning the SMD jumper labeled ISET SEL. Besides ISET, it also possesses SEQ SEL jumper selection determining which regulator is enabled before the other. The first-regulator power-up selection is made by positioning this SMD jumper to an appropriate position

marked as BUCK or LDO. On the other hand, the BON and LDO pins routed to the AN and PWM pins on the mikroBUS™ socket enable the buck and LDO regulators by setting these pins to a high logic state. Alongside these pins, the LTC3553 also includes a pushbutton input to control the two regulators and system reset - an onboard pushbutton labeled ON, also routed to the RST pin on the mikroBUS™, representing the Regulator Ignition button. Pressing the button causes an STA interrupt, informing the MCU that this event has occurred. These regulators are also related to a Standby Mode, selectable through an SMD jumper labeled as ISET SEL. When this jumper is placed ON, the buck and the LDO regulator quiescent current is reduced to low levels while maintaining output voltage regulation. The buck regulator is limited to a 10mA maximum load current in this mode, and the LDO regulator’s response to line and load transients is slower. As already mentioned in the text, this Click board™ communicates with MCU using several GPIO pins. With the IEN pin routed to the CS pin on the

mikroBUS™ socket pulled high, the LTC3553 enters Suspend mode to comply with the USB specification. In this mode, the power path between USB and VOUT is put in a high impedance state to reduce the USB input current. This Click board™ also comes with a blue LED labeled CHARGING for the battery charging state. An NTC function is also available for temperature-qualified charging. The temperature monitoring feature is selectable via an NTC SEL jumper, where the user can choose between external or internal monitoring modes. A negative temperature coefficient (NTC) thermistor input for the battery temperature monitor is provided for the external mode. This Click board™ can only be operated with a 5V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ comes equipped with a library containing functions and an example code that can be used as a reference for further development.

charger-18-click-hardware-overview

Features overview

Development board

EasyPIC Fusion v7 is the seventh generation of PIC development boards specially designed to develop embedded applications rapidly. It supports a wide range of 16/32-bit PIC microcontrollers from Microchip and a broad set of unique functions, such as a powerful onboard mikroProg programmer and In-Circuit debugger over USB-B. The development board is well organized and designed so that the end-user has all the necessary elements, such as switches, buttons, indicators, connectors, and others, in one place. With two different connectors for each port, EasyPIC Fusion v7 allows you to connect accessory boards, sensors, and custom electronics more efficiently than ever. Each part of

the EasyPIC Fusion v7 development board contains the components necessary for the most efficient operation of the same board. An integrated mikroProg, a fast USB 2.0 programmer with mikroICD hardware In-Circuit Debugger, offers many valuable programming/debugging options and seamless integration with the Mikroe software environment. Besides it also includes a clean and regulated power supply block for the development board. It can use a wide range of external power sources, including an external 12V power supply, 7-12V AC or 9-15V DC via DC connector/screw terminals, and a power source via the USB Type-B (USB-B) connector. Communication options such

as USB-UART, USB-HOST, CAN, and Ethernet are also included, including the well-established mikroBUS™ standard, one display option for the TFT board line of products, and a standard TQFP socket for the seventh-generation MCU cards. This socket covers a wide range of 16-bit dsPIC/PIC24 and 32-bit PIC32 MCUs. EasyPIC Fusion v7 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.

EasyPIC Fusion v7 horizontal image

Microcontroller Overview

MCU Card / MCU

default

Type

7th Generation

Architecture

dsPIC

MCU Memory (KB)

256

Silicon Vendor

Microchip

Pin count

100

RAM (Bytes)

30720

You complete me!

Accessories

Li-Polymer Battery is the ideal solution for devices that demand a dependable and long-lasting power supply while emphasizing mobility. Its compatibility with mikromedia boards ensures easy integration without additional modifications. With a voltage output of 3.7V, the battery meets the standard requirements of many electronic devices. Additionally, boasting a capacity of 2000mAh, it can store a substantial amount of energy, providing sustained power for extended periods. This feature minimizes the need for frequent recharging or replacement. Overall, the Li-Polymer Battery is a reliable and autonomous power source, ideally suited for devices requiring a stable and enduring energy solution. You can find a more extensive choice of Li-Polymer batteries in our offer.

Charger 18 Click accessories image

Used MCU Pins

mikroBUS™ mapper

Buck Enable
RB8
AN
Regulator Ignition
RC1
RST
Suspend Mode
RC2
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
NC
NC
3.3V
Ground
GND
GND
LDO Enable
RD0
PWM
Pushbutton Status
RE8
INT
NC
NC
TX
NC
NC
RX
NC
NC
SCL
NC
NC
SDA
Power Supply
5V
5V
Ground
GND
GND
1

Take a closer look

Click board™ Schematic

Charger 18 Click Schematic schematic

Step by step

Project assembly

EasyPIC Fusion v7 front image hardware assembly

Start by selecting your development board and Click board™. Begin with the EasyPIC Fusion v7 as your development board.

EasyPIC Fusion v7 front image hardware assembly
GNSS2 Click front image hardware assembly
EasyPIC FUSION v7 ETH MCUcard with PIC32MZ2048EFH144 front image hardware assembly
GNSS2 Click complete accessories setup image hardware assembly
Board mapper by product7 hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
NECTO Compiler Selection Step Image hardware assembly
NECTO Output Selection Step Image hardware assembly
Necto image step 6 hardware assembly
EasyPIC PRO v7a MCU Selection Necto Step hardware assembly
EasyPIC PRO v7a Display Selection Necto Step hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Necto PreFlash Image hardware assembly

Track your results in real time

Application Output

1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support

Library Description

This library contains API for Charger 18 Click driver.

Key functions:

  • charger18_buck_controlThis function controls the buck regulator and enables the state of the Charger 18 Click board™.

  • charger18_ldo_controlThis function controls the low dropout (LDO) regulator to enable the state of the Charger 18 Click board™.

  • charger18_suspend_control This function controls the suspend charging mode state of the Charger 18 Click board™.

Open Source

Code example

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.

/*!
 * @file main.c
 * @brief Charger 18 Click Example.
 *
 * # Description
 * This example demonstrates the use of Charger 18 Click board by controlling
 * the status of the charger as well as the LDO and BUCK regulators.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initializes the driver and enables the chip with the charger, LDO and BUCK regulators disabled.
 *
 * ## Application Task
 * This function enables the charger, BUCK and LDO in the span of 25 seconds, and displays
 * the status of each feature on the USB UART.
 *
 * @author Stefan Filipovic
 *
 */

#include "board.h"
#include "log.h"
#include "charger18.h"

static charger18_t charger18;   /**< Charger 18 Click driver object. */
static log_t logger;    /**< Logger object. */

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    charger18_cfg_t charger18_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.
    charger18_cfg_setup( &charger18_cfg );
    CHARGER18_MAP_MIKROBUS( charger18_cfg, MIKROBUS_1 );
    if ( DIGITAL_OUT_UNSUPPORTED_PIN == charger18_init( &charger18, &charger18_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    charger18_power_control( &charger18, CHARGER18_CONTROL_ENABLE );
    log_printf( &logger, " POWER   : ON\r\n" );
    charger18_suspend_control( &charger18, CHARGER18_CONTROL_ENABLE );
    log_printf( &logger, " CHARGER : OFF\r\n" );
    charger18_buck_control( &charger18, CHARGER18_CONTROL_DISABLE );
    log_printf( &logger, " BUCK    : OFF\r\n" );
    charger18_ldo_control( &charger18, CHARGER18_CONTROL_DISABLE );
    log_printf( &logger, " LDO     : OFF\r\n" );
    
    log_info( &logger, " Application Task " );
}

void application_task ( void ) 
{
    charger18_suspend_control( &charger18, CHARGER18_CONTROL_DISABLE );
    log_printf( &logger, " CHARGER : ON\r\n" );
    // 10 seconds delay
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    charger18_suspend_control( &charger18, CHARGER18_CONTROL_ENABLE );
    log_printf( &logger, " CHARGER : OFF\r\n" );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    charger18_buck_control( &charger18, CHARGER18_CONTROL_ENABLE );
    log_printf( &logger, " BUCK    : ON\r\n" );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    charger18_buck_control( &charger18, CHARGER18_CONTROL_DISABLE );
    log_printf( &logger, " BUCK    : OFF\r\n" );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    charger18_ldo_control( &charger18, CHARGER18_CONTROL_ENABLE );
    log_printf( &logger, " LDO     : ON\r\n" );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    charger18_ldo_control( &charger18, CHARGER18_CONTROL_DISABLE );
    log_printf( &logger, " LDO     : OFF\r\n\n" );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

int main ( void ) 
{
    /* Do not remove this line or clock might not be set correctly. */
    #ifdef PREINIT_SUPPORTED
    preinit();
    #endif
    
    application_init( );
    
    for ( ; ; ) 
    {
        application_task( );
    }

    return 0;
}

// ------------------------------------------------------------------------ END

Additional Support

Resources

Love this project?

'Buy This Kit' button takes you directly to the shopping cart where you can easily add or remove products.