;•••••••••••••••••••••••••••••••••••••••• ;Grundeinstellungen ;•••••••••••••••••••••••••••••••••••••••• List p=16F84A include "P16F84A.inc" ;•••••••••••••••••••••••••••••••••••••••• ;Eisprungvektoren ;•••••••••••••••••••••••••••••••••••••••• ORG 0x00 goto Init ORG 0x04 RETFIE ;•••••••••••••••••••••••••••••••••••••••• Init ;•••••••••••••••••••••••••••••••••••••••• bsf STATUS,RP0 movlw B'00000000' movwf TRISA movlw B'00000011' movwf TRISB bcf STATUS,RP0 ;•••••••••••••••••••••••••••••••••••••••• ;Adressenvergabe ;•••••••••••••••••••••••••••••••••••••••• cblock 0x10 counter endc ;•••••••••••••••••••••••••••••••••••••••• ;Timer einstellen 1:256 ;•••••••••••••••••••••••••••••••••••••••• movlw B'00000111' movwf OPTION_REG ;•••••••••••••••••••••••••••••••••••••••• Main ;•••••••••••••••••••••••••••••••••••••••• clrz movf PORTB,0 xorlw B'0000010' BZ Rechts movf PORTB,0 xorlw B'0000001' BZ Links Goto Main ;•••••••••••••••••••••••••••••••••••••••• Rechts ;•••••••••••••••••••••••••••••••••••••••• bsf PORTA,0 Call Zeitreset btfsc PORTB,1 Goto Rechts bcf PORTA,0 Goto Main ;•••••••••••••••••••••••••••••••••••••••• Links ;•••••••••••••••••••••••••••••••••••••••• bsf PORTA,0 Call Zeitreset btfsc PORTB,0 Goto Links bcf PORTA,0 Goto Main ;•••••••••••••••••••••••••••••••••••••••• Zeitreset ;•••••••••••••••••••••••••••••••••••••••• clrf INTCON clrf TMR0 movlw D'15' movfw counter ;•••••••••••••••••••••••••••••••••••••••• Wait ;•••••••••••••••••••••••••••••••••••••••• clrz movf INTCON,0 XORLW B'00000100' bnz Wait clrf INTCON decfsz counter goto Wait return End