Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<p16f1517.inc>
- __CONFIG _CONFIG1 ,_FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_ON & _CP_OFF & _BOREN_OFF &_CLKOUTEN_OFF
- __CONFIG _CONFIG2 , _WRT_OFF & _VCAPEN_OFF & _LVP_OFF
- R1 equ 0x20
- R2 equ 0x21
- org 0x00
- BANKSEL PORTA
- CLRF PORTA
- CLRF PORTB
- BANKSEL LATA
- CLRF LATA
- CLRF LATB
- BANKSEL ANSELA
- CLRF ANSELA
- CLRF ANSELB
- BANKSEL TRISA
- MOVLW 0x37
- MOVWF TRISB
- CLRF TRISA
- BANKSEL PORTA
- START
- movlw 0x50
- movwf R2
- btfss PORTB,1
- goto UPNIE
- btfsc PORTB,2
- goto LED14MIGA
- btfsc PORTB,5
- goto LED14MIGA
- btfsc PORTB,4
- goto LED14MIGA
- btfsc PORTB,0
- goto LED14MIGA
- goto LED1MIGA
- UPNIE
- btfss PORTB,2
- goto DOWNNIE
- btfsc PORTB,5
- goto LED14MIGA
- btfsc PORTB,4
- goto LED14MIGA
- btfsc PORTB,0
- goto LED14MIGA
- goto LED2MIGA
- DOWNNIE
- btfss PORTB,5
- goto LEFTNIE
- btfsc PORTB,4
- goto LED14MIGA
- btfsc PORTB,0
- goto LED14MIGA
- goto LED3MIGA
- LEFTNIE
- btfss PORTB,4
- goto RIGHTNIE
- btfsc PORTB,0
- goto LED14MIGA
- goto LED4MIGA
- RIGHTNIE
- goto LED14SWIECI
- LED1MIGA
- bsf PORTA,4
- call wait
- bcf PORTA,4
- call wait
- LED2MIGA
- bsf PORTA,5
- call wait
- bcf PORTA,5
- call wait
- LED3MIGA
- bsf PORTA,6
- call wait
- bcf PORTA,6
- call wait
- LED4MIGA
- bsf PORTA,7
- call wait
- bcf PORTA,7
- call wait
- LED14MIGA
- bsf PORTA,4
- bsf PORTA,5
- bsf PORTA,6
- bsf PORTA,7
- call wait
- bcf PORTA,4
- bcf PORTA,5
- bcf PORTA,6
- bcf PORTA,7
- call wait
- LED14SWIECI
- bsf PORTA,4
- bsf PORTA,5
- bsf PORTA,6
- bsf PORTA,7
- call wait
- goto START
- wait
- decfsz R1,f
- goto wait
- decfsz R2,f
- goto wait
- return
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement