AN137 Silicon_Laboratories, AN137 Datasheet - Page 30

no-image

AN137

Manufacturer Part Number
AN137
Description
Lithium ION Battery Charger Using C8051f300
Manufacturer
Silicon_Laboratories
Datasheet
AN137
}
//-----------------------------------------------------------------------------
// Bulk_Charge Function
//-----------------------------------------------------------------------------
void Bulk_Charge(void)
{
30
av = av/10;
av = av<<8;
PCA0CPM0 = 0x42;
switch (value)
{ case TEMPERATURE:
}
return (int) result;
unsigned int temp = 0;
unsigned int bulk_finish_hour = 0;
unsigned int bulk_finish_min = 0;
unsigned int delay_hour = 0;
unsigned int delay_min = 0;
unsigned int last_min = 0;
Reset_Time_Base();
bulk_finish_min = (TIME.min + MAX_TIME_BULK);
bulk_finish_hour = TIME.hour;
while (bulk_finish_min > 60)
{
}
case VOLTAGE:
case VOLTAGE_PWM_OFF:
result = (av - VOLT_OFFSET.l);
result /= VOLT_SLOPE.l;
result *= 100;
result *= RESAB;
result /= RESB;
break;
case CURRENT:
bulk_finish_min = bulk_finish_min - 60;
bulk_finish_hour++;
result =
break;
result =
result -= I_NOAMP_OFFSET.l;
result /= I_NOAMP_SLOPE.l;
result *= 100;
result /= RSENSE;
result *= RESAB;
result /= RESB;
result /= CURRENT_GAIN;
break;
(long) av * 1000/TEMP_SLOPE;
av*2;
// Compute the average
// Convert to 16-bit conversion
// ...to account for 16-bit cal.
//
// Turn on PWM
// Account for System Errors
// Convert to Voltage in Millivolts
// Account for Math Truncation Error
// Account for Divide Resistors
// Account for Differential Mode
// Account for System Errors
// Convert to Milliamps
// Account for Math Truncation Error
// Account for Sense Resistor
// Account for Divide Resistors
// Reset Time Base to zero
// Calculate BULK charge finish time
Rev. 1.2
coefficients

Related parts for AN137