You are on page 1of 60

Unique Embedded Technologies

#P.No:43,Bharat nagar Colony, Hyderabad-500018


Andhra Pradesh.

CONFIRMATION
This is to confirm that the Project titled “SMART SMS SERVICES”
under going by the below mentioned students of B.Tech in Electronics & communication
Engineering from BHIMAVARAM INSTITUTE OF ENGINEERING & TECHNOLOGY,
They are doing this project under the guidance of “UNIQUE EMBEDDED
TECHNOLOGIES”, Hyderabad.

Name Reg. No:


T.SARAN KUMAR 07AP1A0455
B.VENKATESH 07AP1A0406
K.RAMACHANDRA RAO 07AP1A0436
K.DEVI PRIYANKA 07AP1A0409

Project Guide Project-Trainer

HOD, ECE

BVRM Page 1
ACKNOWLEDGEMENT
We express our sincere thanks to Sri A.V.V.Satyanarayana Secretary and
correspondent of the college for making neccesary arrangements for mini project work at
Bhimavaram Institute of Engineering and Technology.
We wish to express our gratitude to Mr.J.Girish,principal of Bhimavaram Institute of
Engineering and Technology,Pennada,Bhimavaram for having given us permission to carry
out the miniproject. We express our sincere thanks to Mr.B.S.Rao,HOD of
ECE,Bhimavaram Institute of Engineering and Technology,for his encoragement and
valuable suggestions through out the miniproject.
We express our sincere thanks and deep sense of gratitude for the inspiring guidence and
kind encouragement with unfailing support rendered by P.Anusha,Asst Prof.Dept of
ECE,Bhimavaram Institute of engineering and Technology.
We are also thankful to the staff of our ECE Department for their valuable
support,comments during the course of the miniproject and to all others who have directly or
indirectly contribute to the success of the miniproject .We owe our sincere thanks to our
parents with out whose encouragement our achievement is not possible.
We owe our gratitude to our Bhimavaram Institute of Engineering and Technology
for providing an opportunity to do our project.

T.SARAN KUMAR(07AP1A0455)
B.VENKATESH(07AP1A0406)
K.RAMACHANDRA RAO(07AP1A0436)
K.DEVI PRIYANKA(07AP1A0409)

BVRM Page 2
CONTENTS

1) ABSTRACT

2) INTRODUCTION

2.1) HISTORY OF GSM

2.2) DIFFERENCE BETWEEN GSM AND CDMA

2.3) SMS (SHORT MESSAGE SERVICE)

3) INTRODUCTION TO MICRO CONTROLLER

3.1) BOCK DIAGRAM EXPLANATION

3. 2) MICRO CONTROLLER 8051

3.3) LCD (LIQUID CRYSTAL DISPLAY)

4) LCD INTERFACING

5) LIST OF PROGRAMS

6) CONCLUSION

7) BIBLOGRAPHY

BVRM Page 3
ABSTRACT
In doing our miniproject “SMART SMS SERVICES” used GSM technique. The
main parts of the miniproject are 8051 microcontroller,GSM module,Max-232,keyboard and
LCD display.The main objective of this miniproject is to perform operations like “Send
messages,Read messages and delete messages” in our message box.
The 8051 microcontroller is heart of the circuit. This miniproject works on the 8051
micro controller.The main function of the 8051 micro controller is it controls the over all
functions of the circuit.It is a 40 pin DIP package.It has 4 ports namely
port0,port1,port2,port3.
The other main module of the miniproject is GSM.GSM stands for Global System
for Mobile Communication.GSM module is a communication device.It requires 5V DC
power supply.Max-232 used for communicate our GSM module and 8051 controller.In this
project we are using EmbededC using Keil software.By using the Flash Magic software the
EmbededC programs are dumped into microcontroller 8051.
By using this miniproject we can perform operations like “Send messages,Read
messages and delete messages” in our message box.These are the features of our project.Our
future advancement is to attending calls and in security alerts.These are the future
advacements

BVRM Page 4
LIST OF FIGURES:

Figure 1: Block diagram & GSM antenna……………………………

Figure 2: Simple circuit for safe reset………………………………..

Figure 3: Harvar Architecture…………………………………………

Figure 4: 20*4 Liquid Crystal Display…………………………………

Figure 5: Scan code for individual keys……………………………….

Figure 6: Scan code for extended keyboard & numeric keypad………

Figure 7:GSM smart modem…………………………………………..

BVRM Page 5
INTRODUCTION

History of GSM

During the early 1980s, analog cellular telephone systems were

experiencing rapid growth in Europe, particularly in Scandinavia and the United

Kingdom, but also in France and Germany. Each country developed its own

system, which was incompatible with everyone else's in equipment and operation.

This was an undesirable situation, because not only was the mobile equipment

limited to operation within national boundaries, which in a unified Europe were

increasingly unimportant, but there was also a very limited market for each type of

equipment, so economies of scale and the subsequent savings could not be

realized.

The Europeans realized this early on, and in 1982 the Conference of

European Posts and Telegraphs (CEPT) formed a study group called the Groupe

Spécial Mobile (GSM) to study and develop a pan-European public land mobile

system.

The proposed system had to meet certain criteria:

 Good subjective speech quality

 Low terminal and service cost

BVRM Page 6
 Support for international roaming

 Ability to support handheld terminals

 Support for range of new services and facilities

 Spectral efficiency

 ISDN compatibility

In 1989, GSM responsibility was transferred to the European

Telecommunication Standards Institute (ETSI), and phase I of the GSM

specifications were published in 1990. Commercial service was started in mid-

1991, and by 1993 there were 36 GSM networks in 22 countries. Although

standardized in Europe, GSM is not only a European standard. Over 200 GSM

networks (including DCS1800 and PCS1900) are operational in 110 countries

around the world. In the beginning of 1994, there were 1.3 million subscribers

worldwide, which had grown to more than 55 million by October 1997.With North

America making a delayed entry into the GSM field with a derivative of GSM

called PCS1900, GSM systems exist on every continent, and the acronym GSM

now aptly stands for Global System for Mobile communications.

The developers of GSM chose an unproven (at the time) digital system, as

opposed to the then-standard analog cellular systems like AMPS in the United

States and TACS in the United Kingdom. They had faith that advancements in

compression algorithms and digital signal processors would allow the fulfillment

of the original criteria and the continual improvement of the system in terms of

quality and cost. The over 8000 pages of GSM recommendations try to allow

flexibility and competitive innovation among suppliers, but provide enough

standardization to guarantee proper interworking between the components of the

BVRM Page 7
system. This is done by providing functional and interface descriptions for each of

the functional entities defined in the system

 DIFFERENCES BETWEEN GSM AND CDMA

In cellular service there are two main competing network technologies:

Global System for Mobile Communications (GSM) and Code Division Multiple

Access (CDMA). Cellular carriers including Sprint PCS, Singular Wireless,

Version and T-Mobile use one or the other. Understanding the difference between

