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]
Rating:
Author: MIKROE
Last Updated: 2019-05-23
Package Version: 1.0.0.1
mikroSDK Library: 1.0.0.0
Category: Battery Charger
Downloaded: 5292 times
Followed by: 4 users
License: MIT license
Charger click carries both a battery charger controller and a battery charge monitor. The smaller chip is MCP73831, a single-cell Li-Ion and Li-Polymer charge management controller. The larger IC is DS2438, a smart battery monitor. The monitor communicates with the MCU through a 1-Wire interface. The click is designed to use a 5V power supply.
Do you want to subscribe in order to receive notifications regarding "Charger click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Charger click" changes.
Do you want to report abuse regarding "Charger click".
Front and back view of Charger Click board designed in mikroBUS form factor.
View full imageLibrary Description
The library covers all the necessary functions to control Charger click board. The library performs the communication with the device via 1-Wire protocol by writing to registers and by reading from registers.
Key functions:
void charger_gpioDriverInit (T_CHARGER_P gpioObj)
- Function initializes GPIO driver for the desired MIKROBUS1.Examples description
The application is composed of the three sections :
void applicationTask() { charger_getBatteryVoltage(); Delay_100ms(); mikrobus_logWrite( " Battery Voltage : ", _LOG_TEXT ); FloatToStr( batteryVoltage, logText ); mikrobus_logWrite( logText, _LOG_TEXT ); mikrobus_logWrite( " V", _LOG_LINE ); mikrobus_logWrite( " Charger Current : ", _LOG_TEXT ); FloatToStr( chargerCurrent, logText ); mikrobus_logWrite( logText, _LOG_TEXT ); mikrobus_logWrite( " mA", _LOG_LINE ); charger_getBatteryCapacity(); Delay_100ms(); mikrobus_logWrite( " Charger Capacity : ", _LOG_TEXT ); FloatToStr( chargerCapacity, logText ); mikrobus_logWrite( logText, _LOG_TEXT ); mikrobus_logWrite( " mAhr", _LOG_LINE ); mikrobus_logWrite( "---------------------------------", _LOG_LINE ); Delay_1sec(); }
Additional Functions :
Other mikroE Libraries used in the example:
One_Wire
UART​
Conversion
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.