; luefterstrg.asm ; Name: Lueftersteuerung ; Autor: Hendrik J. Schlehlein ; Datum: 10.01.2019 S EQU P2.5 Tv EQU P3.2 Tr EQU P3.3 ORG 0 SJMP main ORG 3 SJMP SR_hoch ORG 13h SJMP SR_runter SR_hoch: SETB EX0 MOV A, P1 CJNE A,#240, hoch SJMP return0 hoch: RL A INC A MOV P1, A LCALL UP_warte250ms return0: CLR EX0 RETI SR_runter: SETB EX1 MOV A, P1 CJNE A,#254, runter SJMP return0 runter: DEC A RR A MOV P1, A LCALL UP_warte250ms return1: CLR EX1 RETI UP_init: SETB IT0 SETB IT1 SETB EX0 SETB EX1 CLR IE0 CLR IE1 MOV P1,#255 RET UP_warte250ms: MOV R0, #250;2 MOV R1, #198;2 MOV R2, #5;2 while1: DJNZ R0, while1;2 MOV R0, #250 DJNZ R1, while1 MOV R1, #199 DJNZ R2, while1 RET;2 main: LCALL UP_init while0: JB S, while0 MOV P1,#254 SETB EA LCALL UP_warte250ms while2: JNB S, while2 while3: JB S, while3 MOV P1,#255 ;CLR EA LCALL UP_warte250ms while4: JNB S, while4 SJMP while0 END