GSM and CDMA will allow you to choose a carrier that uses the preferable

network technology for your needs.

The GSM Association is an international organization founded in 1987,

dedicated to providing, developing, and overseeing the worldwide wireless

standard of GSM. CDMA, a proprietary standard designed by Qualcomm in the

United States, has been the dominant network standard for North America and

parts of Asia. However, GSM networks continue to make inroads in the United

States, as CDMA networks make progress in other parts of the world. There are

camps on both sides that firmly believe either GSM or CDMA architecture is

superior to the other. That said, to the non-invested consumer who simply wants

bottom line information to make a choice, the following considerations may be

helpful.

BVRM Page 8
Data Transfer Speed: With the advent of cellular phones doing double and triple

duty as streaming video devices, broadcast receivers and email devices, speed is

important to those who use the phone for more than making calls. CDMA has been

traditionally faster than GSM, though both technologies continue to rapidly

leapfrog along this path. Both boast "3G" standards, or 3rd generation technologies

Subscriber Identity Module (SIM) cards: In the United States only GSM phones

use SIM cards. The removable SIM card allows phones to be instantly activated,

interchanged, swapped out and upgraded, all without carrier intervention. The SIM

itself is tied to the network, rather than the actual phone. Phones that are card-

enabled can be used with any GSM carrier. The CDMA equivalent, a R-UIM card,

is only available in parts of Asia but remains on the horizon for the U.S. market.

CDMA carriers in the U.S. require proprietary handsets that are linked to one

carrier only and are not card-enabled To upgrade a CDMA phone, the carrier must

deactivate the old phone then activate the new one. The old phone becomes useless

Roaming: For the most part, both networks have fairly concentrated coverage in

major cities and along major highways. GSM carriers, however, have roaming

contracts with other GSM carriers, allowing wider coverage of more rural areas,

generally speaking, often without roaming charges to the customer. CDMA

networks may not cover rural areas as well as GSM carriers, and though they may

contract with GSM cells for roaming in more rural areas, the charge to the

customer will generally be significantly higher.

International Roaming: If you need to make calls to other countries, a GSM

carrier can offer international roaming, as GSM networks dominate the world

market. If you travel to other countries you can even use your GSM cell phone

BVRM Page 9
abroad, providing it is a quad-band phone (850/900/1800/1900 MHz). By

purchasing a SIM card with minutes and a local number in the country you are

visiting, you can make calls against the card to save yourself international roaming

charges from your carrier back home. CDMA phones that are not card-enabled do

not have this capability. According CDG.org, CDMA networks support over 270

million subscribers worldwide, while GSM.org tallies up their score at over 1

billion. As CDMA phones become R-UIM enabled and roaming contracts between

networks improve, integration of the standards might eventually make differences

all but transparent to the consumer.

The chief GSM carriers in the United States are Cingular Wireless, recently

merged with AT&T Wireless, and T-Mobile USA. Major CDMA carriers are

Sprint PCS, Version and Virgin Mobile. There are also several smaller cellular

companies on both networks.

 SMS (Short Message Service):

SMS is an acronym standing for Short Message Service. It is commonly

referred to as text messaging or “texting” as well. SMS is a method by which

messages can be sent to a cell phone via another cell phone, a computer connected

to the Internet, a regular land line, or a handheld device such as a Blackberry. The

original specifications for SMS were developed in 1985, though real

implementation and popularity took nearly a decade to achieve.

SMS messages may be sent either from one point to another point, or may be sent

to all devices within a specific geographical region. The former, known as SMS-

PP, is used primarily between individuals communicating with one another, while

BVRM Page 10
the latter, known as SMS-CB, may be used to broadcast public announcements

such as road or weather conditions, region-specific advertising messages, or

messages from a cell provider regarding the new coverage area.

SMS use for personal communication is rapidly increasing in popularity. In 2000,

less than 20 billion SMS messages were sent; by 2004 that number had grown to in

excess of 500 billion messages. The largest market for SMS is Southeast Asia,

with Europe just behind. The United States has seemed to be a slow adopter for the

early years of the 21st century, but the pace of texting appears to be increasing in

the United States as service providers make its use, particularly between networks,

easier.

With this surge in popularity and use, particularly among younger users, new

shorthands have developed to communicate more rapidly through the medium.

This shorthand mirrors in many way the writing style of online chat, dropping

vowels and superfluous letters, and replacing words and entire sounds with

representative numbers or single letters. An example might read something like,

“how r U?” to mean, “How are you?” or, “did u c wut he asd me 2 do? 4 shme!” to

mean, “Did you see what he asked me to do? For shame!” Given the limitations of a

smaller keypad, with multiple clicks required for many letters, such shorthand saves

large amounts of time over the course of multiple SMS messages.

In addition to person-to-person communication via SMS, a number of television

shows have begun accepting text messages for various purposes. Shows which

have a voting system, such as American Idol, have begun integrating SMS voting,

allowing viewers to easily make their choices using only their cell phone. In

BVRM Page 11
Europe, the idea has been pushed even further, with shows that allow viewers to

control characters on screen using their cell phone’s SMS capabilities.

Some online services, most notably Google, have integrated SMS capability to

allow for the easy retrieval of information through one’s cell phone. By texting a

special number, for example, a cell phone user may receive information ranging

from local weather, to sport scores, to where the nearest bus station is in their

town. In addition to such regional information, services like Google SMS can also

be used to quickly find the definition of a word, to convert one unit of measure to

another, or to answer trivia questions. Using SMS, one can in essence access the

vast informational resources of the Internet using only a cell phone.

INTRODUCTION TO MICRO CONTROLER

Micro controller is the heart of total system. The micro controller controls

all the devices connected in the diagram. Micro controller sends pulses

to all the devices, which are connected to it.We can program it in any language i.e.,

in assembly or C or C++, depending upon the user. In this flash memory is more

compatible with others. In our design, this controller is compatible and also

reliable one.

BVRM Page 12
Block diagram:

GSM
EEPROM Antenn
a

L293D
Atmel/Phillip
driver Micro Controller LCD
8051 display

GPS
receiver

GSM Network
Provider
BSNL/AirTel/Hutc
BVRM Page 13
h
GSM ANTENNA:

BLOCK DIAGRAM EXPLANATON:

The above figure shows the GSM SMART SMS MODULE block

diagram. It mainly consists

1. Micro controller

2. GSM Modem

3. LCD Module

4. PC Keyboard

5. POWER Supply Unit

Micro Controller 89C51:

AT89C51 Micro Controller contains 1.4 kilobytes of ROM . 2.128 bytes of

RAM (SFR registers included) can satisfy the basic needs, but is not really

astounding. 3.4 ports totaling 32 I/O lines are usually sufficient. Obviously, 8051

configuration is intended to satisfy the need of programmers developing the

controlling devices and instruments. This is one part of its key to success, meant

BVRM Page 14
for the average user also. The other clue can be found in the organization of RAM,

Central Processor Unit (CPU), and ports - all of which maximally utilize the

