GSM Module interfacing with LPC2148
Global System for Mobile Communication
- GSM (Global System for Mobile Communications) is the technology that underpins most of the world's mobile phone networks.
- GSM is an open, digital cellular technology used for transmitting mobile voice and data services.
- GSM operates in the 900MHz and 1.8GHz bands GSM supports data transfer speeds of up to 9.6 kbps, allowing the transmission of basic data services such as SMS.
- The SIM300 module is a Triband GSM/GPRS solution in a compact plug in module featuring an industry-standard interface
Features of GSM MODEM
- Single supply voltage 3.2v-4.5v
- Typical power consumption in SLEEP Mode: 2.5mA.
- SIM300 tri-band
- MT,MO,CB, text and PDU mode, SMS storage: SIM card
- Supported SIM Card :1.8V,3V
- GSM/GPRS module is used to establish communication between a computer and a GSM-GPRS system.
- Global System for Mobile communication (GSM) is an architecture used for mobile communication in most of the countries.
- Global Packet Radio Service (GPRS) is an extension of GSM that enables higher data transmission rate
GSM Mobile Vs GSM Module
- A GSM mobile is a complete system in itself with embedded processors that are dedicated to provide an interface between the user and the mobile network.
- The AT commands are served between the processors of the mobile termination and the terminal equipment.
- The mobile handset can also be equipped with a USB interface to connect with a computer, but it may or may not support AT commands from the computer or an external processor/controller.
- The GSM/GPRS module, on the other hand, always needs a computer or external processor/controller to receive AT commands from.
- GSM/GPRS module itself does not provide any interface between the user and the network, but the computer to which module is connected is the interface between user and network.
- An advantage that GSM/GPRS modules offer is that they support concatenated SMS which may not be supported in some GSM mobile handsets
- Applications of GSM/GPRS module The GSM/GPRS module demonstrates the use of AT commands. They can feature all the functionalities of a mobile phone through computer like making and receiving calls, SMS, MMS etc. These are mainly employed for computer based SMS and MMS services.
- AT commands are used to control MODEMs.AT is the abbreviation for Attention.
- These commands come from Hayes commands that were used by the Hayes smart modems.
- The Hayes commands started with AT to indicate the attention from the MODEM.
- The dial up and wireless MODEMs need AT commands to interact with a computer.
- AT commands with a GSM/GPRS MODEM
|GSM AT Commands and their functions|
|AT Command||Function of AT Command|
|AT+CGMS||Send SMS Message|
|AT+CMSS||Send SMS Message from storage|
|AT+CMGL||List SMS Messages|
|AT+CMGR||Read SMS Messages|
|AT+CSCA?||Service Centre Address|
|AT+CPMS||To choose storage from ME or SM|
|AT+IPR=0||To choose auto from baud rate|
|AT+CMGF=||To choose PDU Mode or Text Mode|
Interfacing of GSM Module
Pin assignment with LPC 2148
UART DB-9 Connector
LPC2148 Processor Lines
UART0 (P1) ISP PGM
Algorithm for GSM module interfacing with LPC2148
2) Initialise UART0 or UART1 serial interfface using following i nstruction
U0LCR=0X83; //8-BIT Character lenth,NO parity,1 stop bit
U0DLL=97; //Baud rate=9600@PCLK=15Mhz
3) Transmit different AT commands through UART module using instruction
4) If transmission buffer is Empty,Transmit AT commands
5) Provide delay while transmitting each command
6) To transmit a single character use PUTCH function & to transmit a string use PUTS function
Embedded C Code
/* Project Name:- GSM Module Interfacing with LPC2148 using UART module */
/* Device:- LPC2148 */
/* Compiler:- KeilUvision4 */
/* Language:- Embedded C */
/* Visit www.wikinote.org for more Details */
#include<lpc21xx.h> //Includes LPC2148 register definitions
unsigned char GsmSendMsg(unsigned char *msgStr);
void DelayMs(unsigned int count);
Uart0PutS("ATE0\r\n"); //Turn echo off
Uart0PutS("ATD9503XXXXXX;\r\n"); //replace xxxxxxxxxx with number to call
Uart0PutS("ATH0\r\n"); //disconnect call
unsigned char GsmSendMsg(unsigned char *msgStr)
Uart0PutS("AT+CMGF=1\r\n");//Send SMS: Select Text mode
Uart0PutS("AT+CMGS=\"9503XXXXXX\"\r\n"); //Send SMS to mobile number
Uart0PutCh(0x1A); //CNTL + Z
void DelayMs(unsigned int count)
volatile unsigned int j,k;
Note:- As I am sending these AT Commands using UART , So i need to add Program for Serial Communication Hence Add Serial.c and Serial.h file