;PROGRAM FOR RUNNING LIGHT 12 led 06.11.09 BY SD DWIVEDI Mod date 01.12.09
COUNTER EQU 70H
TCOUNTER EQU 71H
DCOUNTER EQU 72H
LED1 EQU P0.0
LED2 EQU P0.1
LED3 EQU P0.2
LED4 EQU P0.3
LED5 EQU P0.4
LED6 EQU P0.5
LED7 EQU P2.7
LED8 EQU P2.6
LED9 EQU P2.5
LED10 EQU P2.4
LED11 EQU P2.3
LED12 EQU P2.2
HOLDFUNCTION EQU P2.1
RUNSPEED EQU P2.0
ORG 00H
sjmp START
ORG 50H
START: MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
SETB RUNSPEED
LCALL DELAY
FUNCTION1: MOV TCOUNTER,#10
REPT1: ACALL STEP1
DJNZ TCOUNTER,REPT1
JNB HOLDFUNCTION,FUNCTION1
MOV P0,#00 ;CLR ALL LEDS
MOV P2,#00 ;CLR ALL LEDS
FUNCTION2: MOV TCOUNTER,#10
REPT2: ACALL STEP2
DJNZ TCOUNTER,REPT2
JNB HOLDFUNCTION,FUNCTION2
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION3: MOV TCOUNTER,#10
REPT3: ACALL STEP3
DJNZ TCOUNTER,REPT3
JNB HOLDFUNCTION,FUNCTION3
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION4: MOV TCOUNTER,#10
REPT4: ACALL STEP4
DJNZ TCOUNTER,REPT4
JNB HOLDFUNCTION,FUNCTION4
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION5: MOV TCOUNTER,#10
REPT5: ACALL STEP5
DJNZ TCOUNTER,REPT5
JNB HOLDFUNCTION,FUNCTION5
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION6: MOV TCOUNTER,#10
REPT6: ACALL STEP6
DJNZ TCOUNTER,REPT6
JNB HOLDFUNCTION,FUNCTION6
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION7: MOV TCOUNTER,#10
REPT7: ACALL STEP7
DJNZ TCOUNTER,REPT7
JNB HOLDFUNCTION,FUNCTION7
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION8: MOV TCOUNTER,#10
REPT8: ACALL STEP8
DJNZ TCOUNTER,REPT8
JNB HOLDFUNCTION,FUNCTION8
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION9: MOV TCOUNTER,#10
REPT9: ACALL STEP9
DJNZ TCOUNTER,REPT9
JNB HOLDFUNCTION,FUNCTION9
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION10: MOV TCOUNTER,#10
REPT10: ACALL STEP10
DJNZ TCOUNTER,REPT10
JNB HOLDFUNCTION,FUNCTION10
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION11: MOV TCOUNTER,#10
REPT11: ACALL STEP11
DJNZ TCOUNTER,REPT11
JNB HOLDFUNCTION,FUNCTION11
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION12: MOV TCOUNTER,#10
REPT12: ACALL STEP12
DJNZ TCOUNTER,REPT12
JNB HOLDFUNCTION,FUNCTION12
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION13: MOV TCOUNTER,#10
REPT13: ACALL STEP13
DJNZ TCOUNTER,REPT13
JNB HOLDFUNCTION,FUNCTION13
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION14: MOV TCOUNTER,#10
REPT14: ACALL STEP14
DJNZ TCOUNTER,REPT14
JNB HOLDFUNCTION,FUNCTION14
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION15: MOV TCOUNTER,#10
REPT15: ACALL STEP15
DJNZ TCOUNTER,REPT15
JNB HOLDFUNCTION,FUNCTION15
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION16: MOV TCOUNTER,#10
REPT16: ACALL STEP16
DJNZ TCOUNTER,REPT16
JNB HOLDFUNCTION,FUNCTION16
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION17: MOV TCOUNTER,#10
REPT17: ACALL STEP17
DJNZ TCOUNTER,REPT17
JNB HOLDFUNCTION,FUNCTION17
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
FUNCTION18: MOV TCOUNTER,#10
REPT18: ACALL STEP18
DJNZ TCOUNTER,REPT18
JNB HOLDFUNCTION,FUNCTION18
MOV P1,#00 ;CLR ALL LEDS
CLR P3.7
AJMP FUNCTION1
STEP1: MOV COUNTER,#5
WAIT11: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT11
SETB LED6 ;ON
SETB LED5 ;ON
CLR LED4 ;OFF
CLR LED3 ;OFF
CLR LED2 ;OFF
CLR LED1 ;OFF
MOV COUNTER,#5
WAIT12: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT12
CLR LED6 ;OFF
CLR LED5 ;OFF
SETB LED4 ;ON
SETB LED3 ;ON
CLR LED2 ;OFF
CLR LED1 ;OFF
MOV COUNTER,#5
WAIT13: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT13
CLR LED6 ;OFF
CLR LED5 ;OFF
CLR LED4 ;OFF
CLR LED3 ;OFF
SETB LED2 ;ON
SETB LED1 ;ON
RET
STEP2: SETB LED2 ;ON
SETB LED1 ;ON
CLR LED6 ;OFF
CLR LED5 ;OFF
CLR LED4 ;OFF
CLR LED3 ;OFF
MOV COUNTER,#5
WAIT21: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT21
CLR LED6 ;OFF
CLR LED5 ;OFF
SETB LED4 ;ON
SETB LED3 ;ON
CLR LED2 ;OFF
CLR LED1 ;OFF
MOV COUNTER,#5
WAIT22: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT22
CLR LED1 ;OFF
CLR LED2 ;OFF
CLR LED3 ;OFF
CLR LED4 ;OFF
SETB LED5 ;ON
SETB LED6 ;ON
MOV COUNTER,#5
WAIT23: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT23
RET
STEP3: SETB LED6 ;ON
CLR LED4 ;OFF
MOV COUNTER,#5
WAIT31: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT31
SETB LED5 ;ON
CLR LED3 ;OFF
MOV COUNTER,#5
WAIT32: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT32
SETB LED4 ;ON
CLR LED2 ;OFF
MOV COUNTER,#5
WAIT33: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT33
SETB LED3 ;ON
CLR LED1 ;OFF
MOV COUNTER,#5
WAIT34: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT34
SETB LED2 ;ON
CLR LED6 ;OFF
MOV COUNTER,#5
WAIT35: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT35
SETB LED1 ;ON
CLR LED5 ;OFF
MOV COUNTER,#5
WAIT36: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT36
RET
STEP4: SETB LED1 ;ON
CLR LED3 ;OFF
MOV COUNTER,#5
WAIT41: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT41
SETB LED2 ;ON
CLR LED4 ;OFF
MOV COUNTER,#5
WAIT42: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT42
SETB LED3 ;ON
CLR LED5 ;OFF
MOV COUNTER,#5
WAIT43: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT43
SETB LED4 ;ON
CLR LED6 ;OFF
MOV COUNTER,#5
WAIT44: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT44
SETB LED5 ;ON
CLR LED1 ;OFF
MOV COUNTER,#5
WAIT45: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT45
SETB LED6 ;ON
CLR LED2 ;OFF
MOV COUNTER,#5
WAIT46: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT46
RET
STEP5: SETB LED6 ;ON
CLR LED1 ;OFF
MOV COUNTER,#5
WAIT51: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT51
SETB LED5 ;ON
CLR LED6 ;OFF
MOV COUNTER,#5
WAIT52: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT52
SETB LED4 ;ON
CLR LED5 ;OFF
MOV COUNTER,#5
WAIT53: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT53
SETB LED3 ;ON
CLR LED4 ;OFF
MOV COUNTER,#5
WAIT54: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT54
SETB LED2 ;ON
CLR LED3 ;OFF
MOV COUNTER,#5
WAIT55: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT55
SETB LED1 ;ON
CLR LED2 ;OFF
MOV COUNTER,#5
WAIT56: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT56
RET
STEP6: SETB LED1 ;ON
CLR LED6 ;OFF
MOV COUNTER,#5
WAIT61: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT61
SETB LED2 ;ON
CLR LED1 ;OFF
MOV COUNTER,#5
WAIT62: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT62
SETB LED3 ;ON
CLR LED2 ;OFF
MOV COUNTER,#5
WAIT63: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT63
SETB LED4 ;ON
CLR LED3 ;OFF
MOV COUNTER,#5
WAIT64: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT64
SETB LED5 ;ON
CLR LED4 ;OFF
MOV COUNTER,#5
WAIT65: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT65
SETB LED6 ;ON
CLR LED5 ;OFF
MOV COUNTER,#5
WAIT66: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT66
RET
STEP7: SETB LED3 ;ON
SETB LED4 ;ON
CLR LED6 ;OFF
CLR LED5 ;OFF
CLR LED1 ;OFF
CLR LED2 ;OFF
MOV COUNTER,#5
WAIT71: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT71
SETB LED2 ;ON
SETB LED5 ;ON
CLR LED3 ;OFF
CLR LED4 ;OFF
CLR LED1 ;OFF
CLR LED6 ;OFF
MOV COUNTER,#5
WAIT72: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT72
SETB LED1 ;ON
SETB LED6 ;ON
CLR LED3 ;OFF
CLR LED4 ;OFF
CLR LED2 ;OFF
CLR LED5 ;OFF
MOV COUNTER,#5
WAIT73: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT73
RET
STEP8: SETB LED1 ;ON
SETB LED6 ;ON
CLR LED5 ;OFF
CLR LED4 ;OFF
CLR LED3 ;OFF
CLR LED2 ;OFF
MOV COUNTER,#5
WAIT81: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT81
SETB LED2 ;ON
SETB LED5 ;ON
CLR LED3 ;OFF
CLR LED4 ;OFF
CLR LED1 ;OFF
CLR LED6 ;OFF
MOV COUNTER,#5
WAIT82: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT82
SETB LED3 ;ON
SETB LED4 ;ON
CLR LED1 ;OFF
CLR LED2 ;OFF
CLR LED6 ;OFF
CLR LED5 ;OFF
MOV COUNTER,#5
WAIT83: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT83
RET
STEP9: MOV COUNTER,#5
WAIT91: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT91
SETB LED6 ;ON
SETB LED5 ;ON
CLR LED4 ;OFF
CLR LED3 ;OFF
CLR LED2 ;OFF
CLR LED1 ;OFF
MOV COUNTER,#5
WAIT92: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT92
SETB LED4 ;ON
SETB LED3 ;ON
CLR LED6 ;OFF
CLR LED5 ;OFF
CLR LED2 ;OFF
CLR LED1 ;OFF
MOV COUNTER,#5
WAIT93: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT93
SETB LED1 ;ON
SETB LED2 ;ON
CLR LED6 ;OFF
CLR LED5 ;OFF
CLR LED3 ;OFF
CLR LED4 ;OFF
MOV COUNTER,#5
WAIT94: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT94
SETB LED3 ;ON
SETB LED4 ;ON
CLR LED6 ;OFF
CLR LED5 ;OFF
CLR LED2 ;OFF
CLR LED1 ;OFF
RET
STEP10: MOV COUNTER,#5
WAIT101: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT101
SETB LED4 ;ON
SETB LED3 ;ON
CLR LED5 ;OFF
CLR LED2 ;OFF
CLR LED6 ;OFF
CLR LED1 ;OFF
MOV COUNTER,#5
WAIT102: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT102
SETB LED5 ;ON
SETB LED2 ;ON
CLR LED6 ;OFF
CLR LED1 ;OFF
MOV COUNTER,#5
WAIT103: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT103
SETB LED6 ;ON
SETB LED1 ;ON
MOV COUNTER,#5
WAIT104: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT104
MOV P1,#00
CLR P3.7
RET
STEP11: MOV COUNTER,#5
WAIT111: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT111
SETB LED6 ;ON
SETB LED1 ;ON
CLR LED5 ;OFF
CLR LED2 ;OFF
CLR LED3 ;OFF
CLR LED4 ;OFF
MOV COUNTER,#5
WAIT112: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT112
SETB LED5 ;ON
SETB LED2 ;ON
CLR LED3 ;OFF
CLR LED4 ;OFF
MOV COUNTER,#5
WAIT113: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT113
SETB LED4 ;ON
SETB LED3 ;ON
MOV COUNTER,#5
WAIT114: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT114
MOV P1,#00
CLR P3.7
RET
STEP12: MOV COUNTER,#5
WAIT121: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT121
SETB LED1 ;ON
SETB LED4 ;ON
CLR LED2 ;OFF
CLR LED3 ;OFF
CLR LED6 ;OFF
CLR LED5 ;OFF
MOV COUNTER,#5
WAIT122: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT122
SETB LED5 ;ON
SETB LED2 ;ON
CLR LED6 ;ON
CLR LED1 ;ON
CLR LED3 ;OFF
CLR LED4 ;OFF
MOV COUNTER,#5
WAIT123: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT123
SETB LED3 ;ON
SETB LED6 ;ON
CLR LED5 ;ON
CLR LED2 ;ON
CLR LED1 ;OFF
CLR LED4 ;OFF
RET
STEP13: MOV COUNTER,#5
WAIT131: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT131
SETB LED6 ;ON
SETB LED3 ;ON
CLR LED5 ;OFF
CLR LED2 ;OFF
CLR LED1 ;OFF
CLR LED4 ;OFF
MOV COUNTER,#5
WAIT132: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT132
SETB LED5 ;ON
SETB LED2 ;ON
CLR LED6 ;ON
CLR LED1 ;ON
CLR LED3 ;OFF
CLR LED4 ;OFF
MOV COUNTER,#5
WAIT133: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT133
SETB LED4 ;ON
SETB LED1 ;ON
CLR LED5 ;ON
CLR LED2 ;ON
CLR LED6 ;OFF
CLR LED3 ;OFF
RET
STEP14: MOV COUNTER,#5
WAIT141: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT141
SETB LED6 ;ON
SETB LED1 ;ON
CLR LED5 ;OFF
CLR LED2 ;OFF
CLR LED3 ;OFF
CLR LED4 ;OFF
MOV COUNTER,#5
WAIT142: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT142
SETB LED5 ;ON
SETB LED2 ;ON
MOV COUNTER,#5
WAIT143: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT143
SETB LED3 ;OFF
SETB LED4 ;OFF
MOV COUNTER,#5
WAIT144: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT144
CLR LED1 ;OFF
CLR LED6 ;OFF
MOV COUNTER,#5
WAIT145: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT145
CLR LED2 ;OFF
CLR LED5 ;OFF
MOV COUNTER,#5
WAIT146: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT146
CLR LED3 ;OFF
CLR LED4 ;OFF
RET
STEP15: MOV COUNTER,#5
WAIT151: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT151
SETB LED3 ;ON
SETB LED4 ;ON
CLR LED5 ;OFF
CLR LED2 ;OFF
CLR LED1 ;OFF
CLR LED6 ;OFF
MOV COUNTER,#5
WAIT152: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT152
SETB LED5 ;ON
SETB LED2 ;ON
MOV COUNTER,#5
WAIT153: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT153
SETB LED1 ;ON
SETB LED6 ;ON
MOV COUNTER,#5
WAIT154: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT154
CLR LED3 ;OFF
CLR LED4 ;OFF
MOV COUNTER,#5
WAIT155: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT155
CLR LED2 ;OFF
CLR LED5 ;OFF
MOV COUNTER,#5
WAIT156: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT156
CLR LED1 ;OFF
CLR LED6 ;OFF
RET
STEP16: SETB LED1 ;ON
CLR LED2 ;OFF
MOV COUNTER,#5
WAIT161: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT161
SETB LED2 ;ON
CLR LED1 ;OFF
MOV COUNTER,#5
WAIT162: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT162
SETB LED3 ;ON
CLR LED2 ;OFF
MOV COUNTER,#5
WAIT163: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT163
SETB LED4 ;ON
CLR LED3 ;OFF
MOV COUNTER,#5
WAIT164: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT164
SETB LED5 ;ON
CLR LED4 ;OFF
MOV COUNTER,#5
WAIT165: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT165
SETB LED6 ;ON
CLR LED5 ;OFF
MOV COUNTER,#5
WAIT166: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT166
SETB LED5 ;ON
CLR LED6 ;OFF
MOV COUNTER,#5
WAIT167: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT167
SETB LED4 ;ON
CLR LED5 ;OFF
MOV COUNTER,#5
WAIT168: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT168
SETB LED3 ;ON
CLR LED4 ;OFF
MOV COUNTER,#5
WAIT169: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT169
SETB LED2 ;ON
CLR LED3 ;OFF
MOV COUNTER,#5
WAIT1610: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT1610
RET
STEP17: MOV COUNTER,#5
WAIT171: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT171
SETB LED5 ;ON
SETB LED6 ;ON
CLR LED4 ;OFF
CLR LED3 ;OFF
CLR LED2 ;OFF
CLR LED1 ;OFF
MOV COUNTER,#5
WAIT172: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT172
CLR LED6 ;OFF
SETB LED5 ;ON
SETB LED4 ;ON
CLR LED3 ;OFF
CLR LED2 ;OFF
CLR LED1 ;OFF
MOV COUNTER,#5
WAIT173: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT173
CLR LED6 ;OFF
CLR LED5 ;OFF
CLR LED2 ;OFF
CLR LED1 ;OFF
SETB LED4 ;ON
SETB LED3 ;ON
MOV COUNTER,#5
WAIT174: JB RUNSPEED,$
vJNB RUNSPEED,$
DJNZ COUNTER,WAIT174
CLR LED6 ;OFF
CLR LED5 ;OFF
CLR LED4 ;OFF
CLR LED1 ;OFF
SETB LED2 ;ON
SETB LED3 ;ON
MOV COUNTER,#5
WAIT175: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT175
CLR LED6 ;OFF
CLR LED5 ;OFF
CLR LED4 ;OFF
CLR LED3 ;OFF
SETB LED1 ;ON
SETB LED2 ;ON
MOV COUNTER,#5
WAIT176: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT176
CLR LED6 ;OFF
CLR LED5 ;OFF
CLR LED1 ;OFF
CLR LED4 ;OFF
SETB LED2 ;ON
SETB LED3 ;ON
MOV COUNTER,#5
WAIT177: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT177
CLR LED6 ;OFF
CLR LED5 ;OFF
CLR LED2 ;OFF
CLR LED1 ;OFF
SETB LED3 ;ON
SETB LED4 ;ON
MOV COUNTER,#5
WAIT178: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT178
CLR LED6 ;OFF
CLR LED3 ;OFF
CLR LED2 ;OFF
CLR LED1 ;OFF
SETB LED4 ;ON
SETB LED5 ;ON
RET
STEP18: MOV COUNTER,#5
WAIT181: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT181
SETB LED1 ;ON
SETB LED2 ;ON
SETB LED3 ;ON
SETB LED4 ;ON
SETB LED5 ;ON
SETB LED6 ;ON
MOV COUNTER,#5
WAIT182: JB RUNSPEED,$
JNB RUNSPEED,$
DJNZ COUNTER,WAIT182
CLR LED1 ;OFF
CLR LED2 ;OFF
CLR LED3 ;OFF
CLR LED4 ;OFF
CLR LED5 ;OFF
CLR LED6 ;OFF
RET
DELAY: MOV R3,#255 ;DELAY2 FOR HOLD DATA
HERE5: MOV R2,#255
HERE4: DJNZ R2,HERE4
DJNZ R3,HERE5
RET
END
Related topics:
8051 Program - 4 bit lcd code | 8051 Program - 8 bit lcd code | 8051 Program - 32bit multiplication | 8051 Program - memory subroutines | 8051 Program - math subroutines | 8051 Program - conversion subroutines
List of topics: 8051
No comments:
Post a Comment