Discussion in "8051 Discussion Forum" started by    star    Nov 25, 2007.
Sat Dec 01 2007, 01:47 am
#21
diagram does not matches code......... r u sure u have posted the correct diagram
Sat Dec 01 2007, 01:54 am
#22
Hi star the code you posted is really simple.. here is a little explaination

BEGIN:
	CALL	DELAY
	MOV	P1,#0FFH
	MOV	A,P1	;read ADC or temprature
	CJNE	A,#40,HIGHER	;check if its equal to 40 or not
	SETB	P2.1	;if equal then swith on the cooler
	CALL     MAIN_DISPLAY_COOLERON	;display "cooler on" on LCD
	JMP	BEGIN
HIGHER:		;jump here if its not equal to 40
	JNC     HIGH_40	;check if temp is less or greater than 40
	;if its less than 40 then
	MOV     A,P1	;read port 1
	CJNE    A,#10,LOWER	;check if temp is equal to 10
	SETB    P3.1	;if yes then swith on the heater
	CALL    MAIN_DISPLAY_HEATHERON	;Display it on LCD
	CLR     P2.1	;swith off cooler
	JMP     BEGIN	;go back

HIGH_40:	;jump here if temp is higher than 40
	CALL    DELAY	;Some delay
	SETB    P2.1	;switch on cooler
	CALL    MAIN_DISPLAY_COOLERON	;display on LCD
	CLR     P3.1	;switch off the heater
	JMP     BEGIN	;go back

LOWER:	;jump here if temp is not equal to 10
	JC      LOW_10	;check if temp is less or greater than 10
	;if its higher than 10 then
	MOV     P2,#00H	;switch off cooler
	MOV     P3,#00H	;switch off heater
	JMP     BEGIN	;go back

LOW_10:	;jump here if temp is less than 10
	SETB    P3.1	;switch on heater
	CALL    MAIN_DISPLAY_HEATHERON	;display on LCD
	CLR     P2.1	;switch off cooler
	JMP     BEGIN	;go back

Summary of the code is...
cooler is on if the temperature is greater than 40, heater is on when temperature is less than 10 and if temperature is in between 10 and 40 both cooler and heater are off.
Sat Dec 01 2007, 01:55 am
#23
I have given explanation to program but as abbas said.. the program does not match the circuit diagram.. please consider revising it.
Sat Dec 01 2007, 10:06 am
#24
thank u for explanation.I try to change the circuit if I can't I ask u to help. u help me????!!! :blush
Sat Dec 01 2007, 12:19 pm
#25
just see what is connected where and make the changes in your circuit.
Fri Dec 07 2007, 03:45 pm
#26
sir
Fri Dec 07 2007, 03:46 pm
#27
sir i need help abt Home Automation Over Internet i have downloaded all but need still more details..........
i have very less time
Fri Dec 07 2007, 05:03 pm
#28
please explain to me what details you want.. i hope you have read the sticky post in the project doubt forum.. did you?

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Richardgar
Sat Apr 20 2024, 11:05 am
AntoniaRoons
Fri Apr 19 2024, 09:59 pm
carpinteyrowrl
Fri Apr 19 2024, 02:51 pm
DonaldJAX
Fri Apr 19 2024, 01:08 pm
Lewisuhakeply
Thu Apr 18 2024, 06:00 pm
Darrellciz
Thu Apr 18 2024, 11:07 am
Charlessber
Thu Apr 18 2024, 09:29 am
BartonSem
Thu Apr 18 2024, 04:56 am