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
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.
We got response from modem when we typed AT commands and again when we tried from hyperterminal but the output is not coming i.e when we r typing AT commands some other characters are coming ....can u plz tell me wat is the problem???plz its urgent
First check cmd response on hyper terminal.
For this you are connecting one RS232 cable from your PC to GSM modem, am i right?
If you are not getting response then change your RS232 cable. If you are currently using straight cable(i.e DB9 pin no 2 from one end to pin no 2 other end and pin no 3 from one end to pin no 3 other end) then change to cross cable (i.e DB9 pin no 2 from one end to pin no 3 other end and pin no 3 from one end to pin no 2 other end)
we r using RS232 cable ....so the problem is from cable ,right???
may be.
Have you tried by changing cable connection?
we r not using straight cable .....
is there any problem with gsm modem????
"If you are currently using straight cable(i.e DB9 pin no 2 from one end to pin no 2 other end and pin no 3 from one end to pin no 3 other end) then change to cross cable (i.e DB9 pin no 2 from one end to pin no 3 other end and pin no 3 from one end to pin no 2 other end)"
is the cable u discussed used to connect between pc and gsm modem????????
It is internal connections of RS 232 cable.
View all questions in Keil forum