available resources and allow further upgrades. Pins On The Case: 1-8: Port 1;

Each of these pins can be used as either input or output according to your needs.

Also, pins 1 and 2 (P1.0 and P1.1) have special functions associated with Timer.

9: Reset Signal; high logical state on this input halts the MCU and clears all the

registers. Bringing this pin back to logical state zero starts the program new as if

the power had just been turned on. In another words, positive voltage impulse on

this pin resets the MCU. Depending on the device's purpose and environs, this pin

is usually connected to the push-button, reset-upon-start circuit or a brown out

reset circuit (covered in the previous chapter). The image shows one simple circuit

for safe reset upon starting the controller. It is utilized in situations when

smal voltage. 10-17: Port 3; as with Port 1, each of these pins can be used as

universal input or output. However, powerfailstoreachitsopti each pin of Port 3 has

BVRM Page 15
an alternative function: Pin 10: RXD - serial input for asynchronous

communication or serial input/output for synchronous communication. Pin 11:

TXD - serial output for asynchronous communication or clock output for

synchronous communication Pin 12: INT0 - input for interrupt 0 Pin 13: INT1 -

input for interrupt 1 Pin 14: T0 - clock input of counter 0 Pin 15: T1 - clock input

of counter 1 Pin 16: WR - signal for writing to external (add-on) RAM memory

Pin 17: RD - signal for reading from external RAM memory. 18-19: X2 and

X1; Input and output of internal oscillator. Quartz crystal controlling the frequency

commonly connects to these pins. Capacitances within the oscillator mechanism

(see the image) are not critical and are normally about 30pF. Instead of a quartz

crystal, miniature ceramic resonators can be used for dictating the pace. In that

case, manufacturers recommend using somewhat higher capacitances (about 47

puff). New Mucus works at frequencies from 0Hz to 50MHz+.

20: GND; Ground 21- 28: Port 2; if external memory is not present, pins of Port 2 act

as universal input/output. If external memory is present, this is the location of the

higher address byte, i.e. addresses A8 - A15. It is important to note that in cases when

not all the 8 bits are used for addressing the memory (i.e. memory is smaller than

64kB), the rest of the unused bits are not available as input/output. 29: PSEN; MCU

activates this bit (brings to low state) upon each reading of byte (instruction) from

program memory. If external ROM is used for storing the program, PSEN is directly

connected to its control pins. of the external memory, MCU sends the lower byte of

the address register (addresses A0 - A7) to port P0 and activates the output ALE.

External register (74HCT373 or 74HCT375 circuits are common), memorizes the state

of port P0 upon receiving a signal from ALE pin, and uses it as part of the address for

memory chip. During the second part of the mechanical MCU cycle, signal on ALE is

BVRM Page 16
off, and port P0 is used as Data Bus. In this way, by adding only one cheap integrated

circuit, data from port can be multiplexed and the port simultaneously used for

transferring both addresses and data. 31: EA; Bringing this pin to the logical state zero

(mass) designates the ports P2 and P3 for transferring addresses regardless of the

presence of the internal memory. This means that even if there is a program loaded in

the MCU it will not be executed, but the one from the external ROM will be used

instead. Conversely, bringing the pin to the high logical state causes the controller to

use both memories, first the internal, and then the external (if present). 32-39: Port 0;

Similar to Port 2, pins of Port 0 can be used as universal input/output, if external

memory is not used. If external memory is used, P0 behaves as address output (A0 -

A7) when ALE pin is at high logical level, or as data output (Data Bus) when ALE pin

is at low logical level. 40: VCC; Power +5V Input - Output (I/O) Ports Every MCU

from 8051 families has 4 I/O ports of 8 bits each. This provides the user with 32 I/O

lines for connecting MCU to the environs. Unlike the case with other controllers, there

is no specific SFR register for designating pins as input or output. Instead, the port

itself is in charge: 0=output, 1=input. If particular pin on the case is needed as output,

the appropriate bit of I/O port should be cleared. This will generate 0V on the

specified controller pin. Similarly, if particular pin on the case is needed as input, the

appropriate bit of I/O port should be set. This will designate the pin as input,

generating +5V as a side effect (as with every TTL input). Port 0: Port 0 has two-fold

role: if external memory is used, it contains the lower address byte (addresses A0-A7);

otherwise all bits of the port are either input or output. Another feature of this port

comes to play when it has been designated as output. Unlike other ports, Port 0 lacks

the "pull up" resistor (resistor with +5V on one end). This seemingly insignificant

change has the following consequences: When designated as input, pin of Port 0 acts

as high impedance offering the infinite input resistance with no "inner" voltage. When

BVRM Page 17
designated as output, pin acts as "open drain". Clearing a port bit grounds the

appropriate pin on the case (0V). Setting a port bit makes the pin act as high

impedance. Therefore, to get positive logic (5V) at output, external "pull up" resistor

needs to be added for connecting the pin to the positive pole. Therefore, to get one

(5V) on the output, external "pull up" resistor needs to be added for connecting the pin

to the positive pole. Port 1: This is "true" I/O port, dual function characteristic is

observed for Port1. Having the "pull up" resistor, Port 1 is fully compatible with TTL

circuits. Port 2: When using external memory, this port contains the higher address

byte (addresses A8-A15), similar to Port 0. Otherwise, it can be used as universal I/O

port. Port 3: Beside its role as universal I/O port, each pin of Port 3 has an alternate

function. In order to use one of these functions, the pin in question has to be

designated as input, i.e. the appropriate bit of register P3 needs to be set. From a

hardware standpoint, Port 3 is similar to Port 0. As can be seen from the individual

descriptions of the ports, they all share highly similar structure. However, you need to

consider which task should be assigned to which port. For example: if utilizing port as

output with high level (5V), avoid using Port 0, as its pins cannot produce high logical

level without an additional resistor connected to +5V. If using other port to a same

end, bear in mind that built-in resistors have relatively high values, producing the

currents limited to few hundreds of amperes as pin output.

Memory Under The Magnifier:

During the runtime, micro controller uses two different types of memory: one

for holding the program being executed (ROM memory), and the other for temporary

storage of data and auxiliary variables (RAM memory). Depending on the particular

model from 8051 family, this is usually few kilobytes of ROM and 128/256 bytes of

RAM. This amount is built-in and is sufficient for common tasks performed

BVRM Page 18
"independently" by the MCU. However, 8051 can address up to 64KB of external

memory. These can be separate memory blocks, (separate RAM chip and ROM chip)

totaling 128KB of memory on MCU, which is a real programming body. ROM

memory: First models from 8051 family lacked the internal program memory, but it

could be added externally in a form of a separate chip. This Mucus can be recognized

by their mark, which begins with 803 (e.g. 8031 or 8032). New models have built-in

ROM, although there are substantial variations. With some models internal memory

cannot be programmed directly by the user. Instead, the user needs to precede the

program to the manufacturer, so that the MCU can be programmed (masked)

appropriately in the process of fabrication. Obviously, this option is cost-effective only

