Datasheet

Installation and Operation
© 2009 Microchip Technology Inc. DS51798A-page 15
2.3.1.6 VIEW THE STATE OF MCP1631HV DIGITALLY CONTROLLED
PROGRAMMABLE CURRENT SOURCE REFERENCE DESIGN
The MCP1631HV Digitally Controlled Programmable Current Source Reference
Design is able to show, using an oscilloscope, the system state. To use this feature,
connect the scope probe to test point TP1. Testpoint TP1 is output pin U2-8 of the
PIC16F616 microcontroller. There are nine status waveforms listed below. A pulse
stream of one to nine 10 µs pulses are generated at TP1 test point every one second
interval. The pulse stream indicates the current state of the system software. Note that
the first two states may complete immediately and thus may be difficult to capture on a
non-storage scope.
1 pulse - output power is switched ON
2 pulses - qualification charging
3 pulses - charging - NiMH / NiCd constant current mode
4 pulses - charging - NiMH / NiCd top off current mode
5 pulses - charging - Li-Ion constant current mode
6 pulses - charging - Li-Ion constant voltage mode
7 pulses - dimming - LED constant current mode
8 pulses - fault - overvoltage protection state
9 pulses - output power switched OFF (Standby)
2.3.1.7 PROGRAMMING THE PIC16F616 MICROCONTROLLER
To evaluate the board, the firmware package provides 3 hex files for the LED driver,
Li-Ion Battery Charger, and NiMH/NiCd Battery Charger. The board is factory
programmed with the LED driver firmware for 700 mA maximum current and 10:1
dimming (~70 mA/step). All parameters may be changed in firmware to the desired
value according to the output capability. The source code is commented extensively
and helps the user to define the board.
The header file,
00234R1.h, contains the pre-processor definitions which define the
system. The user may modify the definitions to change specific system parameters to
meet design goals.
mikroElektronika’s mikroC compiler was used to compile the source code and create
the hex files for downloading to the reference board. The mikroC compiler is available
at http://www.mikroe.com. The compiler is not included with the reference board kit.
Header J3 is provided for in-system circuit programming. A PICkit
TM
2 programmer may
be connected to J3 to program the reference board.
1. Connect the PICkit
TM
2 programmer to J3.
2. Start the PICkit
TM
2 software.
3. Set Device to PIC16F616.
4. Erase the device.
5. Select “File” then “Import Hex” from the menu. Browse to the desired
*.hex
firmware file to download.
6. Write the file.
7. The status window should indicate success or failure of the download.