Gsm Interfacing

26
GSM system overview The GSM system was designed as a second generation (2G) cellular phone technology. One of the basic aims was to provide a system that would enable greater capacity to be achieved than the previous first generation analogue systems. GSM achieved this by using a digital TDMA (time division multiple access approach). By adopting this technique more users could be accommodated within the available bandwidth. In addition to this, ciphering of the digitally encoded speech was adopted to retain privacy. Using the earlier analogue cellular technologies it was possible for anyone with a scanner receiver to listen to calls and a number of famous personalities had been "eavesdropped" with embarrassing consequences. GSM services Speech or voice calls are obviously the primary function for the GSM cellular system. To achieve this the speech is digitally encoded and later decoded using a vocoder. A variety of vocoders are available for use, being aimed at different scenarios. In addition to the voice services, GSM cellular technology supports a variety of other data services. Although their performance is nowhere near the level of those provided by 3G, they are nevertheless still important and useful. A variety of data services are supported with user data rates up to 9.6 kbps. Services including Group 3 facsimile, videotext and teletex can be supported. One service that has grown enormously is the short message service. Developed as part of the GSM specification, it has also been incorporated into other cellular technologies. It can be thought of as being similar to the paging service but is far more comprehensive allowing bi-directional messaging, store and forward delivery, and it also allows alphanumeric messages of a reasonable length. This service has become particularly popular, initially with the young as it provided a simple, low fixed cost.

description

GSM

Transcript of Gsm Interfacing

Page 1: Gsm Interfacing

GSM system overview

The GSM system was designed as a second generation (2G) cellular phone technology. One of the basic aims was to provide a system that would enable greater capacity to be achieved than the previous first generation analogue systems. GSM achieved this by using a digital TDMA (time division multiple access approach). By adopting this technique more users could be accommodated within the available bandwidth. In addition to this, ciphering of the digitally encoded speech was adopted to retain privacy. Using the earlier analogue cellular technologies it was possible for anyone with a scanner receiver to listen to calls and a number of famous personalities had been "eavesdropped" with embarrassing consequences.

GSM services

Speech or voice calls are obviously the primary function for the GSM cellular system. To achieve this the speech is digitally encoded and later decoded using a vocoder. A variety of vocoders are available for use, being aimed at different scenarios.

In addition to the voice services, GSM cellular technology supports a variety of other data services. Although their performance is nowhere near the level of those provided by 3G, they are nevertheless still important and useful. A variety of data services are supported with user data rates up to 9.6 kbps. Services including Group 3 facsimile, videotext and teletex can be supported.

One service that has grown enormously is the short message service. Developed as part of the GSM specification, it has also been incorporated into other cellular technologies. It can be thought of as being similar to the paging service but is far more comprehensive allowing bi-directional messaging, store and forward delivery, and it also allows alphanumeric messages of a reasonable length. This service has become particularly popular, initially with the young as it provided a simple, low fixed cost.

GSM basics

The GSM cellular technology had a number of design aims when the development started:

It should offer good subjective speech quality It should have a low phone or terminal cost Terminals should be able to be handheld The system should support international roaming It should offer good spectral efficiency The system should offer ISDN compatibility

The resulting GSM cellular technology that was developed provided for all of these. The overall system definition for GSM describes not only the air interface but also the network or infrastructure technology. By adopting this approach it is possible to define the operation of the whole network to enable international roaming as well as enabling network elements from

Page 2: Gsm Interfacing

different manufacturers to operate alongside each other, although this last feature is not completely true, especially with older items.

GSM cellular technology uses 200 kHz RF channels. These are time division multiplexed to enable up to eight users to access each carrier. In this way it is a TDMA / FDMA system.

The base transceiver stations (BTS) are organised into small groups, controlled by a base station controller (BSC) which is typically co-located with one of the BTSs. The BSC with its associated BTSs is termed the base station subsystem (BSS).

