MCP1631HV Multi-Chemistry Battery Charger Reference Design © 2009 Microchip Technology Inc.
Note the following details of the code protection feature on Microchip devices: • Microchip products meet the specification contained in their particular Microchip Data Sheet. • Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. • There are dishonest and possibly illegal methods used to breach the code protection feature.
MCP1631HV MULTI-CHEMISTRY BATTERY CHARGER REFERENCE DESIGN Table of Contents Preface ........................................................................................................................... 1 Introduction............................................................................................................ 1 Document Layout .................................................................................................. 1 Conventions Used in this Guide ..............................
MCP1631HV Multi-Chemistry Battery Charger Reference Design Appendix D. Design Example D.1 Design Example ........................................................................................... 47 Worldwide Sales and Service .....................................................................................50 DS51791A-page iv © 2009 Microchip Technology Inc.
MCP1631HV MULTI-CHEMISTRY BATTERY CHARGER REFERENCE DESIGN Preface NOTICE TO CUSTOMERS All documentation becomes dated, and this manual is no exception. Microchip tools and documentation are constantly evolving to meet customer needs, so some actual dialogs and/or tool descriptions may differ from those in this document. Please refer to our web site (www.microchip.com) to obtain the latest documentation available. Documents are identified with a “DS” number.
MCP1631HV Multi-Chemistry Battery Charger Reference Design CONVENTIONS USED IN THIS GUIDE This manual uses the following documentation conventions: DOCUMENTATION CONVENTIONS Description Arial font: Italic characters Initial caps Quotes Underlined, italic text with right angle bracket Bold characters ‘bnnnn Text in angle brackets < > Courier font: Plain Courier Italic Courier 0xnnnn Square brackets [ ] Curly brackets and pipe character: { | } Ellipses...
Preface RECOMMENDED READING This user's guide describes how to use MCP1631HV Multi-Chemistry Battery Charger Reference Design. The following Microchip documents are available on our web site (www.microchip.com) and recommended as supplemental reference resources. MCP1631 Data Sheet, "High-Speed, Microcontroller-Adaptable, Pulse Width Modulator", DS22063A This data sheet provides detailed information regarding the MCP1631/MCP1631V, MCP1631HV and MCP1631VHV product family.
MCP1631HV Multi-Chemistry Battery Charger Reference Design NOTES: DS51791A-page 4 © 2009 Microchip Technology Inc.
MCP1631HV MULTI-CHEMISTRY BATTERY CHARGER REFERENCE DESIGN Chapter 1. Product Overview 1.1 INTRODUCTION The MCP1631HV Multi-Chemistry reference design board is used to charge one to five NiMH or NiCd batteries, charge one or two cell Li-Ion batteries, or drive one or two 1W LEDs. The board uses the MCP1631HV high speed analog PWM and PIC16F883 to generate the charge algorithm for NiMH, NiCd or Li-Ion batteries.
MCP1631HV Multi-Chemistry Battery Charger Reference Design 1.2 WHAT IS THE MCP1631HV MULTI-CHEMISTRY BATTERY CHARGER REFERENCE DESIGN? The MCP1631HV Multi-Chemistry Battery Charger is a complete stand-alone battery charger for NiMH, NiCd or Li-Ion battery packs. The board may also be used to drive LED devices using constant current mode. When charging NiMH or NiCd batteries the reference design is capable of charging one to five batteries connected in series.
MCP1631HV MULTI-CHEMISTRY BATTERY CHARGER REFERENCE DESIGN Chapter 2. Installation and Operation 2.1 INTRODUCTION The MCP1631HV Multi-Chemistry Battery Charger demonstrates Microchip’s high-speed Pulse Width Modulator (PWM), MCP1631HV, used in a multi-chemistry battery charger application. When used in conjunction with a microcontroller, the MCP1631HV will control the power system duty cycle to provide output voltage or current regulation.
MCP1631HV Multi-Chemistry Battery Charger Reference Design 1 Cell 3,600 mA-hr Li-Ion Battery Battery Voltage (V) Charge Current (A) 5.0 4.0 3.0 2.0 1.0 180 165 150 135 120 105 90 75 60 45 30 15 0 0.0 Time (Minutes) FIGURE 2-1: Li-Ion. MCP1631HV Multi-Chemistry Battery Charger Charge Profile, 3 Cell 2,000 mA-hr NiMH Batteries 60 40 3.0 30 2.0 20 150 135 120 105 90 75 60 0 45 0.0 30 10 15 1.0 Temperature (°C) 50 4.0 0 Battery Voltage (V) Charge Current (A) 5.
Installation and Operation 2.3.1 Power Input and Output Connection 2.3.1.1 POWERING THE MCP1631HV MULTI-CHEMISTRY BATTERY CHARGER 1. Apply the input voltage to the input terminal block, J1. The input voltage source should be limited to the 0V to +16V range. For nominal operation the input voltage should be between +5.3V and +16V. 2. Connect the positive side of the input source (+) to pin 1 of J1. Connect the negative or return side (-) of the input source to pin 2 of J1. Refer to Figure 2-3 below.
MCP1631HV Multi-Chemistry Battery Charger Reference Design VBAT+ + - 1,000 µF 10V Al 2Ω 10W + Variable Power Supply - 0V - 6V VBAT– FIGURE 2-4: 2.3.1.3 Simulated Battery Load. SELECTING BATTERY CHEMISTRY AND NUMBER OF CELLS • Three push buttons are used to start a charge cycle, select chemistry and select number of series cells.
Installation and Operation 2.3.1.4 STATUS LED The MCP1631HV Multi-Chemistry Battery Charger has an LED to indicate charge status or fault status. Table 2-1 represents the state of the Status, Chemistry, and Display LEDs during various states of the charge cycle.
MCP1631HV Multi-Chemistry Battery Charger Reference Design 2.3.1.5 CHARGE PROFILE • Li-Ion - Qualification: Precharge at 200 mA for VCELL < 3.0V - Constant Current = 2A for 1 Cell, 1A for 2 Cell - Constant Voltage = 4.20V, User Calibrated - Charge Termination = 140 mA for 1 Cell and 2 Cell - Overvoltage Detection, once detected, attempt to restart charge cycle 5 times, if overvoltage is persistent, terminate attempts and flash STATUS LED. • NiMH/NiCd - Qualification: Precharge at 200 mA for VCELL < 0.9V.
MCP1631HV MULTI-CHEMISTRY BATTERY CHARGER REFERENCE DESIGN Appendix A. Schematic and Layout A.1 INTRODUCTION This appendix contains the following schematics and layouts for the MCP1631 Multi-Chemistry Battery Charger Reference Design: • • • • • • • Board – Schematic Board – Top Silk Layer Board – Bottom Silk Layer Board – Top Metal Layer Board – Mid1 Metal Layer Board – Mid2 Metal Layer Board – Bottom Metal Layer © 2009 Microchip Technology Inc.
MCP1631HV Multi-Chemistry Battery Charger Reference Design BOARD – SCHEMATIC 1 2 3 A.2 28 27 26 25 24 23 22 21 20 19 18 17 16 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 5 6 7 8 2 1 3 DS51791A-page 14 © 2009 Microchip Technology Inc.
Schematic and Layout A.3 BOARD – TOP SILK LAYER © 2009 Microchip Technology Inc.
MCP1631HV Multi-Chemistry Battery Charger Reference Design A.4 BOARD – BOTTOM SILK LAYER DS51791A-page 16 © 2009 Microchip Technology Inc.
Schematic and Layout A.5 BOARD – TOP METAL LAYER © 2009 Microchip Technology Inc.
MCP1631HV Multi-Chemistry Battery Charger Reference Design A.6 BOARD – MID1 METAL LAYER DS51791A-page 18 © 2009 Microchip Technology Inc.
Schematic and Layout A.7 BOARD – MID2 METAL LAYER © 2009 Microchip Technology Inc.
MCP1631HV Multi-Chemistry Battery Charger Reference Design A.8 BOARD – BOTTOM METAL LAYER DS51791A-page 20 © 2009 Microchip Technology Inc.
MCP1631HV MULTI-CHEMISTRY BATTERY CHARGER REFERENCE DESIGN Appendix B. Bill Of Materials (BOM) TABLE B-1: Qty BILL OF MATERIALS (BOM) Reference Description Manufacturer Part Number 4 B1, B2, B3, B4 BUMPON HEMISPHERE .44X.
MCP1631HV Multi-Chemistry Battery Charger Reference Design TABLE B-1: Qty BILL OF MATERIALS (BOM) (CONTINUED) Reference Description Manufacturer Part Number 1 Q1 HEX/MOS N-CHAN 30V 8.3A 8SOIC International Rectifier IRF7807VTRPBF 1 Q2 MOSFET N-CH 60V 280MA SOT-23 Fairchild Semiconductor® NDS7002A 3 R1, R10, R11 RES 1.00K OHM 1/8W 1% 0805 Panasonic - ECG SMD ERJ-6ENF1001V 1 R12 RES 301K OHM 1/8W 1% 0805 Panasonic - ECG SMD ERJ-6ENF3013V 1 R15 RES 10.
MCP1631HV MULTI-CHEMISTRY BATTERY CHARGER REFERENCE DESIGN Appendix C. Software C.1 DEVICE SOFTWARE FLOWCHART For the latest copy of the MCP1631HV Multi-Chemistry Battery Charger Reference Design firmware, visit our web site at www.microchip.com. C.1.1 Software Functions C.1.1.1 INTERRUPT() Interrupt () Timer 1? Update LED's Update One Second flag Clear Timer 0 Interrupt Flag Y Y Reload PWM Timer High/Low Count + Clear Timer 1 Interrupt Flag Timer 0? Ret © 2009 Microchip Technology Inc.
MCP1631HV Multi-Chemistry Battery Charger Reference Design C.1.1.2 MAIN() Main () Initialize Processor Initialize Parameters Read A/D? Y ON / OFF? Y Second? Y SampleADC() CheckModeChange() DoOneSecondTasks() Update LED's C.1.1.3 SAMPLEADC() SampleADC() Running_Sum += ReadADCChannel() N Samples? Y Average Samples and Store Select Next A/D Channel Ret DS51791A-page 24 © 2009 Microchip Technology Inc.
Software C.1.1.4 READADCCHANNEL() ReadADCChannel() Select Channel MUX Delay 5 µs Start Conversion Complete? N Return Result C.1.1.5 CHECKMODECHANGE() CheckModeChange() Y On/Off Pressed? Config? Y Y ON? Hold for 5 seconds to enter Config Mode Setup() State = Startup Initialize parameters SetParameters() Ret © 2009 Microchip Technology Inc.
MCP1631HV Multi-Chemistry Battery Charger Reference Design C.1.1.6 SETPARAMETERS() SetParameters() NiMH/NiCd Li-Ion Chemistry? LED Driver Setup LED Parameters Setup NiMH Parameters Setup Li-Ion Parameters Ret C.1.1.7 SETIREF() SetIRef(IRef) IRef = 0? N Limit IRef to Min/Max Boundaries Pause PWM Timer 1 Shutdown Timer 1 Ref Current = 0 Setup Timer 1 Reload Variables Re-enable PW Timer 1 Ret DS51791A-page 26 © 2009 Microchip Technology Inc.
Software C.1.1.8 SETUP() Setup() N ON/OFF_SW? Y CHEM_SW? CELLS_SW? Next Chemistry Y Calibrate? Y Increment Number of Cells Li-Ion Calibration Apply 4.2V Reference To Battery Connector Turn On 4 DISPLAY and 2 CHEM LED's Average 16 A/D Battery Voltage Readings Store Average in EEPROM Y CELLS_SW? A C.1.1.9 B INCREMENTIREF() IncrementIRef(int inc) N inc = 0? SetIRef (IRef + inc) Ret © 2009 Microchip Technology Inc.
MCP1631HV Multi-Chemistry Battery Charger Reference Design C.1.1.10 DOONESECONDTASKS() DoOneSecondTasks() Decrement Charge Timer Update Chemistry LED's OverVoltage? Y State = OV A DoOneSecondTasks() A Y OT? OT Count = 0? Y State = OFF Cause = OTP Decrement OT Count B DS51791A-page 28 C © 2009 Microchip Technology Inc.
Software DoOneSecondTasks() B OPEN THERMISTOR? Reload OT Count Y OT Count = 0? Y State = OFF Cause = OPEN_T Decrement OT Count (NiMH or MiCD compilations only) C C DoOneSecondTasks() STARTUP Charge Timer = 0? Y State = ON Charge Timer = Charge Timeout Switch (State) SHDN = 0 OTCount = OTP Retries SetIRef() D © 2009 Microchip Technology Inc.
MCP1631HV Multi-Chemistry Battery Charger Reference Design DoOneSecondTasks() D ON Switch (State) Cause = 0 SHDN = 1 Reference Current MAX = Condition Current Reference Current MIN = 2 SetIRef(ConditionCurrent) State = QUALIFICATION STATUS LED = ON E DoOneSecondTasks() E QUALIFICATION VBAT >= Condition Voltage? Y Initialize Variables Li-Ion? Y Switch (State) N IRefMax < Condition Current? Y SetIRef(ChargeCurrent) SetIRef(Initial) State = LI_CC NiMH? Y N State = LED_CC State = NM_CC F
Software DoOneSecondTasks() F NM_CC Switch (State) IncrementIRef() Update Peak Voltage Check for V/ t Check for T/ t Check Termination Flags Cause = V/ t Cause = T/ t State = NM_TOPOFF Last Bat = Bat Last Temp = Temp Check For Charge Timer Timeout State = OFF G G NM_TOPOFF Charge Timer = 0? Switch (State) Y State = OFF Status LED = OFF H © 2009 Microchip Technology Inc.
MCP1631HV Multi-Chemistry Battery Charger Reference Design DoOneSecondTasks() H LI_CC Battery < Charge Voltage ? Y IncrementIREF() Switch (State) State = LI_CV IRefMin = ChargeTermination Y Charge Timer = 0? State = OFF I DoOneSecondTasks() I LI_CV Battery >= Charge Voltage ? Y IncrementIRef(-Value) Switch (State) IRef < Termination ? Charge Timer = 0? Y State = OFF Status LED = OFF Y State = OFF J DS51791A-page 32 © 2009 Microchip Technology Inc.
Software DoOneSecondTasks() J LED_CC CHEM SW ? Y IncrementIRef(+Value) Switch (State) CELLS SW ? Y IncrementIRef(-Value) Reset Over Voltage Retry K DoOneSecondTasks() K OV SHDN = 0 SetIRef(0) ChargeTimer = 2 seconds Switch (State) OV Count = 0? Y State = OFF Cause = OVP Decrement OV Count State = STARTUP L © 2009 Microchip Technology Inc.
MCP1631HV Multi-Chemistry Battery Charger Reference Design DoOneSecondTasks() L OFF SHDN = 0 SetIRef(0) Switch (State) Ret C.2 SELECTED SOFTWARE CONSTANTS AND DEFINITIONS 1. FOSC_KHZ = 8000 Microprocessor Oscillator Frequency in kHz. 2. CHARGER_SYSTEM = BUCK_BOOST_REF_DESIGN_BOARD Selects charger system option to build. Multiple options can be created which each use a single header file containing parameters for that specific system.
Software 12. MCP1631_VSIN_RES_DIVIDER_VOLTAGE_SENSE = ((float)((100.0 + 301.0) /(100.0 + 301.0 + 348.0))) MCP1631 Voltage Sense (VSin) Resistor Divider (0.53538). 13. BATTERY_MV_PER_BIT = ((float)(ADC_MV_PER_BIT/ MCP1631_VSIN_RES_DIVIDER_VOLTAGE_SENSE)) Battery voltage A/D value in millivolts per bit. 14. LI_ION_OVER_VOLTAGE_CHARGE = ((int)(200.0/BATTERY_MV_PER_BIT)) Cell overvoltage charge in mV (not averaged) = 50 mV to 200 mV. 15. LI_ION_CONDITION_CURRENT = ((int)(200.
MCP1631HV Multi-Chemistry Battery Charger Reference Design 30. EE_CHEMISTRY_DEFAULT = LiIon Default Chemistry. 31. EE_NUMBER_OF_CELLS_DEFAULT = 2 Default number of cells value. 32. EE_LION_CAL_VOLTAGE_DEFAULT = ((int)((float)(4200.00 / BATTERY_MV_PER_BIT))) Default Lithium Ion battery calibration value. 33. EE_CHARGE_TIMEOUT_DEFAULT = (5*60*60) Maximum charging time. NiMH = Use (C rating in mAh/Charge Current) + 1hr Topoff + 0.25hr pre-condition) *60 sec * 60 min Lithium Ion = Use about 2.
Software C.3 PIC16F883 PORT USAGE /* Port A */ PORTA.0 ADC_THERMISTOR_TEMPERATURE: Thermistor A/D input PORTA.1 ADC_BATTTERY_VOLTAGE: Battery Voltage A/D input PORTA.4 SHDN: System Shutdown and Thermistor Supply Output PORTA.5 ONOFF_SWITCH: On/Off’ switch input PORTA.6 NUMCELLS_SWITCH: Number of Cells’ switch input PORTA.7 CHEMISTRY_SWITCH: Chemistry’ switch input /* Port B */ PORTB.0 LIION_LED: Li-Ion’ LED output PORTB.1 NIMH_LED: NiMH’ LED output PORTB.
MCP1631HV Multi-Chemistry Battery Charger Reference Design C.4 mikroElektronika’s mikroC™ COMPILER STARTUP 1. Startup mikroC™ compiler (compiler not supplied, available at: http://www.mikroe.com). 2. From the toolbar, select “Project | Open Project”. 3. Browse to the evaluation board source code path. 4. Select the existing project file, named “MCP1631HVBuckBoostBatteryChargerReferenceDesign.ppc”. 5. From the toolbar, select : “Project | Edit Project”.
Software C.5 MPLAB® AND PICKIT™ 2 DEBUGGING EXERCISE 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. Startup MPLAB (not supplied, available at: http://www.microchip.com). From the toolbar, select “File | Open Workspace”. Browse to the evaluation board source code path. Select the existing workspace file named “MCP1631HVBuckBoostBatteryChargerReferenceDesign.mcw” or create a new one. Connect the PICkit 2 programmer to header J3 on the battery charger board.
MCP1631HV Multi-Chemistry Battery Charger Reference Design C.6 LAB EXERCISES 1. Startup the mikroCTM compiler and load the “MCP1631HVBuckBoostBatteryChargerReferenceDesign.ppc” if it does not load up automatically. 2. Startup MPLAB and load the “MCP1631HVBuckBoostBatteryChargerReferenceDesign.mcw” workspace if it does not start up automatically. C.6.1 Li-Ion Only Exercise (single cell, 1200 mAh pack) 1. In the mikroC™ “Project Summary” frame, click on the “H files” branch to expand the ‘.H’ file list.
Software 24. Press and hold the “ON/OFF” button on the charger board until the LED’s flash (about 5 seconds). The board is now in Configuration Mode. 25. Press and release the “CHEM” button until the “Li-Ion” LED is on. 26. Press and release the “# CELLS” button until the “0” display LED is on and the “1,2,3” display LED’s are off. 27. Press and hold the “# CELLS” button on the charger board until the LED’s flash (about 5 seconds). The board is now calibrated to use the 4.200V as the Li-Ion battery voltage.
MCP1631HV Multi-Chemistry Battery Charger Reference Design C.6.2 NiMH Lab Exercise (3 Cell, 700 mAh pack, with thermistor) 1. In the mikroC™ “Project Summary” frame, click on the “H files” branch to expand the ‘.H’ file list. 2. Double click on the “MULTICHEMISTRY_REF_DESIGN_BOARD_102_00232.H” file to open it. 3. Scroll through the header file and locate “#define LION_SUPPORT”. Set it to “DISABLED”. 4. Scroll through the header file and locate “#define NIMH_SUPPORT”. Set it to “ENABLED”. 5.
Software 27. Press and release the “# CELLS” button until the “0” and “1” “Display” LED’s are on and the “2” and “3” “Display” LED’s are off. The LED display now displays “3” in Hexadecimal. 28. Press the “ON/OFF” button. The charger will exit Configuration mode. 29. Press the “ON/OFF” button. The charger will start charging the battery. 30. Press the “CHEM” button to display the current charger state in HEX. “0” “Display” LED is LS Bit. 31. Press the “# CELLS” button to display the termination cause.
MCP1631HV Multi-Chemistry Battery Charger Reference Design C.6.3 LED Driver Lab Exercise (Two 1 Watt LED’s in series) 1. In the mikroC™ “Project Summary” frame, click on the “H files” branch to expand the ‘.H’ file list. 2. Double click on the “MULTICHEMISTRY_REF_DESIGN_BOARD_102_00232.H” file to open it. 3. Scroll through the header file and locate “#define LION_SUPPORT”. Set it to “DISABLED”. 4. Scroll through the header file and locate “#define NIMH_SUPPORT”. Set it to “DISABLED”. 5.
Software 29. Using an oscilloscope, refer to Appendices A.2 “Board – Schematic” and A.3 “Board – Top Silk Layer” and probe the following components: - VREF = TP3 - PWM = TP4 - Oscillator = TP5 - VSOUT = TP6 - Slope Compensation = TP7 - Temperature = TP8 (if used) - FB = TP9 - Drain Voltage = TP10 - Output Voltage = TP11 30. Press the “ON/OFF” button. The charger will stop charging the battery. © 2009 Microchip Technology Inc.
MCP1631HV Multi-Chemistry Battery Charger Reference Design NOTES: DS51791A-page 46 © 2009 Microchip Technology Inc.
MCP1631HV MULTI-CHEMISTRY BATTERY CHARGER REFERENCE DESIGN Appendix D. Design Example D.1 DESIGN EXAMPLE D.1.1 • • • • • • • • • • Design Parameters: POUT = 10W (typical) VIN = 6V to 16V for MCP1631HV. Choose VIN = 6V for worst case (WC). VOUT = 8.4V for two Li-Ion batteries or 6.6V for four NiMH batteries IOUT = 1.5A for 4 NiMH batteries. Choose DIL = 20%, IOUT = 300 mA. η = Switcher Efficiency @ 80% (typical) VF = Schottky Diode Drop @ 0.35V (typical) IIN_WC = IOUT * VOUT_WC /(VIN_WC * ç) = 1.5A * 6.
Design Example • RArtificial Ramp = τArtificial Ramp/CArtificial Ramp = 15.13 µs/1500 pF = 10 kΩ (max), use around 5.6 kΩ to 9.1 kΩ for tolerances An R value of 5.6 kΩ was used for the Eval Board. D.1.4 Coupling Capacitor: • SWON, D = 25%, t = 0.5 µs IRIPPLE = tON * 2VIN/4L = 0.5 µs * (2)(6V)/(4*10 µH) = 0.150A I1 = IOUT – ½ IRIPPLE = 1.5A – 0.075A = 1.425A I2 = IOUT + ½ IRIPPLE = 1.5A + 0.075A = 1.575A IRMS_ON = SQRT(D * (I12 + I1 * I2 + I22)/3) (for a trapezoidal waveform) = SQRT(0.25 * (1.4252 + 1.
Design Example NOTES: © 2009 Microchip Technology Inc.
WORLDWIDE SALES AND SERVICE AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: http://support.microchip.com Web Address: www.microchip.