for large series. Fortunately, there are MCU models ideal for experimentation and

small specialized series. Many manufacturers deliver controllers that can be

programmed directly by the user. These come in a ceramic case with an opening

(EPROM version) or in a plastic case without an opening (EEPROM version). This

book deals with one of the latter models that can be programmed via simple

programmer, even if the chip has already been mounted to the designated device.

RAM memory: As previously stated, RAM is used for storing temporary data and

auxiliary results generated during the runtime. Apart from that, RAM comprises a

number of registers: hardware counters and timers, I/O ports, buffer for serial

connection, etc. With older versions, RAM spanned 256 locations, while new

models feature additional 128 registers. First 256 memory locations form the basis

of RAM (addresses 0 - Fifth) of every 8051 MCU. Locations that are available to

the user span addresses from 0 to 7Fh, i.e. first 128 registers, and this part of RAM

is split into several blocks as can be seen in the below image. First block comprises

4 "banks" of 8 registers each, marked as R0 - R7. To address these, the parent bank

has to be selected. Second memory block (range 20h - 2Fh) is bit-addressable,

BVRM Page 19
meaning that every belonging bit has its own address (0 to 7Fh). Since the block

comprises 16 of these registers, there is a total of 128 addressable bits. (Bit 0 of byte

20h has bit address 0, while bit 7 of byte 2Fh has bit address 7Fh). Third is the group

of available registers at addresses 2Fh - 7Fh (total of 80 locations) without special

features or a preset purpose.

Extra Memory Block: To satisfy the programmers' ever-increasing demands for

RAM, latest 8051 models were added an extra memory block of 128 locations. But it

is not all that simple... The problem lies in the fact that the electronics, which

addresses RAM, employs 1 byte (8 bits), reaching only the first 256 locations.

Therefore, a little trick had to be applied in order to keep the existing 8-bit architecture

for the sake of compatibility with older models. The idea is to make the additional

memory block share the addresses with the existent locations intended for SFR

registers (80h - Fifth). For distinguishing these two physically separate memory areas,

Different methods of addressing are used: if SFR registers are in question, direct

addressing is used; for extra RAM locations, indirect addressing is used. Memory

Expanding: In case the built-in amount of memory (either RAM or ROM) is not

sufficient for your needs, there is always an option of adding two external 64KB

memory chips. When added, they are addressed and accessed via I/O ports P2 and P3.

From user's point of view it's all

very simple, because if properly connected most of the job is carried out

automatically by MCU. 8051 MCU has two separate read signals, RD# (P3.7) and

PSEN#. The first one is active when reading byte from the external data memory

(RAM), and the second one is active when reading byte from the external program

memory (ROM). Both signals are active on low logical level. The following image
BVRM Page 20
shows a typical scheme for such expansion using separate chips for RAM and

ROM, known as Harvar architecture.

Memory can be also mapped as a single block, functioning as both data memory and

program memory simultaneously. This approach is known as Von Neumann

architecture. To be able to read the same block using RD# or PSEN#, these two

signals were combined via logical AND. In this way, output of AND circuit is low if

any of the two inputs is low. Using the Harvard architecture effectively Doubles MCU

BVRM Page 21
memory, but that's not the only advantage offered by the method. Keeping the

program code separated from the data makes the controller more reliable since there is

no writing to the program memory. SFR Registers (Special Function Registers):

SFR registers can be seen as a sort of control panel for managing and monitoring the

micro controller. Every register and each of the belonging bits has its name, specified

address in RAM and strictly defined role. Although there are 128 available memory

slots for allocating SFR registers, the basic core shared by 8051 Mucus has 22

registers. The rest has been left open intentionally to allow future upgrades while

retaining the compatibility with earlier models. This fact makes possible to use

programs developed for obsolete models long ago.

Liquid Crystal Display [LCD]:

We examine an intelligent LCD display of two lines, 20 characters per line,

that is interfaced with the 8051.The protocol for the display is as shown.

The display contains two internal byte-wide registers, one for commands (RS=0)

and the second for characters to be displayed (RS=1). It also contains a user-

programmed RAM area (the character RAM) that can be programmed to generate any

desired character that can be formed using a dot matrix. To distinguish between these

two data areas, the hex command byte 80 will be used to signify that the display RAM

address 00h will be chosen Port1 is used to furnish the command or data type, and

ports 3.2 to3.4 furnish register select and read/write levels.

The display takes varying amounts of time to accomplish the functions as

listed. LCD bit 7 is monitored for logic high (busy) to ensure the display is

overwritten. A slightly more complicated LCD display (4 lines*40 characters) is

currently being used in medical diagnostic systems to run a very similar program.

BVRM Page 22
1 2 3 15 16
Liquid Crystal Display
Gn +5 Vd
A K
d v d

4 5 6 7 8 9 10 11 12 13 14

20x4 Liquid Crystal Display

D0
R/ 0D
RS En D1 D2
w 6 D3 D4 D5 D6 D7
0

LCD Commands Description


D1

RS R/W D7 D6 D5 D4 D3 D2 D1 D0 Function

0 0 0 0 0 0 0 0 0 1 Clear LCD and memory, home cursor


0 0 0 0 0 0 0 0 1 0 Clear and home cursor only
0 0 0 0 0 0 0 1 1/0 S Screen action as display character written
S=1/0:Shift screen/cursor
I/O=1/0:cursor R/L, screen L/R
0 0 0 0 0 0 1 D C B D=1/0:Screen on/off
C=1/0:Cursor on/off
B=1/0:Cursor blink/no blink
0 0 0 0 0 1 S/C R/L 0 0 S/C: 1/0:screen/Cursor
R/L: Shift one space R/L
0 0 0 0 1 DL N F 0 0 DL=1/0:8/4 Bits per Character
N=1/0; 2/1 Rows of Characters
F=1/0;5*10/5*7Dots/Character
0 0 0 1 Character address Write to character RAM address after this
0 0 1 Display data address Write to display RAM address after this

BVRM Page 23
0 1 BF Current address BF=1/0:busy/Notbusy
1 0 Character type Write byte to last RAM chosen
1 1 Character type Read byte from last RAM chosen

Serial communication:

In order to connect micro controller or a PC to GSM modem a serial port is

used. Serial, is a very common protocol for device communication that is standard on

almost every PC. Most computers include RS-232 based serial ports. Serial is also a

common communication protocol that is used by many devices for instrumentation. In

serial communication, the data is sent one bit at a time where as in parallel

communication; the data is sent a byte or more at time. Serial communication uses a

single data line where as the parallel communication uses 8 bit data line, this makes

serial communication not only inexpensive but also makes it possible for two

computers located in two different cities to communicate over the telephone.

Serial data communication uses two methods, asynchronous and synchronous.

The synchronous method transfers a block of data at a time while the asynchronous

transfers a single byte at a time. The 8051 has a in built UART (Universal

Asynchronous Receiver-Transmitter). Typically, serial is used to transmit ASCII data.

