Setup_AT89C52_CPU:
setb Up_Relay_Output
setb Stop_Relay_Output
setb Down_Relay_Output
setb Error_Buzzer_Relay_Output
setb Buzzer ;off buzzer
;.........................................................
mov SP,#60H ;SET UP STACK POINTER
mov psw,#00000000b ;set RB0
orl tmod,#00000001b ;Setup timer 0 for mode 1
mov ie,#10000010b ;enable timer0 initerrupt
mov tl0,#<(65536-50000) ;50000us=50ms=0.05s
mov th0,#>(65536-50000)
call Init_93c46
setb tr0 ;Enable timer0
;*******************************************************************************
****
mov r0,#0FFH ;clear 00H-7FH ram
mov r2,#255
clean_ram:
mov a,#0
mov @r0,a
dec r0
djnz r2,clean_ram
Output_ON Stop_Relay_Output
Delay_Timer 15
Output_OFF Stop_Relay_Output