;** ********************************************************
;** TITLE : Warrior 2011
;** DATE : 14 FEBRUARY 2011
;**
;** P1.0 : PUMP-1 STATUS
;** P1.1 : FULL TANK-1
;** P1.2 : NORMAL TANK-1
;** P1.3 : RESERVE TANK-1
;**
;** P1.4 : PUMP-2 STATUS
;** P1.5 : FULL TANK-2
;** P1.6 : NORMAL TANK-3
;** P1.7 : RESERVE TANK-3
;**
;** ACC (A) IS KEY POINT TO MAKE DECISION
;** ************************************************************
;** DEVICE : ATMEL MICROCONTROLER 8051 (AT89C51) OR (AT89S51)
;** AURTHOR : SAHARA FOUNDATION – RAJENDRA MAN BANEPALI
;** ************************************************************
;**
;** DESCRIPTION: THE DEVICE IS USED TO AUTOMATE TWO WATER PUMPS
;** ************************************************************
$MOD51
ORG 0000H ;** STARTING FROM 0H
;*** TANK STATUS
_MotorA BIT P1.0 ;*** Out
_WatFullA BIT P1.1 ;*** In
_WaterOnTap BIT P1.2 ;*** In
_WatReserveA BIT P1.3 ;*** In
_MotorB Bit P1.4 ;*** Out
_WatFullB BIT P1.5 ;*** In
;_WatNormalB BIT P1.6
;_WatReserveB BIT P1.7 ;*** In
INIT:
ACALL WELCOME
ACALL NETWORK
START: ;*** START DEVICE…
;*** CHECKING MOTOR ONE
ACALL OperateMoterA
ACALL OperateMoterB
SJMP START
WELCOME:
;*** DISPLAY WELCOME MESSAGE ON LCD
RET
NETWORK:
;*** Serial Communication
RET
OperateMoterA:
;*** Check MotorA/Tank1 for status
JNB _WaterOnTap, OffMotorA ;*** If Water is at tap, it execute next line, if NOT MotorA SET Off
JB _WatFullA, OffMotorA ;*** Water Tank1 is full then Switch Off MotorA, Else exe next line
;*** Checking Reserve Indicator is necessary if you automate only
SETB _MotorA; ;*** Start Motor A
SJMP OutA
OffMotorA:
CLR _MotorA; ;*** Switch Off MotorA
OutA:
RET
OperateMoterB:
;*** Check MotorB/Tank2 for status
JNB _WaterOnTap, OffMotorB ;*** If Water is at tap, it execute next line, if NOT MotorB SET Off
JB _WatFullB, OffMotorB ;*** Water Tank2 is full then Switch Off MotorB, Else exe next line
JNB _WatReserveA, OffMotorB ;*** If tank1 is on reserve status, it switch off mother B111111
;*** Checking Reserve Indicator is necessary if you automate only
SETB _MotorB; ;*** Start Motor B
SJMP OutB
OffMotorB:
CLR _MotorB; ;*** Switch Off MotorB
OutB:
RET
END
Click here to view documentation for Project Warrior