Further into the core network is the main switching area. This is known as the mobile switching centre (MSC). Associated with it is the location registers, namely the home location register (HLR) and the visitor location register (VLR) which track the location of mobiles and enable calls to be routed to them. Additionally there is the Authentication Centre (AuC), and the Equipment Identify Register (EIR) that are used in authenticating the mobile before it is allowed onto the network and for billing. The operation of these are explained in the following pages.

Last but not least is the mobile itself. Often termed the ME or mobile equipment, this is the item that the end user sees. One important feature that was first implemented on GSM was the use of a Subscriber Identity Module. This card carried with it the users identity and other information to allow the user to upgrade a phone very easily, while retaining the same identity on the network. It was also used to store other information such as "phone book" and other items. This item alone has allowed people to change phones very easily, and this has fuelled the phone manufacturing industry and enabled new phones with additional features to be launched. This has allowed mobile operators to increase their average revenue per user (ARPU) by ensuring that users are able to access any new features that may be launched on the network requiring more sophisticated phones.

GSM system overview

The table below summarises the main points of the GSM system specification, showing some of the highlight features of technical interest.

Specification Summary for GSM Cellular SystemMultiple access technology

FDMA / TDMA

Duplex technique FDD

Uplink frequency band890 - 915 MHz(basic 900 MHz band only)

Downlink frequency band933 -960 MHz (basic 900 MHz band only)

Channel spacing 200 kHzModulation GMSK

Speech codingVarious - original was RPE-LTP/13

Speech channels per RF 8

Page 3: Gsm Interfacing

channelChannel data rate 270.833 kbpsFrame duration 4.615 ms

Today the GSM cell or mobile phone system is the most popular in the world. GSM handsets are widely available at good prices and the networks are robust and reliable. The GSM system is also feature-rich with applications such as SMS text messaging, international roaming, SIM cards and the like. It is also being enhanced with technologies including GPRS and EDGE. To achieve this level of success has taken many years and is the result of both technical development and international cooperation. The GSM history can be seen to be a story of cooperation across Europe, and one that nobody thought would lead to the success that GSM is today.

The first cell phone systems that were developed were analogue systems. Typically they used frequency-modulated carriers for the voice channels and data was carried on a separate shared control channel. When compared to the systems employed today these systems were comparatively straightforward and as a result a vast number of systems appeared. Two of the major systems that were in existence were the AMPS (Advanced Mobile Phone System) that was used in the USA and many other countries and TACS (Total Access Communications System) that was used in the UK as well as many other countries around the world.

Another system that was employed, and was in fact the first system to be commercially deployed was the Nordic Mobile Telephone system (NMT). This was developed by a consortium of companies in Scandinavia and proved that international cooperation was possible.

The success of these systems proved to be their downfall. The use of all the systems installed around the globe increased dramatically and the effects of the limited frequency allocations were soon noticed. To overcome these a number of actions were taken. A system known as E-TACS or Extended-TACS was introduced giving the TACS system further channels. In the USA another system known as Narrowband AMPS (NAMPS) was developed.

New approaches

Neither of these approaches proved to be the long-term solution as cellular technology needed to be more efficient. With the experience gained from the NMT system, showing that it was possible to develop a system across national boundaries, and with the political situation in Europe lending itself to international cooperation it was decided to develop a new Pan-European System. Furthermore it was realized that economies of scale would bring significant benefits. This was the beginnings of the GSM system.

To achieve the basic definition of a new system a meeting was held in 1982 under the auspices of the Conference of European Posts and Telegraphs (CEPT). They formed a study group called the Groupe Special Mobile ( GSM ) to study and develop a pan-European public land mobile system. Several basic criteria that the new cellular technology would have to meet were set down for the new GSM system to meet. These included: good subjective

Page 4: Gsm Interfacing

speech quality, low terminal and service cost, support for international roaming, ability to support handheld terminals, support for range of new services and facilities, spectral efficiency, and finally ISDN compatibility.

