Intermediate
30 min

Create USB management and charging solution with LTC3553 and PIC18F57Q43

Recharge and thrive

Charger 18 Click with Curiosity Nano with PIC18F57Q43

Published Feb 13, 2024

Click board™

Charger 18 Click

Dev. board

Curiosity Nano with PIC18F57Q43

Compiler

NECTO Studio

MCU

PIC18F57Q43

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

PIC18F57Q43 Curiosity Nano evaluation kit is a cutting-edge hardware platform designed to evaluate microcontrollers within the PIC18-Q43 family. Central to its design is the inclusion of the powerful PIC18F57Q43 microcontroller (MCU), offering advanced functionalities and robust performance. Key features of this evaluation kit include a yellow user LED and a responsive

mechanical user switch, providing seamless interaction and testing. The provision for a 32.768kHz crystal footprint ensures precision timing capabilities. With an onboard debugger boasting a green power and status LED, programming and debugging become intuitive and efficient. Further enhancing its utility is the Virtual serial port (CDC) and a debug GPIO channel (DGI

GPIO), offering extensive connectivity options. Powered via USB, this kit boasts an adjustable target voltage feature facilitated by the MIC5353 LDO regulator, ensuring stable operation with an output voltage ranging from 1.8V to 5.1V, with a maximum output current of 500mA, subject to ambient temperature and voltage constraints.

PIC18F57Q43 Curiosity Nano double side image

Microcontroller Overview

MCU Card / MCU

default

Architecture

PIC

MCU Memory (KB)

128

Silicon Vendor

Microchip

Pin count

48

RAM (Bytes)

8196

You complete me!

Accessories

Curiosity Nano Base for Click boards is a versatile hardware extension platform created to streamline the integration between Curiosity Nano kits and extension boards, tailored explicitly for the mikroBUS™-standardized Click boards and Xplained Pro extension boards. This innovative base board (shield) offers seamless connectivity and expansion possibilities, simplifying experimentation and development. Key features include USB power compatibility from the Curiosity Nano kit, alongside an alternative external power input option for enhanced flexibility. The onboard Li-Ion/LiPo charger and management circuit ensure smooth operation for battery-powered applications, simplifying usage and management. Moreover, the base incorporates a fixed 3.3V PSU dedicated to target and mikroBUS™ power rails, alongside a fixed 5.0V boost converter catering to 5V power rails of mikroBUS™ sockets, providing stable power delivery for various connected devices.

Curiosity Nano Base for Click boards accessories 1 image

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
PA0
AN
Regulator Ignition
PA7
RST
Suspend Mode
PD4
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
NC
NC
3.3V
Ground
GND
GND
LDO Enable
PB0
PWM
Pushbutton Status
PA6
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

Curiosity Nano Base for Click boards front image hardware assembly

Start by selecting your development board and Click board™. Begin with the Curiosity Nano with PIC18F57Q43 as your development board.

Curiosity Nano Base for Click boards front image hardware assembly
Charger 27 Click front image hardware assembly
PIC18F47Q10 Curiosity Nano front image hardware assembly
Prog-cut hardware assembly
Charger 27 Click complete accessories setup image hardware assembly
Curiosity Nano with PICXXX Access MB 1 - upright/background hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
Necto image step 5 hardware assembly
Necto image step 6 hardware assembly
PIC18F57Q43 Curiosity MCU Step hardware assembly
Necto No Display image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Debug Image Necto Step 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" );
    Delay_ms( 10000 );
    charger18_suspend_control( &charger18, CHARGER18_CONTROL_ENABLE );
    log_printf( &logger, " CHARGER : OFF\r\n" );
    Delay_ms( 3000 );
    charger18_buck_control( &charger18, CHARGER18_CONTROL_ENABLE );
    log_printf( &logger, " BUCK    : ON\r\n" );
    Delay_ms( 3000 );
    charger18_buck_control( &charger18, CHARGER18_CONTROL_DISABLE );
    log_printf( &logger, " BUCK    : OFF\r\n" );
    Delay_ms( 3000 );
    charger18_ldo_control( &charger18, CHARGER18_CONTROL_ENABLE );
    log_printf( &logger, " LDO     : ON\r\n" );
    Delay_ms( 3000 );
    charger18_ldo_control( &charger18, CHARGER18_CONTROL_DISABLE );
    log_printf( &logger, " LDO     : OFF\r\n\n" );
    Delay_ms( 3000 );
}

void main ( void ) 
{
    application_init( );

    for ( ; ; ) 
    {
        application_task( );
    }
}

// ------------------------------------------------------------------------ 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.