This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sending sms throudh gsm modem code problem

hiii this is my code for sending sms throgh GSM MODEM ussing MICROCONTROLLER 8051....but im not getting output can u plz modify our code and tell suggestions if any.....i must submit my project in two days plz hgelp me out.....thanks....

org 0000h
start: mov TMOD, #20H mov TH1, #-3
mov SCON, #50H setb TR1
mov dptr,#mydata1

L1: clr a
movc a,@a+dptr
jz L3 clr ti
mov sbuf,a
inc dptr

L2:jnb ti,L2 sjmp L1
L3:mov a,#0dh clr ti mov sbuf,a

L4: jnb ti,L4 lcall delay mov dptr,#mydata2

L5: clr a movc a,@a+dptr jz L6 clr ti mov sbuf,a
inc dptr

L7:jnb ti,L7 Sjmp L5

L6:mov a,#0dh clr ti mov sbuf,a

L8:jnb ti, L8 lcall delay
mov dptr,#mydata3

L9: clr a
movc a,@a+dptr jz L10 clr ti mov sbuf,a
inc dptr

L11:jnb ti,L11 sjmp L9

L10: mov a,#1ah clr ti mov sbuf,a

L11:jnb ti, L11 CLR TR1 lcall delay1

mydata1:db 'at+cmgf=1',0

mydata2:db 'at+cmgs="MOBILE NUM"',0

mydata3:db ‘ MESSAGE TO BE TYPED ',0
delay: MOV R5,#20H
HERE3: MOV R6,#0FFH
HERE2: MOV R7,0FFH
HERE1: DJNZ R7,HERE1 DJNZ R6,HERE2 DJNZ R5,HERE3
RET
Delay1: mov r0,#0ffh
ahere2:mov r1,#0ffh
ahere1:djnz r1,ahere1 djnz r0,ahere2 ret
end

Parents
  • I think you first try to send "AT" command & check is response is getting or not?

    From this you can check your cmd's are going or not?

    And whenever you send any command check its reply also, because it gives you reliability.

    One more thing after modem reset give delay for sending first command to modem. Because modem takes some time to get stable.

Reply
  • I think you first try to send "AT" command & check is response is getting or not?

    From this you can check your cmd's are going or not?

    And whenever you send any command check its reply also, because it gives you reliability.

    One more thing after modem reset give delay for sending first command to modem. Because modem takes some time to get stable.

Children