With the levels of under-capacity being projected for the analogue systems, this gave a real sense of urgency to the GSM development. Although decisions about the exact nature of the cellular technology were not taken at an early stage, all parties involved had been working toward a digital system. This decision was finally made in February 1987. This gave a variety of advantages. Greater levels of spectral efficiency could be gained, and in addition to this the use of digital circuitry would allow for higher levels of integration in the circuitry. This in turn would result in cheaper handsets with more features. Nevertheless significant hurdles still needed to be overcome. For example, many of the methods for encoding the speech within a sufficiently narrow bandwidth needed to be developed, and this posed a significant risk to the project. Nevertheless the GSM system had been started.

GSM launch dates

Work continued and a launch date for the new GSM system of 1991 was set for an initial launch of a service using the new cellular technology with limited coverage and capability to be followed by a complete roll out of the service in major European cities by 1993 and linking of the areas by 1995.

Meanwhile technical development was taking place. Initial trials had shown that time division multiple access techniques offered the best performance with the technology that would be available. This approach had the support of the major manufacturing companies which would ensure that with them on board sufficient equipment both in terms of handsets, base stations and the network infrastructure for GSM would be available.

Further impetus was given to the GSM project when in 1989 the responsibility was passed to the newly formed European Telecommunications Standards Institute (ETSI). Under the auspices of ETSI the specification took place. It provided functional and interface descriptions for each of the functional entities defined in the system. The aim was to provide sufficient guidance for manufacturers that equipment from different manufacturers would be interoperable, while not stopping innovation. The result of the specification work was a set of documents extending to more than 6000 pages. Nevertheless the resultant phone system provided a robust, feature-rich system. The first roaming agreement was signed between Telecom Finland and Vodafone in the UK. Thus the vision of a pan-European network was fast becoming a reality. However this took place before any networks went live.

The aim to launch GSM by 1991 proved to be a target that was too tough to meet. Terminals started to become available in mid 1992 and the real launch took place in the latter part of that year. With such a new service many were sceptical as the analogue systems were still in widespread use. Nevertheless by the end of 1993 GSM had attracted over a million subscribers and there were 25 roaming agreements in place. The growth continued and the next million subscribers were soon attracted.

Page 5: Gsm Interfacing

Global GSM usage

Originally GSM had been planned as a European system. However the first indication that the success of GSM was spreading further a field occurred when the Australian network provider, Telstra signed the GSM Memorandum of Understanding.

Frequencies

Originally it had been intended that GSM would operate on frequencies in the 900 MHz cellular band. In September 1993, the British operator Mercury One-to-One launched a network. Termed DCS 1800 it operated at frequencies in a new 1800 MHz band. By adopting new frequencies new operators and further competition was introduced into the market apart from allowing additional spectrum to be used and further increasing the overall capacity. This trend was followed in many countries, and soon the term DCS 1800 was dropped in favour of calling it GSM as it was purely the same cellular technology but operating on a different frequency band. In view of the higher frequency used the distances the signals travelled was slightly shorter but this was compensated for by additional base stations.

In the USA as well a portion of spectrum at 1900 MHz was allocated for cellular usage in 1994. The licensing body, the FCC, did not legislate which technology should be used, and accordingly this enabled GSM to gain a foothold in the US market. This system was known as PCS 1900 (Personal Communication System).

GSM success

With GSM being used in many countries outside Europe this reflected the true nature of the name which had been changed from Groupe Special Mobile to Global System for Mobile communications. The number of subscribers grew rapidly and by the beginning of 2004 the total number of GSM subscribers reached 1 billion. Attaining this figure was celebrated at the Cannes 3GSM conference held that year. Figures continued to rise, reaching and then well exceeding the 3 billion mark. In this way the history of GSM has shown it to be a great success.

