Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #INCLUDE <P16F877A.INC>
- COUNT EQU 0Ch
- COUNT_2 EQU 1Ch
- ORG 0
- movlw 0xF0
- movwf PORTB
- bsf STATUS,5
- movlw 0
- movwf TRISB
- bcf STATUS,5
- m2
- BTFSS PORTB,7
- call Flash
- BTFSS PORTB,6
- call Flash2
- BTFSS PORTB,5
- call Flash2
- BTFSS PORTB,4
- call Flash
- GOTO m2
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- Flash
- bsf STATUS,5
- clrf TRISD
- bcf STATUS,5
- movlw 0x01
- movwf PORTD
- LOOPFL
- rlf PORTD, d
- call DELAY3
- BTFSS PORTD, 7
- goto LOOPFL
- movlw 0x00
- movwf PORTD
- call DELAY3
- RETURN
- DELAY3 MOVLW 0
- MOVWF COUNT
- LOOP
- MOVLW 0
- MOVWF COUNT_2
- LOOPP
- nop
- nop
- nop
- DECFsz COUNT_2,F
- GOTO LOOPP
- DECFSZ COUNT,F
- GOTO LOOP
- RETURN
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- Flash2
- bsf STATUS,5
- clrf TRISD
- bcf STATUS,5
- movlw 0x01
- movwf PORTD
- LOOPFL2
- rlf PORTD, d
- call DELAY4
- BTFSS PORTD, 7
- goto LOOPFL2
- movlw 0x00
- movwf PORTD
- call DELAY4
- RETURN
- DELAY4 MOVLW 200
- MOVWF COUNT
- LOOPT
- MOVLW 150
- MOVWF COUNT_2
- LOOPPT
- nop
- nop
- nop
- DECFsz COUNT_2,F
- GOTO LOOPPT
- DECFSZ COUNT,F
- GOTO LOOPT
- RETURN
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement