Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] not sending SMS by GSM MODEM WITH 8051

Status
Not open for further replies.

torana

Member level 2
Joined
Sep 11, 2011
Messages
51
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,683
HELLO FRIEND,
I AM TRYING TO SEND SMS FROM AT 89S51 BY USING SIM300 MODEM.
I AM USING FOLLOWING COMMANDS.
AT
AT+CMGF=1
AT+CMGS= ”MOBILE NO”
BUT NOT ABLE TO SEND SMS
But same Modem and commands are working fine with PC.
My hardware connection:
MCU + Max232+ DB9 connector with SIM 300 + max232+ DB9 connector
Both grounds are connected (both DB9)
2nd pin (MCU DB9) is connected to 3rd pin (MODEM DB9)
3rd pin (MCU DB9) (MCU DB9) 2nd pin (MODEM DB9)
SOFTWARE:
For sending command from MCU to SIM300
Baud rate: 9600
Sending command from MCU to SIM 300 (with out interrupt)
Receiving data from Modem, I am using interrupt. But it is not working correctly.
If I will connect PC instead of SIM 300 then I am able to see my command on PC hyper terminal.
I thing I am not getting any type of data from SIM 300.
For testing:
I write a simple code for sending AT command from MCU to SIM300. If my controller get any interrupt from SIM 300 then It will Toggle the led which is connected to MCU. Else the led Will be ON.
On this code My LED is in ON condition. So I feel My MCU is not getting Any Interrupt from SIM 300.
;--------------------------my CODE for only AT command-----------------------------
;--------to test after sending AT whether my modem giving data to MCU or not---------
org 00h ;
ljmp main ;
org 0023h ;
ljmp h4 ;
org 30h ;

main: mov 45h,#59h
setb p1.0
mov a,#38h
acall comwrt
acall delay

mov a,#0eh
acall comwrt
acall delay

mov a,#01h
acall comwrt
acall delay

mov a,#06h
acall comwrt
acall delay

; mov a,45h
; acall datawrt
; acall delay

mov tmod, #20h ;
mov th1, #0fdh ;
mov scon, #50h ;
setb tr1 ;
mov dptr, #mydata1 ;
h1: clr a ;
movc a, @a+dptr ;
jz h2;-----------------------max delay and then display from 45h & 46h
acall send ;
inc dptr ;
sjmp h1 ;
send: mov sbuf, a ;
h3: jnb ti, h3 ;
clr ti ;
ret
h2: mov r2,#30
a1: mov r3,#255
a2: mov r4,#255
a3: djnz r4,a3
djnz r3,a2
djnz r2,a1
mov a,45h
acall datawrt
acall delay
mihir: sjmp mihir
;
har:
mov tmod, #20h ;
mov th1, #0fdh ;
mov scon, #50h ;
mov ie, #10010000b ;
setb tr1


h4: cpl p1.0;----------------------compliment led
clr ie.7;-------------------------disable interrupt
mov a,#00h

jb ti, trans ;
mov a, sbuf ;
;---------------------------------store the value A in to 45h
mov 45h,a
mov a,45h
acall datawrt
acall delay
mov 45h,#36h

;----------------------------------------------------------------


;next-------------- display the data from 45h in to LCD ( display for some time)
;load 45H= $
;return from interrupt

clr ri ;
reti ;
trans: clr ti ;
reti ;

comwrt: mov p2, a ;
clr p0.1 ;
setb p0.0 ;
acall delay ;
clr p0.0 ;
ret ;
datawrt:mov p2, a ;
setb p0.1 ;
setb p0.0 ;
acall delay ;
clr p0.0 ;
ret ;
delay: mov r3, #255 ;
here2: mov r4, #255 ;
here: djnz r4, here ;
djnz r3, here2 ;
ret
;
;
org 400H ;
mydata1:db 'AT',0dh,0 ;


end

Thank you.

_________________
NPES
 

I don't know, if you are required to write your code in assembler language? I'm under the impression that most 8051 programmers changed to C compilers about 30 or 25 years ago. To test the operation of your code, you should connect the MCU with a PC instead of the modem. And start with something simple like "Hello world". If it works, carry on with receiving from UART.

When you finally connect to them modem, use a PC with two RS232 channels as serial "sniffer" to debug the communication.
 

my code is working with PC. I am able to see my command "AT" on PC hyper terminal.
But i am not able to get any type of response from sim 300.
i would like to know how to get Data from modem and compare whether it is Error or Ok.

Many many thanks
 

hello!
i want to interface same sim300 modem to 8051..
have you got the solution to your problem??
let me know please.

thank you :)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top