Communication is completed using 3 transmission lines: (1) Transmitter, (2) Receiver

and (3) Ground. Since serial is asynchronous, the port is able to transmit data on one

line while receiving data on another. Other lines are available for handshaking, but are

not required. The important characteristics are Data Transfer Rate, Start and Stop bits,

Data bits and Parity bits. For two ports to communicate, these parameters must match.

Data Transfer Rate:


BVRM Page 24
The rate of data transfer in serial data communication is stated in bps (bits per

second). Another widely used terminology for bps is baud rate. However the baud rate

and bps are not necessarily equal. Baud rate is defined as the number of signal changes

per second. In modems, there are occasions when a single change of signal transfers

several bits of data As far as conductor wire is considered bps and baud rate is the

same.

Data Formating:

Asynchronous serial data communication is used for character oriented transmissions,

each character is placed in between start and stop bits. This is called framing .In data

framing for asynchronous communications, the data, such as ASCII characters, are

packed in between a start bit 1(high). Since the data is clocked across the lines and

each device has its own clock, it is possible for the two devices to come out slightly

out of synchronous. Therefore, the stop bits not only indicate the end of transmission

but also give the computers some room for error in clock speeds .The more the stop

bits the greater the lenience in synchronizing the different clocks, but slower the data

transmission rate.

Parity Bits:

In order to maintain data integrity, parity bit of the character byte is included in the

data frame .The parity bit is odd or even .In the case of an odd parity bit the

number of data bits, including the parity bits has an odd number of 1’s.Similarly,

in an even parity bit system the total number of bits, including the parity bits has

BVRM Page 25
an even number of 1’s.UART chips allow programming of the parity bit for odd-,

even- and no- parity options.

RS232 STANDARD:

To allow compatibility among data communication equipment made by various

Manufacturers, an interfacing standard called RS232 was set by the Electronics and

Industries Association in 1960.Today, RS232 is the most widely used serial I/O

interfacing standard. RS232 standard is not TTL compatible; therefore it requires a

line driver such as MAX232chip to convert RS232 voltage levels to TTL levels and

vice versa. One advantage of the MAX 232 chip is that it uses +5V power source,

which is the same as the source voltage for the 8051.

Scan Codes :

The diagram below shows the Scan Code assigned to the individual keys. The Scan

code is shown on the bottom of the key. E.g. The Scan Code for ESC is 76. All the

scan codes are shown in Hex.

BVRM Page 26
As you can see, the scan code assignments are quite random. In many cases the easiest

way to convert the scan code to ASCII

would be to use a look up table. Below is the scan code for the extended keyboard &

Numeric keypad.

Interfacing the PC AT Keyboard

Features;

Interfacing Standard PC AT Keyboards

Requires Only Two I/O Pins. One of them must be an External Interrupt Pin

BVRM Page 27
No Extra Hardware Required

Complete Example in C, Implementing a

Keyboard to Serial Converter.

Scan Codes;

The AT keyboard has a scan code associated with each key. When a key is pressed,

this code is transmitted. If a key is held down for a while, it starts repeating. The

repeat rate is typically 10 per second. When a key is released, a “break” code ($F0) is

transmitted followed by the key scan code. For most of the keys, the scan code is one

byte. Some keys like the Home, Insert and Delete keys have an extended scan code,

from two to five bytes. The first byte is always $E0. This is also true for the “break”

sequence, e.g. E0 F0 xx… AT keyboards are capable of handling three sets of scan

codes, where set 2 is default. This example will only use set 2.

The Software

The code supplied with this application note is a simple keyboard to RS-232 interface.

The scan codes received from the keyboard are translated into appropriate ASCII

characters and transmitted by the UART. The source code is written in C, and is easily

modified and adaptable to all AVR micro controllers with SRAM.

The algorithm

BVRM Page 28
Keyboard reception is handled by the interrupt function INT0_interrupt. The reception

will operate independent of the rest of the program. The algorithm is quite simple:

Store the value of the data line at the leading edge of the clock pulse. This is easily

handled if the clock line is connected to the INT0 or INT1 pin. The interrupt function

will be executed at every edge of the clock cycle, and data will be stored at the falling

edge. After all bits are received, the data can be decoded. This is done by calling the

decode function. For character keys, this function will store an ASCII character in a

buffer. It will take into account if the shift key is held down when a key is pressed.

Other keys like function keys, navigation keys (arrow keys, page up/down keys etc.)

and modifier keys like Ctrl and Alt are ignored. The mapping from scan codes to

ASCII characters are handled with table look-ups, one table for shifted characters and

one for un-shifted.

GLOBAL SYSTEM FOR MOBILE COMMUNICATION:

Global system for mobile communication (GSM) is a globally accepted standard for

digital cellular communication. GSM is the name of a standardization group

established in 1982 to create a common European mobile telephone standard that

would formulate specifications for a pan-European mobile cellular radio system

operating at 900 MHz. It is estimated that many countries outside of Europe will join

the GSM partnership.

Description:

GSM, the Global System for Mobile communications, is a digital cellular

communications system, which has rapidly gained acceptance and market share

worldwide, although it was initially developed in a European context. In addition to

digital transmission, GSM incorporates many advanced services and features,

BVRM Page 29
including ISDN compatibility and worldwide roaming in other GSM networks. The

advanced services and architecture of GSM have made it a model for future third-

generation cellular systems, such as UMTS. This paper will give an overview of the

services offered by GSM, the system architecture, the radio transmission structure, and

the signaling functional architecture.

GSM Modems

A GSM modem can be an external modem device, such as the Wavecom FASTRACK

Modem. Insert a GSM SIM card into this modem, and connect the modem to an

available serial port on your computer.

A GSM modem can be a PC Card installed in a notebook computer, such as the Nokia

Card Phone.

A GSM modem could also be a standard GSM mobile phone with the appropriate

cable and software driver to connect to a serial port on your computer. Phones such as

the Nokia 7110 with a DLR-3 cable, or various Ericsson phones, are often used for

this purpose.

A dedicated GSM modem (external or PC Card) is usually preferable to a GSM

mobile phone. This is because of some compatibility issues that can exist with mobile

phones. For example, if you wish to be able to receive inbound MMS messages with

your gateway, and you are using a mobile phone as your modem, you must utilize a

mobile phone that does not support WAP push or MMS. This is because the mobile

phone automatically processes these messages, without forwarding them via the

modem interface. Similarly some mobile phones will not allow you to correctly

receive SMS text messages longer than 160 bytes (known as “concatenated SMS” or

“long SMS”). This is because these long messages are actually sent as separate SMS

BVRM Page 30
messages, and the phone attempts to reassemble the message before forwarding via the

modem interface. (We’ve observed this latter problem utilizing the Ericsson R380,

while it does not appear to be a problem with many other Ericsson models.)

When you install your GSM modem, or connect your GSM mobile phone to the

computer, be sure to install the appropriate Windows modem driver from the device

manufacturer. To simplify configuration, the Now SMS/MMS Gateway will