The GSM technical specifications define the different elements within the GSM network architecture. It defines the different elements and the ways in which they interact to enable the overall network operation to be maintained.

The GSM network architecture is now well established and with the other later cellular systems now established and other new ones being deployed, the basic GSM network architecture has been updated to interface to the network elements required by these systems. Despite the developments of the newer systems, the basic GSM network architecture has been maintained, and the elements described below perform the same functions as they did when the original GSM system was launched in the early 1990s.

GSM network architecture elements

Page 6: Gsm Interfacing

The GSM network architecture as defined in the GSM specifications can be grouped into four main areas:

Mobile station (MS) Base-station subsystem (BSS) Network and Switching Subsystem (NSS) Operation and Support Subsystem (OSS)

Simplified GSM Network Architecture

Mobile station

Mobile stations (MS), mobile equipment (ME) or as they are most widely known, cell or mobile phones are the section of a GSM cellular network that the user sees and operates. In recent years their size has fallen dramatically while the level of functionality has greatly increased. A further advantage is that the time between charges has significantly increased.

There are a number of elements to the cell phone, although the two main elements are the main hardware and the SIM.

The hardware itself contains the main elements of the mobile phone including the display, case, battery, and the electronics used to generate the signal, and process the data receiver and to be transmitted. It also contains a number known as the International Mobile Equipment Identity (IMEI). This is installed in the phone at manufacture and "cannot" be changed. It is accessed by the network during registration to check whether the equipment has been reported as stolen.

Page 7: Gsm Interfacing

The SIM or Subscriber Identity Module contains the information that provides the identity of the user to the network. It contains are variety of information including a number known as the International Mobile Subscriber Identity (IMSI).

Base Station Subsystem (BSS)

The Base Station Subsystem (BSS) section of the GSM network architecture that is fundamentally associated with communicating with the mobiles on the network. It consists of two elements:

Base Transceiver Station (BTS): The BTS used in a GSM network comprises the radio transmitter receivers, and their associated antennas that transmit and receive to directly communicate with the mobiles. The BTS is the defining element for each cell. The BTS communicates with the mobiles and the interface between the two is known as the Um interface with its associated protocols.

Base Station Controller (BSC): The BSC forms the next stage back into the GSM network. It controls a group of BTSs, and is often co-located with one of the BTSs in its group. It manages the radio resources and controls items such as handover within the group of BTSs, allocates channels and the like. It communicates with the BTSs over what is termed the Abis interface.

Network Switching Subsystem (NSS)

The GSM network subsystem contains a variety of different elements, and is often termed the core network. It provides the main control and interfacing for the whole mobile network. The major elements within the core network include:

Mobile Switching services Centre (MSC): The main element within the core network area of the overall GSM network architecture is the Mobile switching Services Centre (MSC). The MSC acts like a normal switching node within a PSTN or ISDN, but also provides additional functionality to enable the requirements of a mobile user to be supported. These include registration, authentication, call location, inter-MSC handovers and call routing to a mobile subscriber. It also provides an interface to the PSTN so that calls can be routed from the mobile network to a phone connected to a landline. Interfaces to other MSCs are provided to enable calls to be made to mobiles on different networks.

Home Location Register (HLR): This database contains all the administrative information about each subscriber along with their last known location. In this way, the GSM network is able to route calls to the relevant base station for the MS. When a user switches on their phone, the phone registers with the network and from this it is possible to determine which BTS it communicates with so that incoming calls can be routed appropriately. Even when the phone is not active (but switched on) it re-registers periodically to ensure that the network (HLR) is aware of its latest position. There is one HLR per network, although it may be distributed across various sub-centres to for operational reasons.

Page 8: Gsm Interfacing

Visitor Location Register (VLR): This contains selected information from the HLR that enables the selected services for the individual subscriber to be provided. The VLR can be implemented as a separate entity, but it is commonly realised as an integral part of the MSC, rather than a separate entity. In this way access is made faster and more convenient.

