TOP Contributors

  1. MIKROE (2664 codes)
  2. Alcides Ramos (358 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (137148 times)
  2. FAT32 Library (70245 times)
  3. Network Ethernet Library (56134 times)
  4. USB Device Library (46452 times)
  5. Network WiFi Library (42110 times)
  6. FT800 Library (41414 times)
  7. GSM click (29126 times)
  8. mikroSDK (26571 times)
  9. PID Library (26512 times)
  10. microSD click (25509 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

Charger 12 click

Rating:

5

Author: MIKROE

Last Updated: 2019-09-18

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Power supply

Downloaded: 3374 times

Not followed.

License: MIT license  

Charger 12 Click is a single lithium-ion (Li+) cell or three-cell NiMH/NiCd battery charger. This click can be used for Low-Cost Li-Ion battery chargers, or Power Tools, toys, backup energy storage solutions, etc.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Charger 12 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Charger 12 click" changes.

Do you want to report abuse regarding "Charger 12 click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Charger 12 click

Charger 12 click

Native view of the Charger 12 click board.

View full image
Charger 12 click

Charger 12 click

Front and back view of the Charger 12 click board.

View full image

Library Description

Library contains functions for getting and setting GPIO pin states Library contains function for mode selection Library contains function for SPI transfer operation Library contains function for SPI get register operation Library contains functions for incrementing and decrementing wiper position

Key functions:

  • uint8_t charger12_mode_select( uint8_t mode_select ) - selects device operation mode by setting RST(CHGEN) and PWM(MODE) pins
  • void charger12_spi_increment_wiper( void ) - increments wiper position by sending 8bit increment wiper command
  • void charger12_spi_decrement_wiper( void ) - decrements wiper position by sending 8bit decrement wiper command

Examples description

The application is composed of three sections :

  • System Initialization - Initializes GPIO pins, SPI and LOG modules
  • Application Initialization - Iniztializes SPI driver
  • Application Task - Executes additional functions based on user input
void applicationTask( )
{
    uart_ready = UART_Data_Ready( );

    if (uart_ready == 1)
    {
        uart_char = UART_Read( );

        switch (uart_char)
        {
            case '+' :
            {
                charger12_case_Plus( );
                break;
            }
            case '-' :
            {
                charger12_case_Minus( );
                break;
            }
            case '1' :
            {
                charger12_case_One( );
                break;
            }
            case '2' :
            {
                charger12_case_Two( );
                break;
            }
            case '3' :
            {
                charger12_case_Three( );
                break;
            }
            case '4' :
            {
                charger12_case_Four( );
                break;
            }
            default :
            {
                mikrobus_logWrite( "> Invalid command", _LOG_LINE );
                break;
            }
        }
    }
}

Additional Functions :

  • charger12_case_Plus() - Increments Wiper position
  • charger12_case_Minus() - Decrements Wiper position
  • charger12_case_One() - Selects 1st mode of operation
  • charger12_case_Two() - Selects 2nd mode of operation
  • charger12_case_Three() - Selects 3rd mode of operation
  • charger12_case_Four() - Selects 4th mode of operation

Other mikroE Libraries used in the example:

  • SPI
  • UART
  • Conversions

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

Barometer 12 click

0

Barometer 12 Click is a compact add-on board that measures air pressure in a specific environment. This board features the ICP-10125, a high-accuracy, low-power, 10-atm waterproof barometric pressure and temperature sensor from TDK InvenSense.

[Learn More]

Analog MUX 4 click

0

Analog MUX 4 Click is a compact add-on board that switches one of many analog inputs to one digital output. This board features the TMUX1308, a general-purpose 8:1 single-ended CMOS multiplexer (MUX) from Texas Instruments. The TMUX1308 has an internal injection current control which eliminates the need for external diode and resistor networks to protect the switch and keep the input signals within the supply voltage. It also supports bidirectional analog and digital signals ranging from 0 to 5V, alongside several protection features allowing a reliable operation and protecting the device from potential damage.

[Learn More]

Water Detect 2 click

0

Water Detect 2 Click is a compact add-on board that can detect the presence/flow of a liquid in a clear tube. This board features the OPB350L250, a tube liquid sensor from TT Electronics. Water Detect 2 Click has multiple output states and can recognize fluid present, no fluid present, and no tube present. This sensor excepts 1/4” tubing (6.3mm) as an outside diameter of the clear tubes, regardless of the direction of the liquid’s flow.

[Learn More]