Installation and Operation
©
2005 Microchip Technology Inc.
DS51551A-page 9
Activating Application and Changing the LED intensity
1.
To activate the LEDs, simply press the S1 push button. The LEDs will turn on at
a low intensity level when the push button is pressed, gaining intensity when the
push button is pressed again. There are 5 levels of LED intensity (plus the “off”
state).
The intensity of the LEDs are controlled via the SHDN input pin of the MCP1252.
A Pulse-Width Modulated (PWM) signal is generated by the PIC10F206 and routed
to the SHDN input pin of the MCP1252. The MCP1252 is actually pulsed, and the
duty cycle of the PWM waveform is varied, such that narrow pulses create a
low-intensity condition, while wider pulses create a high-intensity condition.
2.
The LEDs will be turned off, and the system will enter Sleep mode, when the
LEDs are in the high-intensity state and the push button is pressed. Subsequent
push button presses will cycle the LEDs as described in Step 1.
Evaluating the Application
The best way to evaluate the MCP1252 Charge Pump Backlight LED Demo Board is
to dig into the circuit. Measure voltages and currents with a DVM and probe the board
with an oscilloscope. Test points have been provided to simplify this task. The test
points correspond to the pins of the MCP1252: PGD (= PGOOD), Vout, V
DD
(= V
IN
),
GND, SHDN and FB.
The firmware program in the PIC10F206 can also be edited to modify the operation of
the application. For example, the output signal that is routed from GP0 of the
PIC10F206 to SHDN of the MCP1252 can be changed to implement different light
intensities, slowly blinking the LEDs on/off or provide some other pattern. There is also
an optional push button (S2) that can be used to provide additional control options to
the system
Firmware
The PIC10F206 comes preprogrammed with firmware to operate the system as
described above. The program file can be found on the CD that comes with the kit. The
file listing and firmware flow diagram are shown in Appendix C. “00016R1.asm
Source Code”.
The program is fairly simple and straightforward. There is an initialization routine at the
beginning of the program. The constants allow for five LED intensity levels to be
adjusted to the appropriate light intensity (
LED_HI_ON
,
LED_MEDHI_ON
, etc.), set the
PWM period (PERIOD) and maximum time (
MAX_TIME
) before the unit switches back
to Sleep mode. The variables track what mode the unit is in (
MODE
), implement
counters (COUNTER, TIMERH, TIMERL), etc.
Upon resetting the processor, the ports are initialized and registers are configured in
the INIT_PORTS routine. If the device has come out of Sleep mode, the
MODE
variable
is set so the LEDs will be at low intensity. The OPTION register is configured to
wake-up on Port pin change. The GPIO port is configured to set GP0 (PWM to the
MCP1252) as an output and GP1, GP2 and GP3 (push button) as inputs. The
processor will reset on power-up or due to a wake-up from Sleep mode. Therefore, the
STATUS register needs to be tested to determine the source of the reset. If the reset
occurred due to powering up the system for the first time, the program proceeds to the
INIT_VARS
subroutine, where the program variables are initialized. If the reset
occurred due to a wake-up from Sleep mode, the program proceeds to the
WAKE
subroutine.
Содержание MCP1252
Страница 1: ...2005 Microchip Technology Inc DS51551A MCP1252 Charge Pump Backlight LED Demo Board User s Guide...
Страница 17: ...Schematic and Layouts 2005 Microchip Technology Inc DS51551A page 13 A 3 BOARD TOP ASSEMBLY DRAWING M...
Страница 19: ...Schematic and Layouts 2005 Microchip Technology Inc DS51551A page 15 A 5 BOARD BOTTOM LAYER FROM TOP...
Страница 20: ...MCP1252 Charge Pump Backlight LED Demo Board User s Guide DS51551A page 16 2005 Microchip Technology Inc NOTES...
Страница 22: ...MCP1252 Charge Pump Backlight LED Demo Board User s Guide DS51515A page 18 2005 Microchip Technology Inc NOTES...
Страница 29: ...00016R1 asm Source Code 2005 Microchip Technology Inc DS51551A page 25 NOTES...