Professional Documents
Culture Documents
org 0030h
main:
mov sp,#0fh
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov r1,#30d mov r0,#20d mov th0,#3ch mov tl0,#0b0h mov tmod,#21h
;timer 0 is used to generate 30 sec. delay ;timer 1 is used to generate baud rate
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov p1,#0ffh
;p1.0,1.1,1.2
sensor inputs
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;a subroutine to display set temperature in 1st line ;bit 00h is indicating enable disable status
enabling1:
ljmp enabling
setb p2.4
mov a,#'e'
acall datadisplay
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
check:
display1:
ljmp display
enabling:
checkk:
jnb 02h,checkk
enable:
clr 02h
mov a,#'S'
acall datadisplay
check2:
door11: door22:
intruder: wait1:
conti:
setb p2.5
acall datadisplay
mov a,#0c1h
acall command
mov a,#'U'
acall datadisplay
her1:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Door 1
door1: wait2:
ljmp check
conti1:
setb p2.5
her2:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Door 1
door2: wait3:
conti2:
setb p2.5
her3:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
command: acall ready mov p0,a clr p2.0 clr p2.1 setb p2.2 clr p2.2 ret
datadisplay: acall ready mov p0,a setb p2.0 clr p2.1 setb p2.2 clr p2.2 ret
ready: setb p0.7 clr p2.0 setb p2.1 back: clr p2.2 setb p2.2 jb p0.7,back ret
intru:
dor1:
dor2:
serial:
clr A movc a,@a+dptr jz complete acall send inc dptr sjmp serial
complete:ret
send: her:
first:
DB "AT+CMGF=1",0dh,0ah,0
;9
second: DB "AT+CMGS=",0
numb: DB "94284xxxxx",0 msg1: DB 0dh,0ah,"Intruder alert",1ah,0 msg2: DB 0dh,0ah,"Door1 alert",1ah,0 msg3: DB 0dh,0ah,"Door2 alert",1ah,0 ;6
in0:
time0:
djnz r0,next djnz r1,next1 clr tr0 setb 02h mov r1,#30d
next1:
mov r0,#20d
next:
end