AN137 Silicon_Laboratories, AN137 Datasheet - Page 33

no-image

AN137

Manufacturer Part Number
AN137
Description
Lithium ION Battery Charger Using C8051f300
Manufacturer
Silicon_Laboratories
Datasheet
unsigned int lowcurrent_finish_hour = 0;
Reset_Time_Base();
lowcurrent_finish_min = (TIME.min + MAX_TIME_LOWCURRENT);
lowcurrent_finish_hour = TIME.hour;
while (lowcurrent_finish_min > 60)
{
}
// Enter Main Lowcurrent Loop.
// Only exits are upon error and full charge
while ((LOWCURRENT == 1) && (ERROR == 0))
{
}
lowcurrent_finish_min = lowcurrent_finish_min - 60;
lowcurrent_finish_hour++;
temp = Monitor_Battery(TEMPERATURE);// Get Temperature Reading
if ((temp > MIN_TEMP_ABS) && (temp < MAX_TEMP_ABS))
{
}
else if(ERROR == 0)
{
}
// Is Battery’s Charge Voltage below max charge voltage
temp = Monitor_Battery(VOLTAGE);
if (temp <= (VOLT_LOWCURRENT + VOLT_TOLERANCE))
{
}
else if(ERROR == 0)
{
}
if (temp < MIN_TEMP_ABS)
else
ERROR = 1;
if (CONST_C == 1)
if (CONST_V == 1)
if ((temp >= MIN_VOLT_BULK) && (DELAY == 0))// Bulk Threshold voltage met?
{ LOWCURRENT = 0;
}
if ((TIME.hour == lowcurrent_finish_hour) &&
( TIME.min == lowcurrent_finish_min))
{
}
VOLT_MAX = 1;
ERROR
TEMP_MIN = 1;
TEMP_MAX = 1;
Regulate_Current(I_LOWCURRENT);
Regulate_Voltage();
BULK = 1;
TIME_MAX = 1;
ERROR
= 1;
= 1;
// Reset Time base to zero
// Calculate LOWCURRENT finish time
// Is TEMPERATURE within limits
// Get Voltage Reading
// CONST_C ?, charge w/ constant current
// CONST_V?, charge w/ constant voltage
// Exit LOWCURRENT mode
// Switch to Bulk Charge mode
// Check elapsed time
// Set Time MAX error flag
// Set general error flag
// Voltage to high?
// Set Max voltage error flag
// Set general error flag
// Absolute temperature out of range?
// Set Temperature below minimum flag
// Set Temperature exceeds maximum flag
// Set general error flag
Rev. 1.2
AN137
33

Related parts for AN137