Documente Academic
Documente Profesional
Documente Cultură
Program
INCLUDE REG_52.PDF
NR EQU P3.5
NY EQU P3.4
NG EQU P3.3
SR EQU P1.2
SY EQU P1.3
SG EQU P1.4
ER EQU P1.5
EY EQU P1.6
EG EQU P1.7
WR EQU P3.7
WY EQU P1.0
WG EQU P1.1
CSEG AT 0 ; RESET VECTOR
;---------==========----------==========---------=========--------; PROCESSOR INTERRUPT AND RESET VECTORS
;---------==========----------==========---------=========--------ORG 00H ; Reset
JMP MAIN
;---------==========----------==========---------=========--------MAIN:
MOV SP,#40H
MOV P1,#0FFH
MOV P3,#0FFH
TOP: CLR NR
CLR SR
CLR ER
CLR WY
SETB WG
AT89S51 microcontroller is used to control the process of washing cycle and to drive the external
output devices such as water inlet valve, wash motor, water drain valve.
The control strategy program for AT89S51 microcontroller is implemented by using assembly
language.
The process is based entirely on the principle of taking non-precise inputs from the sensors,
subjecting them to fuzzy arithmetic and obtaining a crisp value of the washing time.
The two inputs are:
1. Degree of dirt
2. Type of dirt
The degree of dirt is determined by the transparency of the wash water. The dirtier the clothes, less
transparent the water being analyzed by the sensors is.
Type of dirt is determined by the time of saturation, the time it takes to reach saturation. Saturation is
a point, at which there is no more appreciable change in the color of the water.
Degree of dirt determines how muchdirty a cloth is.
Where as Type of dirt determines the quality of dirt.
The sets of rules used here to derive the output are:
1. If dirtness_of_clothes is Large and type_of_dirt is Greasy then wash_time is VeryLong;
2. If dirtness_of_clothes is Medium and type_of_dirt is Greasy then wash_time is Long;
3. If dirtness_of_clothes is Small and type_of_dirt is Greasy then wash_time is Long;
4. If dirtness_of_clothes is Large and type_of_dirt is Medium then wash_time is Long;
5. If dirtness_of_clothes is Medium and type_of_dirt is Medium then wash_time is Medium;
6. If dirtness_of_clothes is Small and type_of_dirt is Medium then wash_time is Medium;
7. If dirtness_of_clothes is Large and type_of_dirt is NotGreasy then wash_time is Medium;
8. If dirtness_of_clothes is Medium and type_of_dirt is NotGreasy then wash_time is Short;
9. If dirtness_of_clothes is Small and type_of_dirt is NotGreasy then wash_time is VeryShort
ORG 0H
STEPPER EQU P1
MAIN:
MOV STEPPER, #0CH
ACALL DELAY
MOV STEPPER, #06H
ACALL DELAY
MOV STEPPER, #03H
ACALL DELAY
MOV STEPPER, #09H
ACALL DELAY
SJMP MAIN
DELAY:
MOV R7,#4
WAIT2:
MOV R6,#0FFH
WAIT1:
MOV R5,#0FFH
WAIT:
DJNZ R5,WAIT
DJNZ R6,WAIT1
DJNZ R7,WAIT2
RET
END