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

GSM interface with 8051 microcontroller

hi guys
we are doing a project, in which a small part include interfacing 8051 microcontroller with GSM modem, we are trying to do this "Keil Assembly C". but till now are not able to anything on this.

Can anybody help us regarding, how to send AT commands using assembly c, specially how to send a sms and sending back the reply to an sms.

plz contect swi_nitj@yahoo.com

  • I don't really know what you mean by "assembly C", but look at all available example code. Assembler is one thing - writing mnemonics of the actual processor instructions. C on the other hand is a low to medium-level programming language.

    First you need to fix support for a serial-port. There is a lot of sample programs available. Both with the evaluation kit you can download from Keil, and if you just google.

    When that is done, you send the AT commands - and receive the answers - in exactly the same way as if the program was running on a PC.

    If you are going to use a GSM module, there is normally development kits to buy. They have USB or RS232 ports for connecting to a PC. Then you can use a normal terminal program to try the AT commands.

  • by assembly C, i mearly mean that embedded system programming in C. like we can write "printf" instrunction for sending data to serial com port instead of writing "mov sbuf,---"(8051 instruction set).

    the problem is we can send data to com port by dirctly using "printf", but instead of sending simply data, now we need to issue AT command for sending SMS and receiveing SMS.

    i thing now you must have got a more clear idea. rest we are almost doing the same things you mentioned. our main problem is the programming part.

  • But the AT commands are not really any more advanced than normal printf() output. If is first when you start with ppp to establish IP communication that the controller-side software will explode in size/complexity.

    The only potential obstacle may be to handle unsolicited messages from the modem. They may require some synchronization relative to your use of the AT commands.

    There are a large number of applications around the world that is communicating with modems using normal serial ports, or just having stdin/stdout redirected to a modem. Google for code. Read the code. Understand what they are doing. Apply to your own hardware.

    The only really machine-specific part is the serial read/write code, and the processing of potentially specific AT commands your _your_ modem.

    There is no requirement to use a multithreaded application to handle the AT commands. It is just a question of issuing the commands and synchronize the queries with regularly checks of received data from the same serial port.

    And as I already said - if you have an evaluation kit, you can normally connect the GSM phone/module directly to a PC and use whatever terminal program you have available to check out the specific AT commands. If you do not have an evaluation kit, I would recommend that you build the required glue hardware to allow you to connect the modem to a RS232 port on the PC. Note the requirements for supply voltages, signal levels on the I/O signals etc.

    Contact the supplier for the AT command reference for the modem. If that isn't available from the supplier, consider using another phone/modem, or google for other users who have been programmed the specific unit, and check if they have either documentation or source code.

    If no AT command reference can be found - check for command references for similar products from the same manufacturer, and check with a PC of those commands do work with your modem. If not, definitely switch to another phone/module!

  • Just type "GSM" into the search box; it's all been covered here before - and very recently!