Datasheet
MCP1631HV Multi-Chemistry Battery Charger Reference Design
DS51791A-page 44 © 2009 Microchip Technology Inc.
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. Scroll through the header file and locate “#define LED_DRIVER_SUPPORT”.
Set it to “ENABLED”.
6. Scroll down to the “#IF (LED_DRIVER_SUPPORT == ENABLED) section of the
header file. The section contains LED Driver specific parameters.
7. Set the LED_DRIVER_OVER_VOLTAGE to 3600 mV. (Overvoltage Shutdown
value per LED).
8. Set the LED_DRIVER_CONDITION_CURRENT to 10 mAh.
9. Set the LED_DRIVER_CONDITION_VOLTAGE to 0 mV. (Skips Conditioning
State, not needed).
10. Set the LED_DRIVER_CURRENT to 300 mAh. (Constant Current mode).
11. Save the file (File | Save).
12. Compile (Project | Build).
13. Open MPLAB and load the workspace if it is not already loaded. (File | Open
Workspace) MCP1631HVBuckBoostBatteryChargerReferenceDesign.mcw.
14. Import the new “MCP1631HVBuckBoostBatteryChargerReferenceDesign.hex”
file. (File | Import)
15. Download the file (Debugger | Program) and reset the processor (Debugger |
Reset | Processor Reset).
16. Run the new program (Debugger | Run).
17. Turn on the power supply and set the output voltage to 8V. Turn off the power
supply.
18. Connect the variable 8V supply (+) lead to the input connector (+) pin J1-1.
19. Connect the variable 8V supply (-) lead to the input connector (-) pin J1-2.
20. Connect the two 1 watt LED’s in series to the charger board J2 connector.
21. Turn on the variable 8V supply.
22. 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.
23. Press and release the “CHEM” button until both the “NiMH” and “LiIon” LEDs are
on.
24. Press and release the “# CELLS” button until the “1” “Display” LED is on and the
“0”, “2” and “3” “Display” LED’s are off. The LED display now displays “2” in
Hexadecimal.
25. Press the “ON/OFF” button. The charger will exit Configuration mode.
26. Press the “ON/OFF” button. The charger will start charging the battery.
27. Press the “CHEM” button to display the current charger state in HEX. “0”
“Display” LED is LS Bit.
28. Press the “# CELLS” button to display the termination cause. No LED means no
premature termination.