sudan
Member level 5
Hai Experts,
I want to send a message to a Mobile Phone from a GSM activated by a Micro 89C51.I am using the following code. But the code is not working. Can anyone debug and correct it please......
Sudan
; CODE
org 00h
ajmp main
org 30h
mov p1,#00h
mov p3,#00h
mov p2,#00h
setb p2.1
main:mov scon,#50h
mov tmod,#20h
mov th1,#0fdh
mov dptr,#string1
call send_string
CALL DELAY
mov dptr,#string2
call send_string
call delay
mov dptr,#string5
call send_string
call delay
mov dptr,#string3
call send_string
call delay
mov dptr,#string4
call send_string
call delay
mov dptr,#string5
call send_string
call delay
call here1
send_string:
l1:clr a
movc a,@a+dptr
setb tr1
acall send
inc dptr
jz l2
sjmp l1
send:mov sbuf,a
here:jnb ti,here
clr ti
ret
l2:nop
DELAY:
MOV R1,#0FFH
REP2:
MOV R2, #0FFH
REP1:
NOP
DJNZ R2, REP1
DJNZ R1, REP2
RET
string1 :db "AT+CMGS",0
string2 :db "9840657600",0
string3 :db "message",0
string4 :db 0x1a,0
string5 :db 0x0d,0
here1 :ajmp here1
end
I want to send a message to a Mobile Phone from a GSM activated by a Micro 89C51.I am using the following code. But the code is not working. Can anyone debug and correct it please......
Sudan
; CODE
org 00h
ajmp main
org 30h
mov p1,#00h
mov p3,#00h
mov p2,#00h
setb p2.1
main:mov scon,#50h
mov tmod,#20h
mov th1,#0fdh
mov dptr,#string1
call send_string
CALL DELAY
mov dptr,#string2
call send_string
call delay
mov dptr,#string5
call send_string
call delay
mov dptr,#string3
call send_string
call delay
mov dptr,#string4
call send_string
call delay
mov dptr,#string5
call send_string
call delay
call here1
send_string:
l1:clr a
movc a,@a+dptr
setb tr1
acall send
inc dptr
jz l2
sjmp l1
send:mov sbuf,a
here:jnb ti,here
clr ti
ret
l2:nop
DELAY:
MOV R1,#0FFH
REP2:
MOV R2, #0FFH
REP1:
NOP
DJNZ R2, REP1
DJNZ R1, REP2
RET
string1 :db "AT+CMGS",0
string2 :db "9840657600",0
string3 :db "message",0
string4 :db 0x1a,0
string5 :db 0x0d,0
here1 :ajmp here1
end