Gast
#2175781
;project5
;-----------------------------------------------------------------------
-----
list p=16f84a ; processor pic16f84a
#include <p16f84a.inc> ; verwendet definition
;-----------------------------------------------------------------------
-----
__CONFIG _CP_OFF&_PWRTE_ON&_WDT_OFF&_RC_OSC ; voreinstellungen
;-----------------------------------------------------------------------
-----
org 0x00 ; reset adresse 00(hex)
goto main ; sprung zu main
;-----------------------------------------------------------------------
-----
main
bsf STATUS,RP0 ; schaltet auf bank1
bcf TRISB,0 ; setzt RB0 auf out
bcf TRISB,1 ; setzt RB1 auf out
bcf TRISB,2 ; setzt RB2 auf out
bcf TRISB,3 ; setzt RB3 auf out
bcf TRISB,4 ; setzt RB4 auf out
bcf TRISB,5 ; setzt RB5 auf out
bcf TRISB,6 ; setzt RB6 auf out
bcf TRISB,7 ; setzt RB7 auf out
bcf STATUS,RP0 ; schaltet zurück auf bank0
SA BTFSS PORTA,0
goto SAEIN
goto SB
SB
BTFSS PORTA,1
goto SBEIN
goto SC
SC
BTFSS PORTA,0
goto SC2
goto SA
SC2 BTFSS PORTA,1
goto AUS
goto SA
AUS bcf PORTB,0
bcf PORTB,1
bcf PORTB,2
bcf PORTB,3
bcf PORTB,4
bcf PORTB,5
bcf PORTB,6
bcf PORTB,7
goto SA
SAEIN comf PORTB,0
comf PORTB,1
comf PORTB,2
comf PORTB,3
goto SA
SBEIN
comf PORTB,4
comf PORTB,5
comf PORTB,6
comf PORTB,7
goto SA
end
______________________________________________________________________
_
Das was ihr da oben seht ist mein Code ich habe da folgendes problem und
zwar soll SC alle Ports ausschalten aber es soll nicht passieren das ich
das Programm SC auslöse wenn ich SA und SB ausführe,
deswegen muss ich irgendwie die Bits masskieren finde dazu aber nix in
google kann mir das mal einer anhand meines Codes demonstrieren.