Equipment Identity Register (EIR): The EIR is the entity that decides whether a given mobile equipment may be allowed onto the network. Each mobile equipment has a number known as the International Mobile Equipment Identity. This number, as mentioned above, is installed in the equipment and is checked by the network during registration. Dependent upon the information held in the EIR, the mobile may be allocated one of three states - allowed onto the network, barred access, or monitored in case its problems.

Authentication Centre (AuC): The AuC is a protected database that contains the secret key also contained in the user's SIM card. It is used for authentication and for ciphering on the radio channel.

Gateway Mobile Switching Centre (GMSC): The GMSC is the point to which a ME terminating call is initially routed, without any knowledge of the MS's location. The GMSC is thus in charge of obtaining the MSRN (Mobile Station Roaming Number) from the HLR based on the MSISDN (Mobile Station ISDN number, the "directory number" of a MS) and routing the call to the correct visited MSC. The "MSC" part of the term GMSC is misleading, since the gateway operation does not require any linking to an MSC.

SMS Gateway (SMS-G): The SMS-G or SMS gateway is the term that is used to collectively describe the two Short Message Services Gateways defined in the GSM standards. The two gateways handle messages directed in different directions. The SMS-GMSC (Short Message Service Gateway Mobile Switching Centre) is for short messages being sent to an ME. The SMS-IWMSC (Short Message Service Inter-Working Mobile Switching Centre) is used for short messages originated with a mobile on that network. The SMS-GMSC role is similar to that of the GMSC, whereas the SMS-IWMSC provides a fixed access point to the Short Message Service Centre.

Operation and Support Subsystem (OSS)

The OSS or operation support subsystem is an element within the overall GSM network architecture that is connected to components of the NSS and the BSC. It is used to control and monitor the overall GSM network and it is also used to control the traffic load of the BSS. It must be noted that as the number of BS increases with the scaling of the subscriber population some of the maintenance tasks are transferred to the BTS, allowing savings in the cost of ownership of the system.

The network structure is defined within the GSM standards. Additionally each interface between the different elements of the GSM network is also defined. This facilitates the information interchanges can take place. It also enables to a large degree that network elements from different manufacturers can be used. However as many of these interfaces were not fully defined until after many networks had been deployed, the level of standardisation may not be quite as high as many people might like.

Page 9: Gsm Interfacing

1. Um interface The "air" or radio interface standard that is used for exchanges between a mobile (ME) and a base station (BTS / BSC). For signalling, a modified version of the ISDN LAPD, known as LAPDm is used.

2. Abis interface This is a BSS internal interface linking the BSC and a BTS, and it has not been totally standardised. The Abis interface allows control of the radio equipment and radio frequency allocation in the BTS.

3. A interface The A interface is used to provide communication between the BSS and the MSC. The interface carries information to enable the channels, timeslots and the like to be allocated to the mobile equipments being serviced by the BSSs. The messaging required within the network to enable handover etc to be undertaken is carried over the interface.

4. B interface The B interface exists between the MSC and the VLR . It uses a protocol known as the MAP/B protocol. As most VLRs are collocated with an MSC, this makes the interface purely an "internal" interface. The interface is used whenever the MSC needs access to data regarding a MS located in its area.

5. C interface The C interface is located between the HLR and a GMSC or a SMS-G. When a call originates from outside the network, i.e. from the PSTN or another mobile network it ahs to pass through the gateway so that routing information required to complete the call may be gained. The protocol used for communication is MAP/C, the letter "C" indicating that the protocol is used for the "C" interface. In addition to this, the MSC may optionally forward billing information to the HLR after the call is completed and cleared down.

6. D interface The D interface is situated between the VLR and HLR. It uses the MAP/D protocol to exchange the data related to the location of the ME and to the management of the subscriber.

7. E interface The E interface provides communication between two MSCs. The E interface exchanges data related to handover between the anchor and relay MSCs using the MAP/E protocol.