communicate with the device via this driver. An additional benefit of utilizing this

driver is that you can use Windows diagnostics to ensure that the modem is

communicating properly with the computer

Figure: GSM smart modem

BVRM Page 31
The Now SMS/MMS gateway can simultaneously support multiple modems,

provided that your computer hardware has the available communications port

resources.

SMART MODEM (GSM/GPRS)

INTRODUCTION :

Analogic’s GSM Smart Modem is a multi-functional, ready to use, rugged and

versatile modem that can be embedded or plugged into any application. The Smart

Modem can be customized to various applications by using the standard AT

commands. The modem is fully type-approved and can directly be integrated into your

projects with any or all the features of Voice, Data, Fax, SMS, and Internet etc.

Smart Modem kit contain the following items:

Analogic’s GSM/GPRS Smart Modem

SMPS based power supply adapter.

3 dBi antenna with cable (optional: other types)

Data cable (RS232)

User Manual

Temperature Range:

Operating temperature: from -200C to +550C

Storage temperature: from -250C to +700

BVRM Page 32
Installing the modem:

To install the modem, plug the device on to the supplied SMPS Adapter. For

Automotive applications fix the modem permanently using the mounting slots

(optional as per your requirement dimensions).

Inserting/ Removing the SIM Card:

To insert or Remove the SIM Card, it is necessary to press the SIM holder ejector

button with Sharp edged object like a pen or a needle. With this, the SIM holder comes

out a little, then pulls it out and insert or remove the SIM Card

Make sure that the ejector is pushed out completely before accessing the SIM Card

holder do not remove the SIM card holder by force or tamper it (it may permanently

damage). Place the SIM Card Properly as per the direction of the installation. It is very

important that the SIM is placed in the right direction for its proper working condition

AT commands features:

BVRM Page 33
Line settings:

A serial link handler is set with the following default values

Autobaud, 8 bits data, 1 stop bit, no parity, flow control.

Command line

Commands always start with AT (which means attention) and finish with a

<CR> character.

Information responses and result codes

Responses start and end with <CR><LF>,.

If command syntax is incorrect, an ERROR string is returned.

If command syntax is correct but with some incorrect parameters, the +CME

ERROR: <Err> or +CMS ERROR: <SmsErr> strings are returned with different error

codes.

If the command line has been performed successfully, an OK string is

returned.

In some cases, such as “AT+CPIN?” or (unsolicited) incoming events, the

product does not return the OK string as a response.

Services provided by GSM

BVRM Page 34
GSM was designed having interoperability with ISDN in mind, and the

services provided by GSM are a subset of the standard ISDN services. Speech is the

most basic, and most important, teleservice provided by GSM.

In addition, various data services are supported, with user bit rates up to 9600

bps. Specially equipped GSM terminals can connect with PSTN, ISDN, Packet

Switched and Circuit Switched Public Data Networks, through several possible

methods, using synchronous or asynchronous transmission. Also supported are Group

3 facsimile service, videotex, and teletex. Other GSM services include a cell broadcast

service, where messages such as traffic reports, are broadcast to users in particular

cells.

A service unique to GSM, the Short Message Service, allows users to send and

receive point-to-point alphanumeric messages up to a few tens of bytes. It is similar to

paging services, but much more comprehensive, allowing bi-directional messages,

store-and-forward delivery, and acknowledgement of successful delivery.

Supplementary services enhance the set of basic teleservices. In the Phase I

specifications, supplementary services include variations of call forwarding and call

barring, such as Call Forward on Busy or Barring of Outgoing International Calls.

Many more supplementary services, including multiparty calls, advice of charge, call

waiting, and calling line identification presentation will be offered in the Phase 2

specifications.

Mobile Station:
BVRM Page 35
The mobile station (MS) consists of the mobile equipment (the terminal) and a

smart card called the Subscriber Identity Module (SIM). The SIM provides personal

mobility, so that the user can have access to subscribed services irrespective of a

specific terminal. By inserting the SIM card into another GSM terminal, the user is

able to receive calls at that terminal, make calls from that terminal, and receive other

subscribed services.

The mobile equipment is uniquely identified by the International Mobile

Equipment Identity (IMEI). The SIM card contains the International Mobile

Subscriber Identity (IMSI) used to identify the subscriber to the system, a secret key

for authentication, and other information. The IMEI and the IMSI are independent,

thereby allowing personal mobility. The SIM card may be protected against

unauthorized use by a password or personal identity number.

Base Station Subsystem:

The Base Station Subsystem is composed of two parts, the Base Transceiver

Station (BTS) and the Base Station Controller (BSC). These communicate across the

standardized Abis interface, allowing (as in the rest of the system) operation between

components made by different suppliers.

The Base Transceiver Station houses the radio tranceivers that define a cell

and handles the radio-link protocols with the Mobile Station. In a large urban area,

there will potentially be a large number of BTSs deployed, thus the requirements for a

BTS are ruggedness, reliability, portability, and minimum cost.

The Base Station Controller manages the radio resources for one or more

BTSs. It handles radio-channel setup, frequency hopping, and handovers, as described

BVRM Page 36
below. The BSC is the connection between the mobile station and the Mobile service

Switching Center (MSC).

Network Subsystem

The central component of the Network Subsystem is the Mobile services

Switching Center (MSC). It acts like a normal switching node of the PSTN or ISDN,

and additionally provides all the functionality needed to handle a mobile subscriber,

such as registration, authentication, location updating, handovers, and call routing to a

roaming subscriber. These services are provided in conjunction with several functional

entities, which together form the Network Subsystem. The MSC provides the

connection to the fixed networks (such as the PSTN or ISDN). Signalling between

functional entities in the Network Subsystem uses Signalling System Number 7 (SS7),

used for trunk signalling in ISDN and widely used in current public networks.

The Home Location Register (HLR) and Visitor Location Register (VLR),

together with the MSC, provide the call-routing and roaming capabilities of GSM. The

HLR contains all the administrative information of each subscriber registered in the

corresponding GSM network, along with the current location of the mobile. The

location of the mobile is typically in the form of the signalling address of the VLR

associated with the mobile as a distributed database. station. The actual routing

procedure will be described later. There is logically one HLR per GSM network,

although it may be implemented

The Visitor Location Register (VLR) contains selected administrative

information from the HLR, necessary for call control and provision of the subscribed

services, for each mobile currently located in the geographical area controlled by the

VLR. Although each functional entity can be implemented as an independent unit, all

BVRM Page 37
manufacturers of switching equipment to date implement the VLR together with the

MSC, so that the geographical area controlled by the MSC corresponds to that

controlled by the VLR, thus simplifying the signalling required. Note that the MSC

contains no information about particular mobile stations --- this information is stored

in the location registers.

The other two registers are used for authentication and security purposes. The

Equipment Identity Register (EIR) is a database that contains a list of all valid mobile

equipment on the network, where each mobile station is identified by its International

Mobile Equipment Identity (IMEI). An IMEI is marked as invalid if it has been

