Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <p16F84a.inc> ; processor specific variable ; definitions
- __CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _HS_OSC
- CBLOCK 0x0c
- COUNT_I
- COUNT_J
- COUNT_k
- ENDC
- org 0x00
- bsf STATUS ,RP0
- bcf TRISB ,3
- bcf TRISA ,2
- bsf TRISA ,3
- bsf STATUS ,RP0
- clrf PORTB
- CLRf PORTB
- MAIN
- movlw 0x04
- movwf COUNT_k
- MAINLOOP
- btfsc PORTA ,3
- call delay
- btfsc PORTA ,3
- comf PORTA,2
- btfsc PORTA ,3
- goto lamba
- goto MAINLOOP
- lamba DECFSZ COUNT_k ,F
- bsf PORTB ,3
- goto MAINLOOP
- delay movlw d'200
- movwf COUNT_I
- loop_I
- movlw d'166
- movwf COUNT_J
- loop_J
- decfsz COUNT_J ,F
- goto loop_J
- decfsz COUNT_I ,F
- goto loop_I
- return
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement