Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <p16f1517>
- __CONFIG _CONFIG1 ,_FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_ON & _CP_OFF & _BOREN_OFF &_CLKOUTEN_OFF
- __CONFIG _CONFIG2 , _WRT_OFF & _VCAPEN_OFF & _LVP_OFF
- #define LE_L PORTC,4
- #define LE_H PORTC,5
- #define BL PORTC,2
- ORG 0x00
- goto ustawienia
- ORG 0x04
- goto przerwanie
- ustawienia
- C1 equ 0x64
- C2 equ 0x63
- C3 equ 0x62
- C4 equ 0x61
- BANKSEL PORTA
- clrf PORTB
- clrf PORTC
- clrf PORTD
- BANKSEL TRISA
- clrf TRISA
- movlw 0x05
- movwf TRISB
- clrf TRISD
- movlw 0x74
- movwf TRISC
- BANKSEL ANSELA
- clrf ANSELB
- clrf ANSELC
- clrf ANSELD
- BANKSEL LATA
- clrf LATB
- clrf LATC
- clrf LATD
- MAIN
- przerwanie
- BTFSC INTCON,INTF ;bo to ma reagowac na przerwanie od przycisku
- goto OB_OK
- BTFSC INTCON,TMR0IF ;bo to ma reagowac na przerwanie od Timer0
- goto OB_TMR0
- PRZYCISKI
- BTFSS PORTB,0
- GOTO DOWN
- GOTO OK
- DOWN
- BTFSS PORTB,2
- GOTO PRZYCISKI
- GOTO ZERO
- ZERO
- CLRF C1
- CLRF C2
- CLRF C3
- CLRF C4
- OK
- INCF C1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement