Commit mthomas changes to GCC and port those changes to IAR
[avr_bc100.git] / BaseTinyFirmware / GCC / LIIONspecs.h
1 /* This file has been prepared for Doxygen automatic documentation generation.*/\r
2 /*! \file *********************************************************************\r
3  *\r
4  * \brief\r
5  *      Li-Ion specifications\r
6  *\r
7  *      Contains example definitions of Li-Ion battery specifications.\r
8  *\r
9  * \par Application note:\r
10  *      AVR458: Charging Li-Ion Batteries with BC100\r
11  *\r
12  * \par Documentation:\r
13  *      For comprehensive code documentation, supported compilers, compiler\r
14  *      settings and supported devices see readme.html\r
15  *\r
16  * \author\r
17  *      Atmel Corporation: http://www.atmel.com \n\r
18  *      Support email: avr@atmel.com \n\r
19  *      Original author: \n\r
20  *\r
21  * $Name$\r
22  * $Revision: 2261 $\r
23  * $RCSfile$\r
24  * $URL: http://svn.norway.atmel.com/AppsAVR8/avr458_Charging_Li-Ion_Batteries_with_BC100/tag/20070904_release_1.0/code/IAR/LIIONspecs.h $\r
25  * $Date: 2007-08-10 09:28:35 +0200 (fr, 10 aug 2007) $\n\r
26  ******************************************************************************/\r
27 \r
28 #ifndef LIIONSPECS_H\r
29 #define LIIONSPECS_H\r
30 \r
31 /*\r
32  Information on Varta EasyPack 66590 711 099 collected by M. Thomas:\r
33 \r
34  Connections:\r
35  Pad 1 - marked with + : Battery +\r
36  Pad 2 - not marked    : ID-Resistor (RID) to Pad 4, 3.9kOhm\r
37  Pad 3 - not marked    : NTC to Pad 4, 10kOhm B=3435K\r
38  Pad 4 - marked with - : Battery -\r
39  -> 1Wire not available\r
40 \r
41  Capacity: nom. 550mAh (min. 520 mAh) at 0.2C from 4.2V to 3.0V\r
42  Nominal Voltage: 3.7V, Range: 2.75V - 4.2V\r
43  Charging Method: Constant Current + Constant Voltage\r
44   Charge Voltage: 4.2V\r
45   Initial charge Current: std. 260mA, rapid 520mA\r
46   Charging cut of either:\r
47   (a) at time: std. 5h, rapid 3h\r
48   (b) by min current of 10mA\r
49   Temparature 0 to 45degC\r
50  Discharge max. Current: 1040mA\r
51  Protection:\r
52   overcharge : 4.35V (resume at 4.0V)\r
53   discharge  : 2.2V\r
54   overcurrent: 3.0A\r
55 \r
56  Additional from PoliFlex-Handbook:\r
57   - fast charging in termperatur-range 0 - 45degC\r
58   - max charge current 1C (=550mA here)\r
59   - max charge current has to be limited stricly to 4,2V +/- 50mV\r
60   - stop charge 3h after start of when current is <0.02C (=11mA here)\r
61 */\r
62 \r
63 \r
64 //******************************************************************************\r
65 // Cell limits\r
66 //******************************************************************************\r
67 // This is for common NiMH batteries.\r
68 #define CELL_VOLTAGE_SAFETY     0  /*!< \brief Buffer for unmatched batteries.\r
69  *\r
70  * If we are charging a multicell battery and the cells aren't matched, we\r
71  * may risk overcharging at least one. Therefore, we may subtract this constant\r
72  * per additional cell in battery to allow for a "buffer".\r
73  *\r
74  * \note Set to 0 if batteries are properly matched.\r
75  *\r
76  * \note If this is changed to something higher than (CELL_VOLTAGE_MAX -\r
77  * CELL_VOLTAGE_LOW), and the number of cells is great enough, the limit\r
78  * BAT_VOLTAGE_LOW will become higher than BAT_VOLTAGE_MAX. This will cause\r
79  * the charger to keep trying to charge, but instantly finishing because\r
80  * the battery voltage is already at max.\r
81  */\r
82 //! Maximum charge voltage for cell, in mV.\r
83 #define CELL_VOLTAGE_MAX     4200\r
84 \r
85 //! Minimum voltage to consider cell charged at, in mV.\r
86 #define CELL_VOLTAGE_LOW     4050\r
87 \r
88 //! Minimum voltage to start charging at, in mV.\r
89 #define CELL_VOLTAGE_MIN     2750\r
90 \r
91 //! Target voltage during prequalification, in mV.\r
92 #define CELL_VOLTAGE_PREQUAL 3000\r
93 \r
94 \r
95 //******************************************************************************\r
96 // Battery limits\r
97 //******************************************************************************\r
98 // Battery-definitions.\r
99 //! Number of cells in battery.\r
100 #define BAT_CELL_NUMBER      1\r
101 \r
102 //! Maximum cell temperature (Celsius).\r
103 #define BAT_TEMPERATURE_MAX  45\r
104 \r
105 //! Minimum Cell temperature (Celsius).\r
106 #define BAT_TEMPERATURE_MIN   0\r
107 \r
108 //! Maximum time for prequalification, in minutes.\r
109 #define BAT_TIME_PREQUAL     9\r
110 \r
111 //! \brief Constant charge current, in mA, during prequalification mode.\r
112 //! \note This is typically lower than the main charge current.\r
113 #define BAT_CURRENT_PREQUAL  150\r
114 \r
115 //! Charge current hysteresis, in mA.\r
116 #define BAT_CURRENT_HYST     5\r
117 \r
118 //! Charge voltage hysteresis, in mV.\r
119 #define BAT_VOLTAGE_HYST     10\r
120 \r
121 //! Maximum battery voltage, in mV.\r
122 #define BAT_VOLTAGE_MAX      (CELL_VOLTAGE_MAX * BAT_CELL_NUMBER) - \\r
123                               ((BAT_CELL_NUMBER - 1) * CELL_VOLTAGE_SAFETY)\r
124 \r
125 //! Minimum voltage, in mV, to consider battery charged.\r
126 #define BAT_VOLTAGE_LOW      (CELL_VOLTAGE_LOW * BAT_CELL_NUMBER)\r
127 \r
128 //! Minimum voltage, in mV, to consider battery safe to charge.\r
129 #define BAT_VOLTAGE_MIN      (CELL_VOLTAGE_MIN * BAT_CELL_NUMBER)\r
130 \r
131 //! Charge voltage to achieve, in mV, during prequalification mode.\r
132 #define BAT_VOLTAGE_PREQUAL     (CELL_VOLTAGE_PREQUAL * BAT_CELL_NUMBER)\r
133 \r
134 #endif // LIIONSPECS_H\r