Monday, May 2, 2011

Egg incubator comtrol list Program

List Program Temperature Controller AT89C2051 egg incubator is a program used to control the temperature control device incubator Egg With AT89C2051 which details a series of articles exist on Temperature Controller With AT89C2051. Many requests are asking for the program lists a series Temperature Controller AT89C2051 egg incubators. Hopefully with the upload list of programs from a series Temperature Controller AT89C2051 egg incubators can help and give inspiration to all who are looking teman2 reference to the construction of the Temperature Controller egg incubators. Temperature Controller program listings AT89C2051 Egg incubators that I uploaded are still many shortcomings, so it can be developed more to get better. Following the program listings.

List Program Temperature Controller AT89C2051 Egg incubators
ORG 0h
Coma EQU 30h
UNIT EQU 31H
Dozens EQU 32H
HUNDREDS EQU 33H
MENU_OK EQU 34H
D_SETING1 EQU 35H
D_SETING2 EQU 36H
D_DISPLAY1 EQU 37H
D_DISPLAY2 EQU 38H
D_TEMPERATURE1 EQU 39H
EQU D_TEMPERATURE2 3AH
REVERSE EQU 3BH
REST EQU 3CH
T_MENU BIT P3.0
T_DOWN BIT P3.1
T_UP BIT P3.2
LAMP BIT P3.3
P_TEMPERATURE BIT P3.4
P_ZX BIT P3.5
ACALL SET_AWAL
START: ACALL TEMPERATURE
ACALL MENU
ACALL APPEAL
ACALL CONVERSION
JMP START
TEMPERATURE: MOV R3, # 64H
MOV TMOD, # 15H
MOV TL0, # 00H
MOV TH0, # 00H
SETB TR0
AGAIN: MOV TL1, # 0EFH
MOV TH1, # 0D8H
SETB TR1
ACALL CONVERSION
WAIT: JNB TF1, WAIT
CLR TR1
CLR TF1
DJNZ R3, AGAIN
CLR TR0
CLR TF0
END_T: MOV D_TEMPERATURE1, ​​TL0
MOV D_TEMPERATURE2, TH0
MOV D_DISPLAY1, D_TEMPERATURE1
MOV D_DISPLAY2, D_TEMPERATURE2
ACALL CONVERSION
END_TEMPERATURE: RET
MENU: JB T_MENU, CHECKING_MENU
ACALL DELAYT
ACALL DELAYT
MOV A, MENU_OK
CJNE A, # 0h, SETING_OK
MENU_OK MOV, # 1H
JMP UP
SETING_OK: MOV MENU_OK, # 0h
JMP END_MENU
UP: JB T_UP, DOWN
MOV A, MENU_OK
CJNE A, # 1H, MENU
ACALL DELAYT
D_SETING1 INC.
MOV D_DISPLAY1, D_SETING1
MOV D_DISPLAY2, D_SETING2
ACALL CONVERSION
MOV A, D_SETING1
CJNE A, # 0FFH, UP
CLR D_SETING1
D_SETING2 INC.
MOV D_DISPLAY1, D_SETING1
MOV D_DISPLAY2, D_SETING2
ACALL CONVERSION
DOWN: JB T_DOWN, MENU
MOV A, MENU_OK
CJNE A, # 1H, MENU
ACALL DELAYT
MOV A, D_SETING1
CJNE A, # 00D, less_LSB
MOV A, D_SETING2
CJNE A, # 00D, less_MSB
JMP MENU
less_LSB: DEC D_SETING1
MOV D_DISPLAY1, D_SETING1
MOV D_DISPLAY2, D_SETING2
ACALL CONVERSION
JMP DOWN
less_MSB: DEC D_SETING2
MOV D_SETING1, # 0FFH
MOV A, D_SETING1
DA A
MOV D_DISPLAY1, D_SETING1
MOV D_DISPLAY2, D_SETING2
ACALL CONVERSION
JMP DOWN
CHECKING_MENU: MOV A, MENU_OK
CJNE A, # 0h, SETTINGS
JMP END_MENU
SETTINGS: MOV D_DISPLAY1, D_SETING1
MOV D_DISPLAY2, D_SETING2
ACALL CONVERSION
JMP UP
END_MENU: RET
APPEAL: MOV A, D_SETING1
CJNE A, D_TEMPERATURE1, CHECKING1
JMP B_MSB
CHECKING1: SubB A, D_TEMPERATURE1
JC B_MSB
JMP LIFE
B_MSB: MOV A, D_SETING2
CJNE A, D_TEMPERATURE2, CHECKING2
JMP STOP
CHECKING2: SubB A, D_TEMPERATURE2
JC SWITCH
JMP END_B
SWITCH: SETB LAMPS
END_B: RET
CONVERSION: MOV R1, D_DISPLAY2; MSByte
MOV R2, D_DISPLAY1; LSByte
MOV R4, # 00D
MOV R5, # 00D
MOV R6, # 00D
MOV R7, # 00D
MOV B, # 10D
MOV A, R2
DIV AB
MOV R4, B; 7,6,5,4 BCD DATA IS
MOV B, # 10
DIV AB
MOV R5, B
MOV R6, A
CJNE R1, # 0h, HIGH_BYTE; CHECK FOR HIGH BYTE
SJMP END_KONVERSI
HIGH_BYTE: MOV A, # 6
ADD A, R4
MOV B, # 10
DIV AB
MOV R4, B
ADD A, # 5
ADD A, R5
MOV B, # 10
DIV AB
MOV R5, B
ADD A, # 2
ADD A, R6
MOV B, # 10
DIV AB
MOV R6, B
ADD A, R7
DA A
MOV R7, A
DJNZ R1, HIGH_BYTE
END_KONVERSI: MOV coma, R4
MOV UNITS, R5
MOV tens, R6
HUNDREDS MOV, R7
ACALL DISPLAY
RET
DISPLAY: MOV A, coma; Segment 1
ADD A, # 10H
SWAP A
MOV P1, A
ACALL DELAY
MOV A, UNIT; Segment 2
ADD A, # 20h
SWAP A
MOV P1, A
ACALL DELAY
MOV A, tens; Segment 3
ADD A, # 40H
SWAP A
MOV P1, A
ACALL DELAY
MOV A, HUNDREDS; SEGMENT 4
CJNE A, # 0h, CONTINUES
MOV A, # 0FH
KEEP: ADD A, # 80h
SWAP A
MOV P1, A
ACALL DELAY
RET
SET_START: MOV MENU_OK, # 0h; 1 = MENU, 0 = OK
MOV D_SETING1, # 0h
MOV D_SETING2, # 0h
MOV D_DISPLAY1, # 0h
MOV D_DISPLAY2, # 0h
RET
DELAY: MOV 42H, # 2H
LAGI_1: MOV 43H, # 0FAH
LAGI_2: DJNZ 43H, LAGI_2
DJNZ 42H, LAGI_1
RET
DELAYT: MOV 42H, # 0A0H
AGAIN_3: MOV 43H, # 0F0H
AGAIN_4: DJNZ 43H, AGAIN_4
DJNZ 42H, LAGI_3
RET
END

Hopefully useful and can help or give an idea of ​​making a program to control temperature egg incubators using the microcontroller

0 comments

Post a Comment