8. F interface The F interface is used between an MSC and EIR. It uses the MAP/F protocol. The communications along this interface are used to confirm the status of the IMEI of the ME gaining access to the network.

9. G interface The G interface interconnects two VLRs of different MSCs and uses the MAP/G protocol to transfer subscriber information, during e.g. a location update procedure.

10. H interface The H interface exists between the MSC the SMS-G. It transfers short messages and uses the MAP/H protocol.

11. I interface The I interface can be found between the MSC and the ME. Messages exchanged over the I interface are relayed transparently through the BSS.

Although the interfaces for the GSM cellular system may not be as rigorouly defined as many might like, they do at least provide a large element of the definition required, enabling the functionality of GSM network entities to be defined sufficiently.

AT COMMANDS

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

Page 10: Gsm Interfacing

and wireless MODEMs (devices that involve machine to machine communication) need AT

commands to interact with a computer. These include the Hayes command set as a subset,

along with other extended AT commands.

AT commands with a GSM/GPRS MODEM or mobile phone can be used to access following

information and services:

1. Information and configuration pertaining to mobile device or MODEM and SIM card.

2. SMS services.

3. MMS services.

4. Fax services.

5. Data and Voice link over mobile network.

The Hayes subset commands are called the basic commands and the commands specific to a

GSM network are called extended AT commands.

Types of AT Commands:

There are four types of AT commands:

1) Test commands - used to check whether a command is supported or not by the MODEM.

Page 11: Gsm Interfacing

SYNTAX: AT<command name>=?

For example: ATD=?

2) Read command - used to get mobile phone or MODEM settings for an operation.

SYNTAX: AT<command name>?

For example: AT+CBC?

3) Set commands - used to modify mobile phone or MODEM settings for an operation.

SYNTAX: AT<command name>=value1, value2, …, valueN

Some values in set commands can be optional.

For example: AT+CSCA=”+9876543210”, 120

4) Execution commands - used to carry out an operation.

SYNTAX: AT<command name>=parameter1, parameter2, …, parameterN

The read commands are not available to get value of last parameter assigned in execution

commands because parameters of execution commands are not stored.

For example: AT+CMSS=1,”+ 9876543210”, 120

Explanation of commonly used AT commands:

1) AT - This command is used to check communication between the module and the

computer.

For example,AT OKThe command returns a result code OK if the computer (serial port) and module are

connected properly. If any of module or SIM is not working, it would return a result code

ERROR.

Page 12: Gsm Interfacing

2) +CMGF - This command is used to set the SMS mode. Either text or PDU mode can be selected

by assigning 1 or 0 in the command.

SYNTAX: AT+CMGF=<mode>0: for PDU mode

1: for text modeThe text mode of SMS is easier to operate but it allows limited features of SMS. The PDU

(protocol data unit) allows more access to SMS services but the operator requires bit level

knowledge of TPDUs. The headers and body of SMS are accessed in hex format in PDU

mode so it allows availing more features.

For example, AT+CMGF=1OK

3) +CMGW - This command is used to store message in the SIM.

SYNTAX: AT+CMGW=” Phone number”> Message to be stored Ctrl+z

As one types AT+CMGW and phone number, ‘>’ sign appears on next line where one can

type the message. Multiple line messages can be typed in this case. This is why the message

is terminated by providing a ‘Ctrl+z’ combination. As Ctrl+z is pressed, the following

information response is displayed on the screen.

+CMGW: Number on which message has been stored

4) +CMGS - This command is used to send a SMS message to a phone number.

SYNTAX: AT+CMGS= serial number of message to be send.

As the command AT+CMGS and serial number of message are entered, SMS is sent to the

particular SIM.

For example,AT+CMGS=1

OK5) ATD - This command is used to dial or call a number.

Page 13: Gsm Interfacing

