Ensure uninterrupted operation of your solution with dependable battery charger technology
A
A
Hardware Overview
How does it work?
Charger 13 Click is based on the RT9532, a fully integrated single-cell Li-ion battery charger from Richtek Technology that is ideal for portable applications. The RT9532 optimizes the charging task using a control algorithm including pre-charge, fast, and constant voltage modes. The input voltage range of the VIN pin can be as high as 28V. When the input voltage exceeds the OVP threshold, it will turn off the charging MOSFET to avoid overheating the chip. Besides its small physical size, the low number of external components makes this IC ideal for various applications. The 4.2V factory preset reference voltage simplifies design. The RT9532 is
designed with reliability in mind: the IC prevents draining the battery below the critical level, offers prequel charging (for deeply depleted batteries), features overvoltage protection, charging status monitoring, and more. The Click board™ itself is equipped with indicators to monitor both the charging process and power distribution: CHARGE LED indicates the charge-in-progress status, and STATUS LED indicates the power status during the charging process. On the left side of the click board is an input screw terminal with corresponding markings, where an external voltage as high as 28V can be applied. The connector on the right side is reserved
for a Li-Ion battery with GND and VBAT+ markings. When connected to a power source, the green STATUS LED will indicate it, while the red – CHARGING LED will indicate the charging is in progress and will turn off once the battery charging is finished. This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Features overview
Development board
EasyPIC v7a is the seventh generation of PIC development boards specially designed for the needs of rapid development of embedded applications. It supports a wide range of 8-bit PIC microcontrollers from Microchip and has a broad set of unique functions, such as the first-ever embedded debugger/programmer over USB-C. The development board is well organized and designed so that the end-user has all the necessary elements in one place, such as switches, buttons, indicators, connectors, and others. With four different connectors for each port, EasyPIC v7a allows you to connect accessory boards, sensors, and custom electronics more efficiently than ever. Each part of the EasyPIC v7a 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 various external power sources, including an external 12V power supply, 7-23V AC or 9-32V DC via DC connector/screw terminals, and a power source via the USB Type-C (USB-C) connector. Communication options such as USB-UART and RS-232 are also included, alongside the well-
established mikroBUS™ standard, three display options (7-segment, graphical, and character-based LCD), and several different DIP sockets. These sockets cover a wide range of 8-bit PIC MCUs, from PIC10F, PIC12F, PIC16F, PIC16Enh, PIC18F, PIC18FJ, and PIC18FK families. EasyPIC v7a 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.
Microcontroller Overview
MCU Card / MCU
Architecture
PIC
MCU Memory (KB)
24
Silicon Vendor
Microchip
Pin count
28
RAM (Bytes)
2048
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.
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
Step by step
Project assembly
Track your results in real time
Application Output via UART Mode
1. Once the code example is loaded, pressing the "FLASH" button initiates the build process, and programs it on the created setup.
2. After the programming is completed, click on the Tools icon in the upper-right panel, and select the UART Terminal.
3. After opening the UART Terminal tab, first check the baud rate setting in the Options menu (default is 115200). If this parameter is correct, activate the terminal by clicking the "CONNECT" button.
4. Now terminal status changes from Disconnected to Connected in green, and the data is displayed in the Received data field.
Software Support
Library Description
This library contains API for Charger 13 Click driver.
Key functions:
charger13_enable
- This function enable battery charging by cleared to LOW state of the EN ( PWM ) pin of the Charger 13 Clickcharger13_disable
- This function disable battery charging by sets to HIGH state of the EN ( PWM ) pin of the Charger 13 Clickcharger13_check
- This function check if the battery is charging of the Charger 13 Click
Open Source
Code example
This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.
/*!
* \file
* \brief Charger 13 Click example
*
* # Description
* This demo application charges the battery.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initialization device.
*
* ## Application Task
* This is an example which demonstrates the use of Charger 13 click board.
* This example shows the automatic control of the Charger 13 click,
* waits for valid user input and executes functions based on a set of valid commands
* and check the battery charge status.
* Results are being sent to the Usart Terminal where you can track their changes.
* All data logs on usb uart for approximately every 1 sec when the data value changes.
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "charger13.h"
// ------------------------------------------------------------------ VARIABLES
static charger13_t charger13;
static log_t logger;
uint8_t charger_flag;
uint8_t enable_flag;
uint8_t status_flag;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
charger13_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_info( &logger, "---- Application Init ----\r\n" );
// Click initialization.
charger13_cfg_setup( &cfg );
CHARGER13_MAP_MIKROBUS( cfg, MIKROBUS_1 );
charger13_init( &charger13, &cfg );
Delay_100ms( );
charger_flag = 2;
enable_flag = 0;
log_printf( &logger, "-------------------------\r\n" );
log_printf( &logger, " 'E' : Enable \r\n" );
log_printf( &logger, " 'D' : Disable \r\n" );
log_printf( &logger, "-------------------------\r\n" );
log_printf( &logger, "Charging Status : Disable\r\n" );
log_printf( &logger, "-------------------------\r\n" );
Delay_100ms( );
}
void application_task ( void )
{
if ( enable_flag == 0 )
{
enable_flag = 1;
charger13_enable( &charger13 );
log_printf( &logger, "Charging Status : Enabled\r\n" );
log_printf( &logger, "-------------------------\r\n" );
}
else if ( enable_flag == 1 )
{
enable_flag = 0;
charger13_disable( &charger13 );
log_printf( &logger, "Charging Status : Disable\r\n" );
log_printf( &logger, "-------------------------\r\n" );
}
status_flag = charger13_check( &charger13 );
if ( status_flag != charger_flag )
{
charger_flag = charger13_check( &charger13 );
if ( charger_flag == 0 )
{
log_printf( &logger, " Battery is charging \r\n" );
log_printf( &logger, "-------------------------\r\n" );
}
else
{
log_printf( &logger, " Battery does not charge \r\n" );
log_printf( &logger, "-------------------------\r\n" );
}
}
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END