reported stolen or is not type approved. The Authentication Center (AuC) is a

protected database that stores a copy of the secret key stored in each subscriber's SIM

card, which is used for

Read message +CMGR

Description :

This command allows the application to read stored messages. The messages are read

from the memory selected by +CPMS command.

Syntax :

Command syntax : AT+CMGR=<index>

Response syntax for text mode:

+CMGR :<stat>,<oa>,[<alpha>,] <scts> [,<tooa>,<fo>,

<pid>,<dcs>,<sca>,<tosca>,<length>] <CR><LF> <data> (for SMS MS MS-

DELIVER only)

BVRM Page 38
+CMGR : <stat>,<da>,[<alpha>,] [,<toda>,<fo>,<pid>,<dcs>, [<vp>], <sca>,

<tosca>,<length>]<CR><LF> <data> (for SMS-SUBMIT only)

+CMGR : <stat>,<fo>,<mr>,[<ra>],[<tora>],<scts>,<dt>,<st> (for SMS SMS-

STATUS-

REPORT only)

Response syntax for PDU mode :

+CMGR: <stat>, [<alpha>] ,<length> <CR><LF> <pdu>

A message read with status “REC UNREAD” will be updated in memory with the

status “REC READ”.

BVRM Page 39
Example :

BVRM Page 40
Send message +CMGS

Description :

The <address> field is the address of the terminal to which the message is sent. To

send the message, simply type, <ctrl-Z> character (ASCII 26). The text can contain all

existing characters except <ctrl-Z> and <ESC> (ASCII 27). This command can be

aborted using the <ESC> character when entering text. In PDU mode, only

hexadecimal characters are used (‘0’…’9’,’A’…’F’).

Syntax :

Command syntax in text mode :

AT+CMGS= <da> [ ,<toda> ] <CR>

text is entered <ctrl-Z / ESC >

Command syntax in PDU mode :

AT+CMGS= <length> <CR>

PDU is entered <ctrl-Z / ESC >

BVRM Page 41
The message reference, <mr>, which is returned to the application is allocated by the

product. This number begins with 0 and is incremented by one for each outgoing

message (successful and failure cases); it is cyclic on one byte (0 follows 255).

Note:

this number is not a storage number - outgoing messages are not stored.

Write Message to Memory +CMGW

Description :

This command stores a message in memory (either SMS-SUBMIT or

SMSDELIVERS).

The memory location <index> is returned (no choice possible as with phonebooks

+CPBW).

Text or PDU is entered as described for the Send Message +CMGS command.

Syntax :

Command syntax in text mode : (<index> is returned in both cases)

AT+CMGW= <oa/da> [,<tooa/toda> [,<stat> ] ] <CR>

enter text <ctrl-Z / ESC>

Command syntax in PDU mode :

AT+CMGW= <length> [,<stat>] <CR>

give PDU <ctrl-Z / ESC>

BVRM Page 42
Response syntax:

+CMGW: <index> or +CMS ERROR: <err> if writing fails

Delete message +CMGD

Description :

This command is used to delete one or several messages from preferred message

storage (“BM” SMS CB ‘RAM storage’, “SM” SMSPP storage ‘SIM storage’ or “SR”

SMS Status-Report storage).

Syntax :

BVRM Page 43
Defines values

<index>

(1 1-20) When the preferred message storage is “BM” Integer type values in the range

of location numbers of SIM Message memory when the preferred message storage is

“SM” or “SR”.

<DelFlag>

0 Delete message at location <index>.

1 Delete All READ messages

2 Delete All READ and SENT messages

BVRM Page 44
3 Delete All READ, SENT and UNSENT messages

4 Delete All messages.

INTERFACING

INTERFACING WITH LCDS

Code for interfacing the LCD to 89C51 Micro Controller

#include<reg 51.h>
#include<intrins.h>
// Device Mapping
#define LCD_Port P0
#define LCD_RS P1_5
#define LCD_RW P1_6
#define LCD_EN P1_7
#define LCD_BP P0_7 // LCD Busy Pin

BVRM Page 45
// Functions Prototype Declaration

void lprintf(unsigned char *,unsigned char,unsigned char);


void LCD_Init();
void LCD_Cmd(unsigned char);
void LCD_Data(unsigned char);
void Delay_10ms();
void Delay(int);
void LCD_Busy();
void ClrLCD();
void SConfig(void);
void Send_Char(unsigned char);
void Send(unsigned char *);

// To Clear LCD

void ClrLCD()
{
LCD_Cmd(0x01);
}

// Displaying String
void lprintf(char *str,unsigned char ln,unsigned char col)
{
static int li;
unsigned char line;

if(li==0)
{
li=1;
LCD_Init();
}

switch(ln)
{
case 1:
line = 0x80;
break;
case 2:
line = 0xc0;
break;
case 3:
line = 0x94;
break;
case 4:
line = 0xD4;
break;
}

LCD_Cmd(line+col);

BVRM Page 46
while(*str)
{
LCD_Data(*str);
str++;
}
}

//LCD Initilization
void LCD_Init()
{
LCD_Cmd(0x30);
LCD_Cmd(0x30);
LCD_Cmd(0x30);
LCD_Cmd(0x38);
LCD_Cmd(0x06);
LCD_Cmd(0x01);
LCD_Cmd(0x0c);
}
// LCD Command Run
void LCD_Cmd(unsigned char cmd)
{
LCD_Busy();
LCD_Port=cmd;
P1_2=0;
_nop_();
P1_2=1;
LCD_RS=0;
LCD_ RW=0;
LCD_EN=1;
_nop_();
_nop_();
LCD_EN=0;
}
//LCD Data Out Function
void LCD_Data(unsigned char dt)
{
LCD_Busy();
LCD_Port=dt;
P1_2=0;
_nop_();
P1_2=1;
LCD_RS=1;
LCD_RW=0;
LCD_EN=1;
_nop_();
_nop_();
LCD_EN=0;
}

// LCD BUSY Check Function

BVRM Page 47
void LCD_Busy()
{
Delay(1);
}

// Delay Function
void Delay(int n)
{
while(n)
{
Delay_10ms();
n--;
}
}

void Delay_10ms()
{
int i;
for(i=0; i<1825; i++);
}

//Functions For Serial Communication

// Serial Configuration
void SConfig()
{
TMOD=0x20;
TH1=0xFD;
TL1=0xFD;
SCON=0x50;
TR1=1;
}

// Function to Tx a single Character


void Send_Char(unsigned char ch)
{
unsigned char flag=0;
SBUF=ch;
whiile(!TI);
TI=0;
}

// Funciton to Tx a given String


void Send(unsigned char *str)
{
while(*str)
{
Send_Char(*str);
str++;
}

BVRM Page 48
}
INTERFACING WITH PC KEYBOARD

#include <c51.h>

