LIST P=12F508 #include "P12F508.INC" gp0 equ 0 gp1 equ 1 gp2 equ 2 gp3 equ 3 gp4 equ 4 gp5 equ 5 __CONFIG _MCLRE_OFF & _CP_OFF & _WDT_OFF & _IntRC_OSC movwf OSCCAL clrf STATUS _TRIS_CACHE EQU 8 _GPIO_CACHE EQU 9 movlw D'255' movwf _TRIS_CACHE movlw D'0' movwf _GPIO_CACHE bcf _GPIO_CACHE, gp0 movf _GPIO_CACHE, W movwf GPIO bcf _GPIO_CACHE, gp1 movf _GPIO_CACHE, W movwf GPIO bcf _TRIS_CACHE, gp0 movf _TRIS_CACHE, W tris GPIO bcf _TRIS_CACHE, gp1 movf _TRIS_CACHE, W tris GPIO clrwdt movlw D'135' option start bsf _GPIO_CACHE, gp1 movf _GPIO_CACHE, W movwf GPIO call wait8ms bsf _GPIO_CACHE, gp0 movf _GPIO_CACHE, W movwf GPIO call wait991ms bcf _GPIO_CACHE, gp0 movf _GPIO_CACHE, W movwf GPIO call wait8ms bcf _GPIO_CACHE, gp1 movf _GPIO_CACHE, W movwf GPIO call wait991ms goto start wait991ms movlw D'1' movwf D'10' _for_start0 movlw D'121' subwf D'10', W btfss STATUS, C goto _for_body0 btfss STATUS, Z goto _for_end0 _for_body0 movlw D'1' movwf D'11' _for_start1 movlw D'32' subwf D'11', W btfss STATUS, C goto _for_body1 btfss STATUS, Z goto _for_end1 _for_body1 call wait256us incf D'11', F goto _for_start1 _for_end1 incf D'10', F goto _for_start0 _for_end0 retlw D'0' wait8ms movlw D'1' movwf D'11' _for_start2 movlw D'32' subwf D'11', W btfss STATUS, C goto _for_body2 btfss STATUS, Z goto _for_end2 _for_body2 call wait256us incf D'11', F goto _for_start2 _for_end2 retlw D'0' wait256us movf TMR0, W movwf D'12' _do_start0 movf TMR0, W subwf D'12', W btfss STATUS, Z goto _do_end0 goto _do_start0 _do_end0 retlw D'0' end