Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Adam Naglmuller, B2, 10A
- #INCLUDE "P16F88.INC"
- __CONFIG _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_IO & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF
- __CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF
- pocitatko equ 21h
- #DEFINE RESET INTCON,0
- org 00h
- goto setup
- org 04h
- incf pocitatko ;pricita hrany
- bcf INTCON,INTF ;maze flag preruseni
- retfie
- setup
- bcf STATUS,RP1 ;
- bsf STATUS,RP0 ;
- movlw 07h ;
- movwf CMCON
- movlw 00h
- movwf ANSEL
- movlw 60h
- movwf OSCCON
- movlw 0FFh
- movwf TRISA
- movlw 01h
- movwf TRISB
- clrf pocitatko
- bsf OPTION_REG,INTEDG ; nastaveni reaguje na vzestupnou hranu
- bcf STATUS,RP0
- bcf ADCON0,0 ; vypne ADConverter
- movlw 90h ; sleduje to PORTB(4-7) int0 - preruseni na zaklade hrany
- movwf INTCON
- start
- btfss PORTA,5 ;kontroluje bit 7 v pocitatko
- goto nulovani
- rlf pocitatko,0 ;posun do W
- movwf PORTB
- goto start
- nulovani
- clrf pocitatko
- movf pocitatko,0
- movwf PORTB
- goto start
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement