Intermediate
30 min

Create dependable supply-solution for various battery-powered apps with MCP1811A and PIC18LF25K80

Never run out of power

Single Cell Click with EasyPIC v8

Published Nov 01, 2023

Click board™

Single Cell Click

Dev. board

EasyPIC v8

Compiler

NECTO Studio

MCU

PIC18LF25K80

Easy-to-use power supply solution for applications powered by alkaline, NiCd, NiMH, Li-Ion, or Li-Polymer batteries

A

A

Hardware Overview

How does it work?

Single Cell Click is based on the MCP16251, a compact, high-efficiency, fixed frequency, synchronous step-up DC-DC converter from Microchip. This device provides an easy-to-use power supply solution for applications powered by one-cell, two-cell, or three-cell alkaline, NiCd, NiMH, one-cell Li-Ion, or Li-Polymer batteries. Low-voltage technology allows the regulator to start up without a high inrush current or output voltage overshoot from a low-voltage input. High efficiency is accomplished by integrating the low-resistance N-Channel boost switch and synchronous P-Channel switch. All compensation and protection circuitry are integrated to minimize external components. MCP16251 is paired with the MCP1811A device, a good choice for new ultra-long life LDO applications with high-current demands but require ultra-low power consumption during sleep periods. The MCP16251 on the Single Cell Click operates and consumes less than 14µA from the battery after Start-up while operating at no load. The device provides a true disconnect from input to output while in shutdown EN = LOW. While in shutdown, it consumes less than 0.6µA from the battery. The Single

Cell Click is designed to operate with a wide input voltage range down to 0.35V, accommodating many input sources. When considering a primary power solution for a design, the battery type and load current needs must be carefully selected. The MCP16251 start-up voltage is typically 0.82V at 1mA load, but this does not act as a UVLO start-up threshold. The device drains current to bias its internal circuitry before the 0.82V input. It can't start up or operate well with high-impedance sources because its voltage varies from zero to over 0.82V (i.e., energy harvesting). Start-up voltage is the point where the device starts switching in a closed loop, and the output is regulated and depends on load and temperature. Batteries are available in a variety of sizes and chemistries and can support a variety of drain rates. No matter the chemistry, most batteries have several things in common. They should not be drained below their specified FEP (Functional End Point or Cut-Off Voltage). Below this point, if the battery has a load applied, there will not be enough energy to deliver power because all usable capacity is used. For an

alkaline cell, FEP is 0.9V or 0.8V. Using the alkaline cell below the FEP will increase the risk of leakage. There is an exception for alkaline batteries: if the battery voltage is strictly monitored, it can only be drained down to 0.5V in one-cell applications. The FEP value is usually 1.0V – 1.1V for a rechargeable NiMH cell. Another situation is powering a boost circuit from one rechargeable cell like NiMH or NiCd. These applications need an external MCU to monitor the cell voltage or a separate UVLO circuit to prevent deep discharging, which results in permanent cell damage. In a multi-cell powered application (e.g., 2.4V typ. from two NiMH cells), deep discharging will result in a reverse polarity charging of one of the cells due to the unbalanced cell voltages, thus damaging the respective cell. This Click board™ can only be operated with a 3.3V 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.

single-cell-click-hardware-overview

Features overview

Development board

EasyPIC v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports many high pin count 8-bit PIC microcontrollers from Microchip, regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer. 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. Thanks to innovative manufacturing technology, EasyPIC v8 provides a fluid and immersive working experience, allowing access anywhere and under any

circumstances at any time. Each part of the EasyPIC v8 development board contains the components necessary for the most efficient operation of the same board. In addition to the advanced integrated CODEGRIP programmer/debugger module, which offers many valuable programming/debugging options and seamless integration with the Mikroe software environment, the board also includes a clean and regulated power supply module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via the USB Type-C (USB-C) connector.

Communication options such as USB-UART, USB DEVICE, and CAN are also included, including the well-established mikroBUS™ standard, two display options (graphical and character-based LCD), and several different DIP sockets. These sockets cover a wide range of 8-bit PIC MCUs, from the smallest PIC MCU devices with only eight up to forty pins. EasyPIC v8 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 v8 horizontal image

Microcontroller Overview

MCU Card / MCU

default

Architecture

PIC

MCU Memory (KB)

32

Silicon Vendor

Microchip

Pin count

28

RAM (Bytes)

3648

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.

Single Cell Click accessories image

Used MCU Pins

mikroBUS™ mapper

NC
NC
AN
NC
NC
RST
Enable
RA5
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
NC
NC
PWM
NC
NC
INT
NC
NC
TX
NC
NC
RX
NC
NC
SCL
NC
NC
SDA
NC
NC
5V
Ground
GND
GND
2

Take a closer look

Click board™ Schematic

Single Cell Click Schematic schematic

Step by step

Project assembly

EasyPIC v8 front image hardware assembly

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

EasyPIC v8 front image hardware assembly
LTE IoT 5 Click front image hardware assembly
MCU DIP 28 hardware assembly
LTE IoT 5 Click complete accessories setup image hardware assembly
EasyPIC v8 28pin-DIP Access - upright/background 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
Necto DIP image step 7 hardware assembly
Necto image step 8 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 Single Cell Click driver.

Key functions:

  • singlecell_set_power_mode - Set power mode function

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 
 * \brief Single Cell Click example
 * 
 * # Description
 * Demo application is used to shows basic controls Single Cell click board.
 *
 * The demo application is composed of two sections :
 * 
 * ## Application Init 
 * Initializes GPIO and LOG structures,
 * set CS pin as output and start write log.
 * Initialization driver enable's - GPIO, also write log.
 * 
 * ## Application Task  
 * This is a example which demonstrates the use of Single Cell board.
 * This example shows the automatic control of the Single Cell click,
 * enable and disable power the regulator output on 10 sec. 
 * 
 * \author MikroE Team
 *
 */
// ------------------------------------------------------------------- INCLUDES

#include "board.h"
#include "log.h"
#include "singlecell.h"

// ------------------------------------------------------------------ VARIABLES

static singlecell_t singlecell;
static log_t logger;

// ------------------------------------------------------- ADDITIONAL FUNCTIONS


// ------------------------------------------------------ APPLICATION FUNCTIONS

void application_init ( void )
{
    log_cfg_t log_cfg;
    singlecell_cfg_t cfg;

    /** 
     * 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_printf(&logger, "---- Application Init ----\r\n");

    //  Click initialization.

    singlecell_cfg_setup( &cfg );
    SINGLECELL_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    singlecell_init( &singlecell, &cfg );
    singlecell_default_cfg ( &singlecell );
   
    log_printf(&logger, "-------------------------\r\n");
    log_printf(&logger, "    Single Cell click    \r\n");
    log_printf(&logger, "-------------------------\r\n");

    Delay_ms ( 100 );
}

void application_task ( void )
{
    log_printf(&logger, "         Enable\r\n");
    singlecell_set_power_mode ( &singlecell, SINGLECELL_ENABLE );
    // 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 );
    
    log_printf(&logger, "         Disable\r\n");
    singlecell_set_power_mode ( &singlecell, SINGLECELL_DISABLE );
    // 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 );
}

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.