list P=12f629
#include <p12f629.inc>
__config _INTRC_OSC_NOCLKOUT & _BODEN_OFF & _WDT_OFF & _PWRTE_ON & _MCLRE_OFF & _CPD_OFF & _CP_OFF
ERRORLEVEL -302
cblock 20h
BH,BL,wait,del_clk1,del_clk2,run,runn
endc
bsf STATUS,RP0 ;bank 1
movlw 0x30
movwf TRISIO ;make bit 4 and 5 inputs
bcf STATUS,RP0
movlw 0x07 ;turn off comparitors
movwf CMCON
startt
movlw 0x44
movwf run
start
movlw 0x22
movwf BL
btfss GPIO,4 ;call to see if low, if low make faster
call faster
btfss GPIO,5
call fastest ;call to see if low, if low make really fast
movlw 0x07
movwf GPIO ;turn on leds
movf BL,0 ;set on time of duty cycle
movwf BH
loop
decfsz BH,1 ;count down the on time
goto loop
movlw 0x00 ;turn leds off
movwf GPIO
movf BL,0 ;set off time of duty cycle
movwf BH
loop2
incfsz BH,1 ;count up to the off time
goto loop2
decfsz run,1 ;run the PWM for a moment
goto start
goto startt
faster
movlw 0x02
movwf BL
return
fastest
movlw 0xff
movwf BL
return
end