Microcontroller and GSM interface

Status
Not open for further replies.

sudan

Member level 5
Joined
Feb 7, 2010
Messages
93
Helped
8
Reputation
16
Reaction score
5
Trophy points
1,288
Location
chennai
Activity points
1,786
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
 

Look at this page and check it with your code

**broken link removed**

Nandhu
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…