pack.h

Go to the documentation of this file.
00001 /* This file has been prepared for Doxygen automatic documentation generation.*/
00029 #include "LG18450.h"    //Change this #include file if using a different cell.
00030 #include "pack_cfg.h"   //Adjust this file for the number of cells in series and in parallel.
00031 
00032 
00033 // DO NOT MODIFY THE FOLLOWING DEFINITIONS!
00034 // These are derived from the included files (above), so modify those instead.
00035 
00036 #define PACK_DESIGNCAPTYP (CELL_DESIGNCAPTYP * PACKWIDTH)       /* in mAh, typical capacity for entire pack   */
00037 #define PACK_DESIGNCAPC5  (CELL_DESIGNCAPC5 * PACKWIDTH)        /* in mAh, minimum capacity at C/5 for entire pack */
00038 
00039 #define PACK_NOMINALV     (CELL_NOMINALV * PACKSTACK)           /* in mV, typical, entire pack V when fully charged */
00040 #define PACK_MINV         (CELL_MINV * PACKSTACK)               /* in mV, absolute low-end voltage permitted  */
00041 #define PACK_DISCHG_C5    (CELL_DISCHG_C5 * PACKWIDTH)          /* discharge current (mA) for C/5 rate        */
00042 #define PACK_DISCHG_MAX   (CELL_DISCHG_MAX * PACKWIDTH)         /* maximum permissible discharge current (mA) */
00043 
00044 #define PACK_CCCV_V       (CELL_CCCV_V * PACKSTACK)             /* Constant Current / Constant Voltage charging mode, applied voltage (mV) */
00045 #define PACK_CCCV_C       (CELL_CCCV_C * PACKWIDTH)             /* Constant Current / Constant Voltage charging mode, applied current (mA) */
00046 #define PACK_CCCV_TERMC   (CELL_CCCV_TERMC * PACKWIDTH) /* Constant Current / Constant Voltage charging mode, charge-termination current threshold (mA) */
00047 #define PACK_MAX_CHG_C    (CELL_MAX_CHG_C * PACKWIDTH)  /* Maximum permissible charging current (mA)  */
00048 
00049 
00050 /* Extra calculations we perform on Constants to make code lighter... */
00051 #define PACK_DESIGNCAPMW  ((PACK_DESIGNCAPTYP/100) * (PACK_NOMINALV/100))
00052 #define PACK_PROTECT_DUV  {BPDUV = (0x01<<4) | (0x0D << 0);}    /* 1000mS, 8.80V*90% due to h/w issue */
00053 #define PACK_PROTECT_SHORT {BPSCD = 0;}                         /* 20A into 5mOhm = 100mV */
00054 #define PACK_PROTECT_OVERC {BPOCD = 0<<4 | 0<<0;}               /* 10A discharge, 10A charge */
00055 #define PACK_PROTECT_TIME  {CBPTR = 1<<4 | 5<<0;}               /* 122uS short-circuit, 10mS overcurrent Chg/Dischg */
00056 
00057 
00058 #define PACK_HIBERNATEAMOUNT 1                                  /* used to update RunningAcc while in Hibernate mode; see WakeUp_ISR().  */
00059 
00060 /*
00061 1.1.4   Battery protection detection levels
00062 The characterization of the Deep Under-voltage, Over-current and Short-circuit detection levels
00063 show that the actual thresholds are typically 10% below the numbers given in the datasheet. This
00064 is caused by parasitic elements in the layout that are not included in the simulation models.
00065 The spread in these thresholds are however in the expected range of +/-5% for Over-current
00066 detection levels, and +/-3% for Deep Under-voltage detection levels.
00067 
00068 Detailed characterization data will be given in the Analog characterization report.
00069 
00070 Workaround for ATmega406 rev. D:
00071 As long as the actual range for these detection levels covers the required range for the
00072 application used for qualification of ATmega406 rev. D, a correct detection level can always be found.
00073 
00074 ATmega406 fix:
00075 We assume that it is sufficient to update the datasheet with the actual detection levels found
00076 during characterization. If not, the thresholds can be tuned to better fit the specification in the datasheet.
00077 
00078 Battery Protection Parameter Lock Register – BPPLR
00079 Battery Protection Control Register – BPCR
00080 Current Battery Protection Timing Register – CBPTR
00081 Battery Protection Over-current Detection Level Register – BPOCD
00082 Battery Protection Short-circuit Detection Level Register – BPSCD
00083 Battery Protection Deep Under Voltage Register – BPDUV
00084 Battery Protection Interrupt Register – BPIR
00085 
00086 */
00087 
00088 
00089 

Generated on Mon Nov 12 15:59:58 2007 for AVR453 Smart Battery Reference Design by  doxygen 1.5.3