SYNTAX: ATD<Phone number>(Enter)For example,ATD123456789

6) ATA - This command is used to answer a call. An incoming call is indicated by a message

‘RING’ which is repeated for every ring of the call. When the call ends ‘NO CARRIER’ is

displayed on the screen.

SYNTAX: ATA(Enter)

As ATA followed by enter key is pressed, incoming call is answered.

For example,RINGRINGATA

7) ATH - This command is used to disconnect remote user link with the GSM module.

SYNTAX: ATH (Enter)

List of AT commands:

The AT commands for both, GSM module and the mobile phone, are listed below. Some of

these commands may not be supported by all the GSM modules available. Also there might

be some commands which won’t be supported by some mobile handsets.

Testing :

Command DescriptionAT Checking communication between the

module and computer.Call control :

Command DescriptionATA Answer commandATD Dial commandATH Hang up callATL Monitor speaker loudnessATM Monitor speaker modeATO Go on-lineATP Set pulse dial as defaultATT Set tone dial as defaultAT+CSTA Select type of addressAT+CRC Cellular result codes

Data card Control :

Page 14: Gsm Interfacing

Command DescriptionATI IdentificationATS Select an S-registerATZ Recall stored profileAT&F Restore factory settingsAT&V View active configurationAT&W Store parameters in given profileAT&Y Select Set as power up optionAT+CLCK Facility lock commandAT+COLP Connected line identification presentationAT+GCAP Request complete capabilities listAT+GMI Request manufacturer identificationAT+GMM Request model identificationAT+GMR Request revision identificationAT+GSN Request product serial number identification

(IMEI)Phone control :

Command DescriptionAT+CBC Battery chargeAT+CGMI Request manufacturer identificationAT+CGMM Request model identificationAT+CGMR Request revision identificationAT+CGSN Request product serial number identificationAT+CMEE Report mobile equipment errorAT+CPAS Phone activity statusAT+CPBF Find phone book entriesAT+CPBR Read phone book entryAT+CPBS Select phone book memory storageAT+CPBW Write phone book entryAT+CSCS Select TE character setAT+CSQ Signal quality

Computer data interface :

Command DescriptionATE Command EchoATQ Result code suppressionATV Define response formatATX Response range selectionAT&C Define DCD usageAT&D Define DTR usageAT&K Select flow controlAT&Q Define communications mode optionAT&S Define DSR optionAT+ICF DTE-DCE character framingAT+IFC DTE-DCE Local flow controlAT+IPR Fixed DTE rate

Page 15: Gsm Interfacing

Service :

Command DescriptionAT+CLIP Calling line identification presentationAT+CR Service reporting controlAT+DR Data compression reportingAT+ILRR DTE-DCE local rate reporting

Network Communication parameter :

Command DescriptionATB Communications standard optionAT+CBST Select bearer service typeAT+CEER Extended error reportAT+CRLP Radio link protocolAT+DS Data compression

Miscellaneous :

Command DescriptionA/ Re-execute command lineAT? Command helpAT*C Start SMS interpreterAT*T Enter SMS block mode protocolAT*V Activate V.25bis modeAT*NOKIATEST Test commandAT+CESP Enter SMS block mode protocol

SMS Text mode :

Command DescriptionAT+CSMS Select message serviceAT+CPMS Preferred message storageAT+CMGF Message formatAT+CSCA Service centre addressAT+CSMP Set text mode parametersAT+CSDH Show text mode parametersAT+CSCB Select cell broadcast message typesAT+CSAS Save settingsAT+CRES Restore settingsAT+CNMI New message indications to TEAT+CMGL List messagesAT+CMGR Read messageAT+CMGS Send messageAT+CMSS Send message from storageAT+CMGW Write message to memoryAT+CMGD Delete message

SMS PDU mode :

Command DescriptionAT+CMGL List Messages

Page 16: Gsm Interfacing

