TOP Contributors

  1. MIKROE (2657 codes)
  2. Alcides Ramos (354 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 (136901 times)
  2. FAT32 Library (70034 times)
  3. Network Ethernet Library (56005 times)
  4. USB Device Library (46308 times)
  5. Network WiFi Library (41934 times)
  6. FT800 Library (41232 times)
  7. GSM click (29022 times)
  8. PID Library (26434 times)
  9. mikroSDK (26401 times)
  10. microSD click (25387 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: 3312 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

Flame click

5

Flame click is a fire detection solution sensitive only to infrared light. To use it as a fire alarm, set up the exact detection threshold through the onboard potentiometer (once reached, the click will send an interrupt to the target board MCU through the mikroBUS INT pin).

[Learn More]

Binho Nova click

0

Binho Nova Click is an adapter Click board™ that can be used as a multi-protocol adapter. This board features two female 1.27mm 2x5 connectors suitable for connecting the Binho Nova Multi-Protocol USB Host Adapter depending on the desired interface. This Click board™ is designed for ultimate flexibility and provides the ability to use this adapter with different communication protocols, such as I2C, SPI, or UART. It features five signal pins, which can be used as Digital Input/Output, PWM Output, Digital Interrupt, or Analog Input/Output. Along with these connectors, it also features two power jumpers that can be used to supply the host from the Binho Nova.

[Learn More]

Relay click

0

Relay click is a dual relay Click board, which can be operated by the host MCU. This Click board offers an elegant and easy solution for controlling a wide range of high power applications.

[Learn More]