Hello, I could successfully interfaced GSM modem to PC. now i want to interface the same modem to AT89C51. so can any one please suggest any site where i will get a sample of a program?? actually i referred some sites but i got all C programs and i want to do programming in assembly. because rest of my program is in assembly.so if available please suggest me some sites where i will find programs in "assembly language"
also, In many circuits i saw use of LCD to display responses from modem. but in my case i don't want to use LCD for this purpose. my doubt is In any case we have to input those responses from GSM modem to microcontroller,otherwise communication won't be possible right? please correct me if i am wrong.
thank you :)
If you have already managed to implement the rest of your program in assembler, you don't need to download any assembler code for your GSM modem - just write the code.
If all your other assembler code is also copied from somewhere, then you are in big troubles. Assembler modules don't magically fit together - you need to properly understand them to adjust them to fit.
No - there are no needs to have any display to make use of a GSM module. You might need a way to supply some parameters - like PAP, CHAP or APN, if you want to make use of GPRS for data transfers. And if you instead use the GSM modem as a standard modem using GSM data, you need to supply a phone number to call. But these parameters can be hard-coded into your source code if this is just a prototype. It is only for products shipped to others that there needs to be a way to configure the device depending on what subscription the user has.
I just wanted a sample code which would guide me.
Rest all code i have done myself...
oh okay.. thank you :)
Serial communication is serial communication.
The UART code don't care if there is a modem or something else connected on the outside.
You claim you have found C programs for modem communication - the modem don't care if the AT commands are sent using a C program or an assembler program. So what issues do you see with using the same AT commands these C program uses, but with your assembler code?
If your code is copied from somewhere, - you need to properly understand them or you will fail
Pers comment edited to be general.
My version: "If you can't code it yourself downloaded code is worthless"
Erik
Hello sir,
ORG 0000H MOV TMOD,#20H MOV TH1,#-3 MOV SCON,#50H SETB TR1 OK1: MOV DPTR,#0090H ACALL ACCESS MOV DPTR,#00A0H ACALL ACCESS MOV DPTR,#00b0H ACALL ACCESS MOV DPTR,#00C0H ACALL ACCESS MOV DPTR,#00d0H ACALL ACCESS ACCESS: CLR A MOVC A,@A+DPTR ACALL SEND INC DPTR CLR A MOVC A,@A+DPTR ACALL SEND RET SEND: MOV SBUF,A HERE: JNB T1,HERE CLR TI RET ORG 0090H MSG1: DB "AT" ORG 00A0H MSG2: DB "AT+CMGF=1" ORG 00b0H MSG3: DB "AT+CMGS=" ORG 00C0H MSG4: DB "34" // FOR " ORG 00d0H MSG5: DB "1234567891" // MOBILE NUMBER ORG 00E0H MSG6: DB "34" //FOR " ORG 00F0H MSG7: DB "HI" // MESSAGE TO BE SENT ORG 0100H MSG8: DB "26" // ctrl+z END
This is what i could do by referring a book. Please correct me wherever i am wrong.
how to put AT+CMGS="XXXX" ? this is actual AT command. "AT+CMGS="XXXX"" this will also give an error.. OR whatever i have done is correct or its wrong?
Also i am confused in lines of MSG4, MSG6, MSG8. here i have used 34,34,26 as ASCII codes of "," & CTRL+Z respectively.(www.bbdsoft.com/ascii.html referred for ASCII codes) we use DB "xx" to pass ASCII value of the parameter right? so whether whatever i have done is correct or its wrong? -- Best regards, Amit Kulkarni
"If you can't code it yourself downloaded code is worthless"
you REALLY need to study a) "the bible" www.8052.com/.../120112 b) Keil re memory 'sections' (which you will not understand unless you have understood "the bible" first)
I am not in the habit of helping people cheat om theit exam, thus the pointers above which should lead you to figure out the problem yourself.
If, however, the "institute of learning" you attend encourage cheating to improve the graduation rates, ask your teacher for a link.
Why you being so rude?? well, I am not cheating anyone here. I have prepared this code myself. I am not asking for any ready made program right? I complied this program in KEIL, and found no errors, but this doesn't mean that my program is logically correct too. That's why i asked here. I had referred some book in which one program was given which sends 2 strings serially. According to that program, i prepared this one.
so please. i am just asking for a help. Point to point discussion can solve my problem i think.
Why you being so rude??
If you consider it 'rude' to give you two references that will enable you to fix your problem, we disagree on the meaning of the word.
I have prepared this code myself. ... I had referred some book in which one program was given which sends 2 strings serially.
that is contradictory.
if you have copied code from a book, that is NOT the same as coding it yourself.
as said many times "if you can not code it yourslf copying code is worthless"
again, if you study the two references I gave you you will find the basic mistake.
You can't just send strings to the modem.
Haven't you noticed that the modem also sends data back?
You should synchronize your transmission of strings with the responses from the modem. Both to make sure that the modem keeps up with your transmissions. And to make sure that the modem doesn't give you an error message.
Play with a modem using the Hyperterminal application in windows, doing different things. Notice that in some situations, the modem can also send unsolicited strings. You might get a "RING" string from the modem if it detects a ring signal.
All modem communication should be implemented using some form of state machine.
that's where i was confused. because its a two way communication. so what one need to do for synchronization?
yes i have tried all commands in hyperterminal before :) and had noticed that 'RING' too.
okay i am sorry. i took it in a wrong way.. Thank you for those 2 references. i did not understand by 'Keil re memory 'sections''. can you please explain little more?
i had just referred that book. i understood that code and then i prepared my own code and posted here.
i did not understand by 'Keil re memory 'sections'' DATA, IDATA, XDATA, BDATA, PDATA
As Per said, you need to pay attention to the Responses from the modem.
This has nothing to do with Keil or the 8051 or even 'C'...
Nor even anything specifically to do with GSM - the same would apply to any type of modem (or modem-like device) which uses AT Commands.
Or, in fact, to anything which uses a command-response "protocol"...
yeah yeah.. But now my point is that, i don't need those commands (I am not using any LCD to display Commands & responses), but they are required to be taken into consideration as a necessity of the communication so what should be done? How to implement it in code?