MCP1632 Single-Cell Li-Ion Battery Charger Demo Board User’s Guide
DS50002321A-page 16
2014 Microchip Technology Inc.
2.4.1
Main Loop Description
The charger state machine is hardware independent, so all the output regulation is
done in the main loop.
Besides calling the state machine every second, different parameters and macros are
required for the state machine code. All values are 12 bits (4 x 10-bit ADC readings).
V
SENSE
and I
SENSE
contain updated values of the output voltage and current. They can
be defined as macros or return functions:
•
#define V
SENSE
V
OUT
•
#define I
SENSE
I
OUT
Set_Voltage(x) and Set_Current(x) set the converter maximum output voltage and cur-
rent. They can be defined as macros or functions:
•
#define Set_Voltage(x) { vref = x; }
•
#define Set_Current(x) { iref = x; }
Set_Led_Blink(x) sets the LED state and blink rate to show the current battery charging
state.
Constant_Voltage should show whether the converter is regulating the output voltage
or not. This is important for the state machine, because the minimum current and flat
current charge termination should only be initiated in Constant Voltage mode.
•
#define Constant_Voltage (!cmode)
I_Bat_Detect is a minimum current reading that shows a missing battery/load. The
value depends on the current shunt amplifier offset and amplification. It is useful for
detecting that the battery has been removed during charge, since there is no OCV
(Open Circuit Voltage) measurement.
•
#define I_Bat_Detect 16
Summary of Contents for ARD00558
Page 23: ...2014 Microchip Technology Inc DS50002321A page 23 A 3 BOARD TOP SILK...
Page 25: ...2014 Microchip Technology Inc DS50002321A page 25 A 5 BOARD TOP COPPER...
Page 27: ...2014 Microchip Technology Inc DS50002321A page 27 A 7 BOARD BOTTOM COPPER AND SILK...
Page 31: ...2014 Microchip Technology Inc DS50002321A page 31 NOTES...