// Device Mapping
#define KB_DATA P3_4
//Global Variable Declaration
xdata unsigned char dt _at_ 00;
unsigned char kbit;
unsigned char ByteC=0;
xdata unsigned char mbit _at_ 20;
unsigned char bcount=0;
unsigned char fkey=0;
unsigned char fCaps=0;
unsigned char dtbak;

// Functions Prototype Declaration


void Disp_Hex(unsigned char );
unsigned char Get_Char(unsigned char );
unsigned char Get_Key(unsigned char);
void GetStr(unsigned char *);
// Interrupt Subroutine connected to Keyboard Clock Pin
Ex_Int1() interrupt 2 using 1
{
bcount++;
if(bcount>=2 && bcount<=9) // Push the Data Bits in to the
dt variable
{
kbit = KB_DATA;
dt = dt | (mbit * kbit);
mbit=mbit<<1;
}
else
if(bcount==33) // When Last Bit received from the Keyboard
{
if(dt==0x58) // Checking for Shift Key
{
fCaps=~fCaps;
}
else
{
fkey=1;
}
mbit=1;
bcount=0;
}

BVRM Page 49
}

/************************************ Functions *******/


// Function to Read a String From AT-Keyboard

void GetStr(unsigned char *p)


{
unsigned char ct;
while(1)
{
ct=Get_Key(1);
if(ct==0x0d)
break;
*p=ct;
p++;
} // Reads the Characters untill Enter is Pressed
*p='\0'; // Add the Null
character at the end of the String

EA=0; // Disable the Serial


Interrupts
EX1=0;
IT1=0;
}
unsigned char Get_Key(unsigned char echo)
{
unsigned char c;
// Enabling the Ketboard Interrups
dt=0;
mbit = 1;
EA=1;
EX1=1;
IT1=1;
while(1)
{
if(fkey)
{
// Disp_Hex(dt); // To Display the Scan Code while Testing the KB
c=Get_Char(dt);
if(echo)
LCD_Data(c);
dtbak=dt;
dt=0;
fkey=0;
break;
}
}
return c;
}

BVRM Page 50
//---------------------------------------------------------------------------------------------
// This function Display the Hex Scancode recived from the AT-Keyboard
//---------------------------------------------------------------------------------------------

unsigned char Get_Char(unsigned char dt )

xdata unsigned char scode1[]={

//0 1 2 3 4 5 6 7 8 9 a b c d e f

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','~',' ',

' ',' ',' ',' ',' ','Q','1',' ',' ',' ','Z','S','A','W','2',' ',

' ','C','X','D','E','4','3',' ',' ',' ','V','F','T','R','5',' ',

' ','N','B','H','G','Y','6',' ',' ',' ','M','J','U','7','8',' ',

' ','<','K','I','O','0','9',' ',' ','>','?','L',':','P','_',' ',

' ',' ','"',' ','[','+',' ',' ',' ',' ',0x0d,']',' ','/',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',0x1b,' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

};

BVRM Page 51
xdata unsigned char scode2[]={

//0 1 2 3 4 5 6 7 8 9 a b c d e f

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','~',' ',

' ',' ',' ',' ',' ','q','1',' ',' ',' ','z','s','a','w','2',' ',

' ','c','x','d','e','4','3',' ',' ',' ','v','f','t','r','5',' ',

' ','n','b','h','g','y','6',' ',' ',' ','m','j','u','7','8',' ',

' ','<','k','i','o','0','9',' ',' ','>','?','l',':','p','_',' ',

' ',' ','"',' ','[','+',' ',' ',' ',' ',0x0D,']',' ','/',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',

};

if(fCaps)

return scode1[dt];

else

return scode2[dt];

BVRM Page 52
Code to interface Micro Controller with GSM to
transmit text message

// Including of the Header Filer


#include <kb.h>
#include <gsm1.h>

// Function Prototype Declaration


void Welcome();
void Main_Menu();
void Tx_Msg();
void Rx_Msg();
void Del_Msg();
// Main Function
void main()
{
SConfig();
TxMsg("Hai","9866435788");
while(1);
}

Code for the final project


// Including of the Header Filer
#include <kb.h>
#include <gsm1.h>
// Function Prototype Declaration
void Welcome();
void Main_Menu();
void Tx_Msg();
void Rx_Msg();
void Del_Msg();

// Main Function
void main()
{
Welcome();
ClrLCD();

while(1)
{
Main_Menu();
}
}

void Welcome()
{

BVRM Page 53
ClrLCD();
lprintf("Bapatla Eng. College",1,0);
lprintf("Bapatla",2,6);
lprintf("GSM SMS Project",3,2);
Delay(200);
}

void Main_Menu()
{
unsigned char ch;
ClrLCD();
lprintf("MAIN MENU",1,0);
lprintf("1. Send Message",2,0);
lprintf("2. Read Message",3,0);
lprintf("3. Delte Message",4,0);
ch=Get_Key(0);

switch(ch)
{
case '1':
Tx_Msg();
break;
case '2':
Rx_Msg();
break;
case '3':
Del_Msg();
break;
}
}

void Tx_Msg()
{
unsigned char msg[50],mno[15];
SConfig();
ClrLCD();
lprintf("Enter Message: ",1,0);
LCD_Cmd(0xc0);
GetStr(msg);
ClrLCD();
lprintf("Enter Mobile No.: ",1,0);
LCD_Cmd(0xc0);
GetStr(mno);
TxMsg(msg,mno);
lprintf("Msg Send..",4,0);
Get_Key(0);
}

void Rx_Msg() // Finilized


{
unsigned char msgno[5];
SConfig();

BVRM Page 54
ClrLCD();
lprintf("Enter Msg No. : ",1,0);
GetStr(msgno);
RxMsg(msgno);
Get_Key(0);
}
void Del_Msg()
{
unsigned char msgno[5];
SConfig();
ClrLCD();
lprintf("Enter Msg No. : ",1,0);
GetStr(msgno);
DelMsg(msgno);
Get_Key(0);
}
END ;End of the programe

Conclusion

GSM will allow communication anywhere, anytime, and with anyone. The

functional architecture of GSM employing intelligent networking principles, and its

ideology, which provides The development of GSM is the first step towards a true

personal communication system that enough standardization to ensure compatibility,

BVRM Page 55
but still allows manufacturers and operators freedom, has been widely adopted in the

development of future wireless systems.

Together with international roaming, and support for a variety of services such

as telephony, data transfer, fax, Short Message Service, and supplementary services,

GSM comes close to fulfilling the requirements for a personal communication system:

close enough that it is being used as a basis for the next generation of mobile

communication technology in Europe, the Universal Mobile Telecommunication

System (UMTS).

BVRM Page 56
BIBLOGRAPHY

Reference Books:

The 8051 Microcontroller and Embedded Systems -Muhammad Ali Mazidi

The 8051 Micro-controller - Ayala

Programming and customizing the 8051 - Myke Predko

Websites:

www.atmel.com

www.analogicgroup.com

www.philips.com

www.google.com

www.gsmworld.com

BVRM Page 57
BVRM Page 58
BVRM Page 59
BVRM Page 60

You might also like