AT+CMGR Read messageAT+CMGS Send messageAT+CMGW Write message to memory

BLOCK DIAGRAM:

Before going to the program please understand the GSM module, hope you know that it works with AT commandsTry these commands on GSM module by connecting to PC's hyperterminal

Examples>>

TO CHQ GAIN - AT+CSQ=?TO CHK NETWORK - AT+COPS=?

Examples for send and receive SMS

For sending SMS in text Mode:

AT+CMGF=1 press enterAT+CMGS=”mobile number” press enterOnce The AT commands is given’ >’ prompt will be displayed on the screen.Type the message to sent via SMS. After this, press ctrl+Z to send the SMS.If the SMS sending is successful, “ok” will be displayed along with the message number.

For reading SMS in the text mode:AT+CMGF=1 Press enterAT+CMGR= no.

Page 17: Gsm Interfacing

Number (no.) is the message index number stored in the sim card. For new SMS, URC will be receivedon the screen as +CMTI: SM ‘no’. Use this number in the AT+CMGR number to read the message.Voice callInitiating outgoing call:ATD+ mobile number; press enterFor disconnecting the active call:ATH press enterFor receiving incoming call:ATA press enter

The following are the AT Commands and sequence of events performed for sending text message to a mobile phone through GSM Modem interfaced with microcontroller :

1. First select the text mode for SMS by sending the following AT Command to GSM Modem :AT+CMGF = 1 . This command configures the GSM modem in text mode.

2. Send the following AT Command for sending SMS message in text mode along with mobile number to the GSM Modem : AT+CMGS =+911234567890 . This command sends the mobile number of the recipient mobile to the GSM modem.

3. Send the text message string ("hello!") to the GSM Modem This is a test message from UART"

4. Send ASCII code for CTRL+Z i.e., 0x1A to GSM Modem to transmit the message to mobile phone.After message string has been sent to the modem, send CTRL+Z to the micro-controller,which is equivalent to 0x1A (ASCII value) Every AT command is followed by i.e. carriage return and line feed

you are giving line feed first and carriage return after that."\r" stands for carriage return

The SMS message in text mode can contain only 140 characters at the most.It depends upon the amount of information collected from GPS Engine that you need at the base station for tracking vehicle or person.The most important string of GPS is "$GPRMC..." which contains the minimum information required in tracking a target additionally you may need the information regarding the number of satellites that are visible to the GPS receiver.So it depends upon how much information you need to pack in 140 characters of SMS in text mode.

Code for the interfacing the GSM modem with microcontroller 8051 for just testing of connection and serial communication is under:-

#include<at89x51.h> // include at89x51 . h#include<stdio.h>// include stdio . h

Page 18: Gsm Interfacing

#include<stdlib.h>// include stdlib . hvoid initialize_GSM_modem(void);void initialize_serialcommunication(void);unsigned char Command_CMGF[]="AT+CMGF=1\r"; // AT+CMGF for selecting Text Modeunsigned char CtrlZ=0x1A; // CTRL+Z for sedning SMS after the message has been enteredunsigned char Command_CMGS[]="AT+CMGS =+9233385xxxxx\r"; // recepient mobile numberunsigned char Command_AT[]="AT\r";unsigned char msg02[]="Hello!";void delay(void){unsigned int i;for(i=0;i<50;i++);}void delay2(void){unsigned int i;for(i=0;i<25000;i++);}void main (void) {initialize_GSM_modem();initialize_serialcommunication();while (1) {; }} void initialize_GSM_modem(void){delay2();puts(Command_AT);delay2();puts(Command_CMGF);delay2();puts(Command_CMGS);delay2();puts(msg02);delay2();while(!TI); TI = 0;SBUF = 0x1A;}void initialize_serialcommunication(void){TMOD = 0x20;SCON = 0x50; TH1 = 0xFD; TL1 = 0xFD; TR1 = 1; TI = 1;}

Page 19: Gsm Interfacing