00016R1.asm Source Code
©
2005 Microchip Technology Inc.
DS51551A-page 24
led_med bsf GPIO, pwm ;turn on LED(s) for a set time
movlw led_med_on
call delay
bcf GPIO, pwm ;turn off LED(s) fo a set time
movf led_med_off, w
call delay
call bounce
btfss flag, new_mode
goto led_med
goto mode_select
;low brightness routine
led_low bsf GPIO, pwm ;turn on LED(s) for a set time
movlw led_low_on
call delay
bcf GPIO, pwm ;turn off LED(s) for a set time
movf led_low_off, w
call delay
call bounce
btfss flag, new_mode
goto led_low
goto mode_select
;led off
led_off movlw 0x20
call delay
bcf GPIO, pwm ;turn off LED(s)
movf GPIO, w ;read port before entering sleep mode
sleep
;delay loop for on and off time
delay movwf counter ; Delay = (3 + (3 * counter) + 2) Tcy
loop decfsz counter, f
goto loop
retlw 0x00
;check for button press
bounce btfss GPIO, button ; Is Button Depressed?
goto bounce1 ; Yes, go to “bounce1”
bsf flag, timer_ena ; No, allow timer to start
clrf debounce ; no user entry, reset debounce timer
retlw 0x00 ;
bounce1 btfss flag, timer_ena
retlw 0x00 ;do not increment as we have not seen the debounce
released yet
incfsz debounce, f ;inc debounce timer
retlw 0x00 ;not yet
bsf flag, new_mode
incf mode, f ;a valid press has been detected
bcf flag, timer_ena ;prevent timer from incrementing to prevent
cycling though modes by holding debounce
bounce00 retlw 0x00
end
TABLE C-1:
00016R1.ASM (CONTINUED)
Содержание 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...