INDUSTRIAL DEVICE OPERATING SYSTEM USING MOBILE COMMUNICATIONS

By R. S. SIVA KUMAR RAJU T.SATISH KUMAR S.PRADEEP

http://ekoprojects.blogspot.com/

1

INDEX Chapter

Contents

Page No.s

Introduction

1

1.

Introduction to embedded system

2

2.

Introduction to micro controllers

9

3.

Introduction to gsm technology

33

BLOCK DIAGRAM

45

4

Hardware description

4.1

Power supply

46

4.2

Rectifiers

49

4.3

LCD Display

52

4.4

Max 232

60

4.5

Relays

70

5

Software description

5.1

Keil µ version

80

5.2

Flash magic

89

6

Applications

91

2

Industrial device operating system using Mobile Communication INTRODUCTION: This prototype project is basically developed to get customize the things automatically (Device Controlling). This paper also describes an investigation into the potential for remote controlled operation of Device control automation systems. It considers possible solutions through GSM technology and indicates how to optimize the use of such systems. The industry is an eternal, heterogeneous, distributed computing environment which certainly requires a careful study before developing any suitable Industrial device controlling that will accomplish its requirements.

Nevertheless the latest attempts at introducing Industrial device control Systems in actual Industries for all kinds of users are starting to be successful thanks to the continuous standardization process that is lowering the prices and making devices more useful and easier to use for the end user.

Even so several important issues are always to be handled strictly before developing and installing an Industrial device controlling and data acquisition; factors like security, reliability, usefulness, robustness and price are critical to determine if the final product will accomplish the expected requirements.

In the present project we control the various devices which in industry by using GSM network.

3

CHAPTER -1 INTRODUCTION TO EMBEDDED SYSTEMS 1.1 WHAT IS AN EMBEDDED SYSTEM? An embedded system can be defined as a computing device that does a specific focused job. Appliances such as the air-conditioner, VCD player, DVD player, printer, fax machine, mobile phone etc. are examples of embedded systems. Each of these appliances will have a processor and special hardware to meet the specific requirement of the application along with the embedded software that is executed by the processor for meeting that specific requirement. The embedded software is also called “firm ware”. The desktop/laptop computer is a general purpose computer. You can use it for a variety of applications such as playing games, word processing, accounting, software development and so on. In contrast, the software in the embedded systems is always fixed. HISTORY: In the earliest years of computers in the 1940s, computers were sometimes dedicated to a single task, but were too large to be considered "embedded". Over time however, the concept of programmable controllers developed from a mix of computer technology, solid state devices, and traditional electromechanical sequences. The first recognizably modern embedded system was the Apollo Guidance Computer, developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the project's inception, the Apollo guidance computer was considered the riskiest item in the Apollo project. The use of the then new monolithic integrated circuits, to reduce the size and weight, increased this risk. The first mass-produced embedded system was the Autonetics D-17 guidance computer for the Minuteman (missile), released in 1961. It was built from transistorlogic and had a hard disk for main memory. When the Minuteman II went into production in 1966, the D-17 was replaced with a new computer that was the first high-volume use of integrated circuits. This program alone reduced prices on quad nand gate ICs from $1000/each to $3/each, permitting their use in commercial products. Since these early applications in the 1960s, embedded systems have come down in price. There has also been an enormous rise in processing power and functionality. For example the first microprocessor was the Intel 4004, which found its

4

way into calculators and other small systems, but required external memory and support chips. In 1978 National Engineering Manufacturers Association released the standard for a programmable microcontroller. The definition was an almost any computer-based controller. They included single board computers, numerical controllers, and sequential controllers in order to perform event-based instructions. By the mid-1980s, many of the previously external system components had been integrated into the same chip as the processor, resulting in integrated circuits called microcontrollers, and widespread use of embedded systems became feasible. As the cost of a microcontroller fell below $1, it became feasible to replace expensive knob-based analog components such as potentiometers and variable capacitors with digital electronics controlled by a small microcontroller with up/down buttons or knobs. By the end of the 80s, embedded systems were the norm rather than the exception for almost all electronics devices, a trend which has continued since.

1.2 EMBEDDED SYSTEMS ARE CHARACTERIZED BY SOME SPECIAL FEATURES LISTED BELOW:  Embedded systems do a very specific task; they cannot be programmed to do different things. . Embedded systems have very limited resources, particularly the memory. Generally, they do not have secondary storage devices such as the C DROM or the floppy disk. Embedded systems have to work against some deadlines. A specific job has to be completed within a specific time. In some embedded systems, called real-time systems, the deadlines are stringent. Missing a deadline may cause a catastrophe-loss of life or damage to property. Embedded systems are constrained for power. As many embedded systems operate through a battery, the power consumption has to be very low.  Embedded systems need to be highly reliable. Once in a while, pressing ALTCTRL-OEL is OK on your desktop, but you cannot afford to reset your embedded system.  Some embedded systems have to operate in extreme environmental conditions such as very high temperatures and humidity.  Embedded systems that address the consumer market (for exam-ple, electronic toys) are very cost-sensitive: Even a reduction of $0.1 is lot of cost saving, because thousands or millions systems may be sold.  Unlike desktop computers in which the hardware platform is dominated by Intel and the operating system is dominated by Microsoft, there is a wide variety of 5

processors and operating systems for the embedded systems. So, choosing the right plat-form is the most complex task. 1.2.1 APPLICATION AREAS Nearly 99 per cent of the processors manufactured end up in embedded systems. The embedded system market is one of the highest growth areas as these systems are used in very market segment- consumer electronics, office automation, industrial automation, biomedical engineering, wireless communication, data communication, telecommunications, transportation, military and so on. 1.2.2 CONSUMER APPLIANCES: At home we use a number of embedded systems which include digital camera, digital diary, DVD player, electronic toys, microwave oven, remote controls for TV and air-conditioner, VCO player, video game consoles, video recorders etc. Today’s hightech car has about 20 embedded systems for transmission control, engine spark control, air-conditioning, navigation etc. Even wristwatches are now becoming embedded systems. The palmtops are powerful embedded systems using which we can carry out many general-purpose tasks such as playing games and word processing. 1.2.3 OFFICE AUTOMATION: The office automation products using embedded systems are copying machine, fax machine, key telephone, modem, printer, scanner etc. Industrial automation: Today a lot of industries use embedded systems for process control. These include pharmaceutical, cement, sugar, oil exploration, nuclear energy, electricity generation and transmission. The embedded systems for industrial use are designed to carry out specific tasks such as monitoring the temperature, pressure, humidity, voltage, current etc., and then take appropriate action based on the monitored levels to control other devices or to send information to a centralized monitoring station. In hazardous industrial environment, where human presence has to be avoided, robots are used, which are programmed to do specific jobs. 1.3 CATEGORIES OF EMBEDDED SYSTEMS: Based on functionality and performance requirements, embedded systems can be categorized as:  Stand-alone embedded systems  Real-time systems 6

 

Networked information appliances Mobile devices

1.3.1 Stand alone Embedded Systems: As the name implies, stand-alone systems work in stand-alone mode. They take inputs, process them and produce the desired output. The input can be electrical signals from transducers or commands from a human being such as the pressing of a button. The output can be electrical signals to drive another system, an LED display or LCD display for displaying of information to the users. Embedded systems used in process co~1’rol, automobiles, consumer electronic items etc. fall into this category. In a process control system, the inputs are from sensors that convert a physical entity such as temperature or pressure into its equivalent electrical signal. These electrical signals are processed by the system and the appropriate electrical signals are produced using which an action is taken such as opening a valve. A few embedded systems used at home are shown in fig

1.3.2 REAL TIME SYSTEMS: Embedded systems in which some specific work has to be done in a specific time period are called real-time systems. For example: consider a system that has to open a valve within 30milliseconds when the humidity crosses a particular threshold. If the valve is not opened within 30 milliseconds, a catastrophe may occur. Such systems with strict deadlines are called hard real-time systems. In some embedded systems, deadlines are imposed, but not adhering to them once in a while may not lead to a catastrophe. For example, consider a DVD player. Suppose, you give a command to the DVD player from are mote control, and there is a delay of a few milliseconds in executing that command. But, this delay won’t lead to a serious simplification. Such systems are called soft real-time systems.

7

1.3.3 NETWORKED INFORMATION APPLIANCES: Embedded systems that are provided with network interfaces and accessed by networks such as Local Area Network or the Internet are called networked information appliances. Such embedded systems are connected to a network, typically a network running TCP/IP (Transmission Control Protocol! Internet Protocol) protocol suite, such as the Internet or a company’s Intranet. These systems have emerged in recent years These systems run the protocol TCP/IP stack and get connected either through PPP or Ethernet to a network and communicate with other nodes in the network. Here are some examples of such systems:

8

1.3.4 MOBILE DEVICES: Mobile devices such as mobile phones, Personal Digital Assistants (PDAs), smart phones etc. are a special category of embedded systems. Though the PDAs do many general purpose tasks, they need to be designed just like the ‘conventional’ embedded systems. The limitations of –the mobile devices- memory constraints, small size, lack of good user interfaces such as full-fledged keyboard and display etc.-are same as those found in the embedded systems discussed above. Hence, mobile devices are considered as embedded systems. However, the PDAs are now capable of supporting general-purpose application software such as word processors, games, etc. User interfaces Embedded systems range from no user interface at all - dedicated only to one task - to full user interfaces similar to desktop operating systems in devices such as PDAs. Simple systems Simple embedded devices use buttons, LEDs, and small character- or digit-only displays, often with a simple menu system. In more complex systems A full graphical screen, with touch sensing or screen-edge buttons provides flexibility while minimizing space used: the meaning of the buttons can change with the screen, and selection involves the natural behavior of pointing at what's desired. Handheld systems often have a screen with a "joystick button" for a pointing device. The rise of the World Wide Web has given embedded designers another quite different option: providing a web page interface over a network connection. This avoids the cost of a sophisticated display, yet provides complex input and display capabilities when needed, on another computer. This is successful for remote, permanently installed equipment. In particular, routers take advantage of this ability. CPU platform Embedded processors can be broken into two distinct categories: microprocessors (μP) and micro controllers (μC). Micro controllers have built-in peripherals on the chip, reducing size of the system.

9

There are many different CPU architectures used in embedded designs such as ARM, MIPS, Coldfire/68k, PowerPC, x86, PIC, 8051, Atmel AVR, Renesas H8, SH, V850, FR-V, M32R, Z80, Z8, etc. A common configuration for very-high-volume embedded systems is the system on a chip (SoC), an application-specific integrated circuit (ASIC), for which the CPU core was purchased and added as part of the chip design. A related scheme is to use a field-programmable gate array (FPGA), and program it with all the logic, including the CPU. 1.4 PERIPHERALS: Embedded Systems talk with the outside world via peripherals, such as:      

Serial Communication Interfaces (SCI): RS-232, RS-422, RS-485 etc Synchronous Serial Communication Interface: I2C, JTAG, SPI, SSC and ESSI Universal Serial Bus (USB) Networks: Controller Area Network, LonWorks, etc Timers: PLL(s), Capture/Compare and Time Processing Units Discrete IO: aka General Purpose Input Output (GPIO)

Tools: As for other software, embedded system designers use compilers, assemblers, and debuggers to develop embedded system software. However, they may also use some more specific tools: 

An in-circuit emulator (ICE) is a hardware device that replaces or plugs into the microprocessor, and provides facilities to quickly load and debug experimental code in the system.  Utilities to add a checksum or CRC to a program, so the embedded system can check if the program is valid.  For systems using digital signal processing, developers may use a math workbench such as MathCAD or Mathematic to simulate the mathematics.  Custom compilers and linkers may be used to improve optimization for the particular hardware.



An embedded system may have its own special language or design tool, or add enhancements to an existing language.

10

CHAPTER -2 INTRODUCTION TO MICROCONTROLLERS 2.1 MICROCONTROLLER: Microprocessors and microcontrollers are widely used in embedded systems products. Microcontroller is a programmable device. A microcontroller has a CPU in addition to a fixed amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed amount of on-chip ROM, RAM and number of I/O ports in microcontrollers makes them ideal for many applications in which cost and space are critical. The Intel 8051 is Harvard architecture, single chip microcontroller (µC) which was developed by Intel in 1980 for use in embedded systems. It was popular in the 1980s and early 1990s, but today it has largely been superseded by a vast range of enhanced devices with 8051-compatible processor cores that are manufactured by more than 20 independent manufacturers including Atmel, Infineon Technologies and Maxim Integrated Products. 8051 is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at a time. Data larger than 8 bits has to be broken into 8-bit pieces to be processed by the CPU. 8051 is available in different memory types such as UV-EPROM, Flash and NV-RAM.

11

2.2 FEATURES OF AT89S52:                 

8K Bytes of Re-programmable Flash Memory. RAM is 256 bytes. 4.0V to 5.5V Operating Range. Fully Static Operation: 0 Hz to 33 MHz’s Three-level Program Memory Lock. 256 x 8-bit Internal RAM. 32 Programmable I/O Lines. Three 16-bit Timer/Counters. Eight Interrupt Sources. Full Duplex UART Serial Channel. Low-power Idle and Power-down Modes. Interrupt recovery from power down mode. Watchdog timer. Dual data pointer. Power-off flag. Fast programming time. Flexible ISP programming (byte and page mode).

2.3 DESCRIPTION OF MICROCONTROLLER: The AT89s52 is a low-voltage, high-performance CMOS 8-bit microcomputer with 8K bytes of Flash programmable memory. The device is manufactured using Atmel’s high density nonvolatile memory technology and is compatible with the industrystandard MCS-51 instruction set. The on chip flash allows the program memory to be reprogrammed in system or by a conventional non volatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89s52 is a powerful microcomputer, which provides a highly flexible and cost-effective solution to many embedded control applications. In addition, the AT89s52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The power-down mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.

12

Fig: Pin diagram

13

Fig: Block diagram

14

2.3 PIN DESCRIPTION: Vcc Pin 40 provides supply voltage to the chip. The voltage source is +5V. GND Pin 20 is the ground. PORT 0: Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory. In this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming and outputs the code bytes during Program verification. External pull-ups are required during program verification.

PORT 1: Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pullups. In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the following table. Port 1 also receives the low-order address bytes during Flash programming and verification.

15

PORT 2: Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pullups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. The port also receives the high-order address bits and some control signals during Flash programming and verification.

PORT 3: Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 receives some control signals for Flash programming and verification. Port 3 also serves the functions of various special features of the AT89S52, as shown in the following table.

16

RST: Reset input A high on this pin for two machine cycles while the oscillator is running resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is enabled.

ALE / PROG: Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external data memory.

PSEN: Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.

EA/VPP: External Access Enable EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming.

XTAL1: Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2: Output from the inverting oscillator amplifier.

17

Oscillator Connections:

C1, C2 = 30 pF ± 10 pF for Crystals = 40 pF ± 10 pF for Ceramic Resonators

External Clock Drive Configuration:

XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that can be configured for use as an on-chip oscillator. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven. There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed.

2.4 Special Function Registers: A map of the on-chip memory area called the Special Function Register (SFR) space is shown in the following table. It should be noted that not all of the addresses are occupied and unoccupied addresses may not be implemented on the chip. Read accesses to these addresses will in general return random data, and write accesses will have an indeterminate effect.

18

User software should not write 1s to these unlisted locations, since they may be used in future products to invoke new features. In that case, the reset or inactive values of the new bits will always be 0.

19

Power Off Flag: The Power Off Flag (POF) is located at bit 4 (PCON.4) in the PCON SFR. POF is set to “1” during power up. It can be set and rest under software control and is not affected by reset. Memory Organization: MCS-51 devices have a separate address space for Program and Data Memory. Up to 64K bytes each of external Program and Data Memory can be addressed. Program Memory: If the EA pin is connected to GND, all program fetches are directed to external memory. On the AT89S52, if EA is connected to VCC, program fetches to addresses 0000H through 1FFFH are directed to internal memory and fetches to addresses 2000H through FFFFH are to external memory. DATA MEMORY: The AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes occupy a parallel address space to the Special Function Registers. This means that the upper 128 bytes have the same addresses as the SFR space but are physically separate from SFR space. When an instruction accesses an internal location above address 7FH, the address mode used in the instruction specifies whether the CPU accesses the upper 128 bytes of RAM or the SFR space. Instructions which use direct addressing access the SFR space. For example, the following direct addressing instruction accesses the SFR at location 0A0H (which is P2). MOV 0A0H, #data The instructions that use indirect addressing access the upper 128 bytes of RAM. For example, the following indirect addressing instruction, where R0 contains 0A0H, accesses the data byte at address 0A0H, rather than P2 (whose address is 0A0H). MOV @R0, #data It should be noted that stack operations are examples of indirect addressing, so the upper 128 bytes of data RAM are available as stack space.

20

UART: The Atmel 8051 Microcontrollers implement three general purpose, 16-bit timers/ counters. They are identified as Timer 0, Timer 1 and Timer 2 and can be independently configured to operate in a variety of modes as a timer or as an event counter. When operating as a timer, the timer/counter runs for a programmed length of time and then issues an interrupt request. When operating as a counter, the timer/counter counts negative transitions on an external pin. After a preset number of counts, the counter issues an interrupt request.The various operating modes of each timer/counter are described in the following sections. A basic operation consists of timer registers THx and TLx (x= 0, 1) connected in cascade to form a 16-bit timer. Setting the run control bit (TRx) in TCON register turns the timer on by allowing the selected input to increment TLx. WhenTLx overflows it increments THx; when THx overflows it sets the timer overflow flag(TFx) in TCON register. Setting the TRx does not clear the THx and TLx timer registers.Timer registers can be accessed to obtain the current count or to enter preset values.They can be read at any time but TRx bit must be cleared to preset their values, otherwisethe behavior of the timer/counter is unpredictable. The C/T control bit (in TCON register) selects timer operation or counter operation, by selecting the divided-down peripheral clock or external pin Tx as the source for the counted signal. TRx bit must be cleared when changing the mode of operation, otherwise the behavior of the timer/counter is unpredictable. For timer operation (C/Tx# = 0), the timer register counts the divided-down peripheral clock. The timer register is incremented once every peripheral cycle (6 peripheral clock periods). The timer clock rate is FPER / 6, i.e. FOSC / 12 in standard mode or FOSC / 6 inX2 mode For counter operation (C/Tx# = 1), the timer register counts the negative transitions on the Tx external input pin. The external input is sampled every peripheral cycle. When the sample is high in one cycle and low in the next one, the counter is incremented. Since it takes 2 cycles (12 peripheral clock periods) to recognize a negative transition, the maximum count rate is FPER / 12, i.e. FOSC / 24 in standard mode or FOSC / 12 in X2mode. There are no restrictions on the duty cycle of the external input signal, but to ensure that a given level is sampled at least once before it changes, it should be held forat least one full peripheral cycle. In addition to the “timer” or “counter” selection, Timer 0 and Timer 1 have four operating modes from which to select which are selected by bit-pairs (M1, M0) in TMOD. Modes 0, 1and 2 are the same for both timer/counters. Mode 3 is different. The four operating modes are described below. Timer 2, has three modes of operation: ‘capture’, ‘auto-reload’ and ‘baud rate generator’.

21

Timer 0 Timer 0 functions as either a timer or event counter in four modes of operation. Timer 0 is controlled by the four lower bits of the TMOD register and bits0, 1, 4 and 5 of the TCON register. TMOD register selects the method of timer gating (GATE0), timer or counter operation (T/C0#) and mode of operation (M10and M00). The TCON register provides timer 0 control functions: overflow flag (TF0), run control bit (TR0), interrupt flag (IE0) and interrupt type control bit (IT0). For normal timer operation (GATE0= 0), setting TR0 allows TL0 to be incremented by the selected input. Setting GATE0 and TR0 allows external pin INT0# to control timer operation. Timer 0 overflow(count rolls over from all 1s to all 0s) sets TF0 flag, generating an interrupt request. It is important to stop timer/counter before changing mode. Mode 0 (13-bitTimer): Mode 0 configures timer 0 as a 13-bit timer which is set up as an 8-bit timer (TH0 register)with a modulo-32 prescaler implemented with the lower five bits of the TL0 register. The upper three bits of TL0 register are indeterminate and should beignored. Prescaler overflow increments the TH0 register. As the count rolls over from all 1’s to all 0’s, it sets the timer interrupt flag TF0. Thecounted input is enabled to the Timer when TR0 = 1 and either GATE = 0 or INT0 = 1.(Setting GATE = 1 allows the Timer to be controlled by external input INT0, to facilitate pulsewidth measurements). TR0 is a control bit in the Special Function register TCON. GATE is in TMOD. The 13-bit register consists of all 8 bits of TH0 and the lower 5 bits of TL0. The upper 3bits of TL0 are indeterminate and should be ignored. Setting the run flag (TR0) does not clear the registers. Mode 0 operation is the same for Timer 0 as for Timer 1. There are two different GATE bits, one forTimer 1 (TMOD.7) and one for Timer 0 (TMOD.3). Timer/Counter x (x = 0 or 1) in Mode 0

22

Mode 1 (16-bitTimer) Mode 1 is the same as Mode 0, except that the Timer register is being run with all 16bits.Mode 1 configures timer 0 as a 16-bit timer with the TH0 and TL0 registers connected incascade. The selected input increments the TL0 register. Timer/Counter x (x = 0 or 1) in Mode 1

Mode 2 (8-bit Timerwith Auto-Reload) Mode 2 configures timer 0 as an 8-bit timer (TL0 register) that automatically reloadsfrom the TH0 register. TL0 overflow sets TF0 flag in theTCON register and reloads TL0 with the contents of TH0, which is preset by software. When the interrupt request is serviced, hardware clears TF0. The reload leaves TH0unchanged. The next reload value may be changed at any time by writing it to the TH0register.Mode 2 operation is the same for Timer/Counter 1. Timer/Counter x (x = 0 or 1) in Mode 2

Mode 3 (Two 8-bitTimers) Mode 3 configures timer 0 so that registers TL0 and TH0 operate as separate 8bit timers. This mode is provided for applications requiring an additional 8-bittimer or counter. TL0 uses the timer 0 control bits C/T0# and GATE0 in the TMOD register,and TR0 and TF0 in the TCON register in the normal manner. TH0 is locked into atimer function (counting FPER /6) and takes over use of the timer 1 interrupt (TF1) andrun control (TR1) bits. Thus, operation of timer 1 is restricted when timer 0 is in mode 3.

23

Timer/Counter 0 in Mode 3: Two 8-bit Counters

Timer 1: Timer 1 is identical to timer 0, except for mode 3, which is a hold-count mode. The followingcomments help to understand the differences:  • Timer 1 functions as either a timer or event counter in three modes of operation. Timer1’s mode 3 is a hold-count mode.  • Timer 1 is controlled by the four high-order bits of the TMOD register and bits 2, 3, 6 and 7 of the TCON register. The TMOD register selects the method of timer gating (GATE1), timer or counteroperation (C/T1#) and mode of operation (M11 and M01). The TCON registerprovides timer 1 control functions: overflow flag (TF1), run control bit (TR1), interruptflag (IE1) and interrupt type control bit (IT1).  • Timer 1 can serve as the baud rate generator for the serial port. Mode 2 is bestsuited for this purpose.  • For normal timer operation (GATE1 = 0), setting TR1 allows TL1 to be incrementedby the selected input. Setting GATE1 and TR1 allows external pin INT1# to controltimer operation.  • Timer 1 overflow (count rolls over from all 1s to all 0s) sets the TF1 flag generatingan interrupt request.  • When timer 0 is in mode 3, it uses timer 1’s overflow flag (TF1) and run control bit(TR1). For this situation, use timer 1 only for applications that do not require an interrupt (such as a baud rate generator for the serial port) and switch timer 1 in andout of mode 3 to turn it off and on.  • It is important to stop timer/counter before changing modes.

24

Mode 0 (13-bitTimer) Mode 0 configures Timer 1 as a 13-bit timer, which is set up as an 8-bit timer (TH1 register)with a modulo-32 prescaler implemented with the lower 5 bits of the TL1 register. The upper 3 bits of the TL1 register are ignored. Prescaler overflowincrements the TH1 register. Mode 1 (16-bitTimer) Mode 1 configures Timer 1 as a 16-bit timer with the TH1 and TL1 registers connected in cascade. The selected input increments the TL1 register. Mode 2 (8-bit Timer with Auto Reload) Mode 2 configures Timer 1 as an 8-bit timer (TL1 register) with automatic reload from the TH1 register on overflow. TL1 overflow sets the TF1 flag in the TCON register and reloads TL1 with the contents of TH1, which is preset by software. The reload leaves TH1 unchanged. Mode 3 (Halt) Placing Timer 1 in mode 3 causes it to halt and hold its count. This can be used to halt Timer 1 when TR1 run control bit is not available i.e., when Timer 0 is in mode 3. Timer 2 Timer 2 is a 16-bit Timer/Counter that can operate as either a timer or an event counter. The type of operation is selected by bit C/T2 in the SFR T2CON. Timer 2 has three operating modes: capture, auto-reload (up or down counting), and baud rate generator. The modes are selected by bits in T2CON. Timer 2 consists of two 8-bit registers, TH2 and TL2. In the Timer function, the TL2 register is incremented every machine cycle. Since a machine cycle consists of 12 oscillator periods, the count rate is 1/12 of the oscillator frequency.

25

In the Counter function, the register is incremented in response to a 1-to-0 transition at its corresponding external input pin, T2. In this function, the external input is sampled during S5P2 of every machine cycle. When the samples show a high in one cycle and a low in the next cycle, the count is incremented. The new count value appears in the register during S3P1 of the cycle following the one in which the transition was detected. Since two machine cycles (24 oscillator periods) are required to recognize a 1-to-0 transition, the maximum count rate is 1/24 of the oscillator frequency. To ensure that a given level is sampled at least once before it changes, the level should be held for at least one full machine cycle. CAPTURE MODE: In the capture mode, two options are selected by bit EXEN2 in T2CON. If EXEN2 = 0, Timer 2 is a 16-bit timer or counter which upon overflow sets bit TF2 in T2CON. This bit can then be used to generate an interrupt. If EXEN2 = 1, Timer 2 performs the same operation, but a 1-to-0 transition at external input T2EX also causes the current value in TH2 and TL2 to be captured into RCAP2H and RCAP2L, respectively. In addition, the transition at T2EX causes bit EXF2 in T2CON to be set. The EXF2 bit, like TF2, can generate an interrupt.

Timer in Capture Mode Auto-reload (Up or Down Counter) Timer 2 can be programmed to count up or down when configured in its 16-bit auto-reload mode. This feature is invoked by the DCEN (Down Counter Enable) bit located in the SFR T2MOD. Upon reset, the DCEN bit is set to 0 so that timer 2 will default to count up. When DCEN is set, Timer 2 can count up or down, depending on the value of the T2EX pin. 26

T2MOD – Timer 2 Mode Control Register The above figure shows Timer 2 automatically counting up when DCEN = 0. In this mode, two options are selected by bit EXEN2 in T2CON. If EXEN2 = 0, Timer 2 counts up to 0FFFFH and then sets the TF2 bit upon overflow. The overflow also causes the timer registers to be reloaded with the 16-bit value in RCAP2H and RCAP2L. The values in Timer in Capture ModeRCAP2H and RCAP2L are preset by software. If EXEN2 = 1, a 16-bit reload can be triggered either by an overflow or by a 1to-0 transition at external input T2EX. This transition also sets the EXF2 bit. Both the TF2 and EXF2 bits can generate an interrupt if enabled. Setting the DCEN bit enables Timer 2 to count up or down, as shown in Figure 10-2. In this mode, the T2EX pin controls the direction of the count. A logic 1 at T2EX makes Timer 2 count up. The timer will overflow at 0FFFFH and set the TF2 bit. This overflow also causes the 16-bit value in RCAP2H and RCAP2L to be reloaded into the timer registers, TH2 and TL2, respectively. A logic 0 at T2EX makes Timer 2 count down. The timer underflows when TH2 and TL2 equal the values stored in RCAP2H and RCAP2L. The underflow sets the TF2 bit and causes 0FFFFH to be reloaded into the timer registers. The EXF2 bit toggles whenever Timer 2 overflows or underflows and can be used as a 17th bit of resolution. In this operating mode, EXF2 does not flag an interrupt.

27

Baud Rate Generator: Timer 2 is selected as the baud rate generator by setting TCLK and/or RCLK in T2CON. Note that the baud rates for transmit and receive can be different if Timer 2 is used for the receiver or transmitter and Timer 1 is used for the other function. Setting RCLK and/or TCLK puts Timer 2 into its baud rate generator mode. The baud rate generator mode is similar to the auto-reload mode, in that a rollover in TH2 causes the Timer 2 registers to be reloaded with the 16-bit value in registers RCAP2H and RCAP2L, which are preset by software. The baud rates in Modes 1 and 3 are determined by Timer 2’s overflow rate according to the following equation. 28

The Timer can be configured for either timer or counter operation. In most applications, it is configured for timer operation (CP/T2 = 0). The timer operation is different for Timer 2 when it is used as a baud rate generator. Normally, as a timer, it increments every machine cycle (at 1/12 the oscillator frequency). As a baud rate generator, however, it increments every state time (at 1/2 the oscillator frequency). The baud rate formula is given below.

Where (RCAP2H, RCAP2L) is the content of RCAP2H and RCAP2L taken as a 16-bit unsigned integer. Timer 2 as a baud rate generator is shown in the below figure. This figure is valid only if RCLK or TCLK = 1 in T2CON. Note that a rollover in TH2 does not set TF2 and will not generate an interrupt. Note too, that if EXEN2 is set, a 1-to-0 transition in T2EX will set EXF2 but will not cause a reload from (RCAP2H, RCAP2L) to (TH2, TL2). Thus, when Timer 2 is in use as a baud rate generator, T2EX can be used as an extra external interrupt. It should be noted that when Timer 2 is running (TR2 = 1) as a timer in the baud rate generator mode, TH2 or TL2 should not be read from or written to. Under these conditions, the Timer is incremented every state time, and the results of a read or write may not be accurate. The RCAP2 registers may be read but should not be written to, because a write might overlap a reload and cause write and/or reload errors. The timer should be turned off (clear TR2) before accessing the Timer 2 or RCAP2 registers.

29

Timer 2 in Baud Rate Generator Mode

PROGRAMMABLE CLOCK OUT: A 50% duty cycle clock can be programmed to come out on P1.0, as shown in the below figure. This pin, besides being a regular I/O pin, has two alternate functions. It can be programmed to input the external clock for Timer/Counter 2 or to output a 50% duty cycle clock ranging from 61 Hz to 4 MHz (for a 16-MHz operating frequency).

Timer 2 in Clock-Out Mode 30

To configure the Timer/Counter 2 as a clock generator, bit C/T2 (T2CON.1) must be cleared and bit T2OE (T2MOD.1) must be set. Bit TR2 (T2CON.2) starts and stops the timer. The clock-out frequency depends on the oscillator frequency and the reload value of Timer 2 capture registers (RCAP2H, RCAP2L), as shown in the following equation.

In the clock-out mode, Timer 2 roll-overs will not generate an interrupt. This behavior is similar to when Timer 2 is used as a baud-rate generator. It is possible to use Timer 2 as a baud-rate generator and a clock generator simultaneously. INTERUPTS The AT89S52 has a total of six interrupt vectors: two external interrupts (INT0 and INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt. These interrupts are all shown in the below figure. Each of these interrupt sources can be individually enabled or disabled by setting or clearing a bit in Special Function Register IE. IE also contains a global disable bit, EA, which disables all interrupts at once. The below table shows that bit position IE.6 is unimplemented. User software should not write a 1 to this bit position, since it may be used in future AT89 products. Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register T2CON. Neither of these flags is cleared by hardware when the service routine is vectored to. In fact, the service routine may have to determine whether it was TF2 or EXF2 that generated the interrupt, and that bit will have to be cleared in software. The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which the timers overflow. The values are then polled by the circuitry in the next cycle. However, the Timer 2 flag, TF2, is set at S2P2 and is polled in the same cycle in which the timer overflows.

31

Program Memory Lock Bits The AT89S52 has three lock bits that can be left unprogrammed (U) or can be programmed (P) to obtain the additional features listed in the table.

Lock Bit Protection Modes When lock bit 1 is programmed, the logic level at the EA pin is sampled and latched during reset. If the device is powered up without a reset, the latch initializes to a random value and holds that value until reset is activated. The latched value of EA must agree with the current logic level at that pin in order for the device to function properly.

PROGRAMMING THE FLASH – PARALLEL MODE: The AT89S52 is shipped with the on-chip Flash memory array ready to be programmed. The programming interface needs a high-voltage (12-volt) program enable signal and is compatible with conventional third-party Flash or EPROM programmers. The AT89S52 code memory array is programmed byte-by-byte. Programming Algorithm: Before programming the AT89S52, the address, data, and control signals should be set up according to the “Flash Programming Modes”. To program the AT89S52, take the following steps: 1. Input the desired memory location on the address lines. 2. Input the appropriate data byte on the data lines. 3. Activate the correct combination of control signals. 4. Raise EA/VPP to 12V. 5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The byte write cycle is self-timed and typically takes no more than 50 µs. Repeat steps 1 through 32

5, changing the address and data for the entire array or until the end of the object file is reached.

PROGRAMMING INTERFACE – PARALLEL MODE Every code byte in the Flash array can be programmed by using the appropriate combination of control signals. The write operation cycle is self-timed and once initiated, will automatically time itself to completion.

Flash Programming Modes For Page Read/Write, the data always starts from byte 0 to 255. After the command byte and upper address byte are latched, each byte thereafter is treated as data until all 256 bytes are shifted in/out. Then the next instruction will be ready to be decoded.

33

After Reset signal is high, SCK should be low for at least 64 system clocks before it goes high to clock in the enable data bytes. No pulsing of Reset signal is necessary. SCK should be no faster than 1/16 of the system clock at XTAL1 34

CHAPTER 3 GSM technology 3.6.1 Introduction to the GSM Standard The GSM (Global System for Mobile communications) network is at the start of the st 21 century, the most commonly used mobile telephony standard in Europe. It is called as Second Generation (2G) standard because communications occur in an entirely digital mode, unlike the first generation of portable telephones. When it was first standardized in 1982, it was called as Group Special Mobile and later, it became an international standard called "Global System for Mobile communications" in 1991. In Europe, the GSM standard uses the 900 MHz and 1800 MHz frequency bands. In the United States, however, the frequency band used is the 1900 MHz band. For this reason, portable telephones that are able to operate in both Europe and the United States are called tri-band while those that operate only in Europe are called bi-band. The GSM standard allows a maximum throughput of 9.6 kbps which allows transmission of voice and low-volume digital data like text messages (SMS, for Short Message Service) or multimedia messages (MMS, for Multimedia Message Service). GSM Standards: GSM uses narrowband TDMA, which allows eight simultaneous calls on the same radio frequency. There are three basic principles in multiple access, FDMA (Frequency Division Multiple Access), TDMA (Time Division Multiple Access), and CDMA (Code Division Multiple Access). All three principles allow multiple users to share the same physical channel. But the two competing technologies differ in the way user sharing the common resource. TDMA allows the users to share the same frequency channel by dividing the signal into different time slots. Each user takes turn in a round robin fashion for transmitting and receiving over the channel. Here, users can only transmit in their respective time slot. CDMA uses a spread spectrum technology that is it spreads the information contained in a particular signal of interest over a much greater bandwidth than the original signal. Unlike TDMA, in CDMA several users can transmit over the channel at the same time. Definition of GSM: GSM (Global System for Mobile communications) is an open, digital cellular technology used for transmitting mobile voice and data services. GSM (Global System for Mobile communication) is a digital mobile telephone system that is widely used in 35

Europe and other parts of the world. GSM uses a variation of Time Division Multiple Access (TDMA) and is the most widely used of the three digital wireless telephone technologies (TDMA, GSM, and CDMA). GSM digitizes and compresses data, then sends it down a channel with two other streams of user data, each in its own time slot. It operates at either the 900 MHz or 1,800 MHz frequency band. It supports voice calls and data transfer speeds of up to 9.6 kbit/s, together with the transmission of SMS (Short Message Service).

History In 1982, the European Conference of Postal and Telecommunications Administrations (ECPT) created the Group Special Mobile (GSM) to develop a standard for a mobile telephone system that could be used across Europe. In 1987, a memorandum of understanding was signed by 13 countries to develop a common cellular telephone system across Europe. Finally the system created by SINTEF lead by Torleiv Maseng was selected. In 1989, GSM responsibility was transferred to the European Telecommunications Standards Institute (ETSI) and phase I of the GSM specifications were published in 1990. The first GSM network was launched in 1991 by Radiolinja in Finland with joint technical infrastructure maintenance from Ericsson. By the end of 1993, over a million subscribers were using GSM phone networks being operated by 70 carriers across 48 countries. As of the end of 1997, GSM service was available in more than 100 countries and has become the de facto standard in Europe and Asia.

GSM Frequencies GSM networks operate in a number of different frequency ranges (separated into GSM frequency ranges for 2G and UMTS frequency bands for 3G). Most 2G GSM networks operate in the 900 MHz or 1800 MHz bands. Some countries in the Americas (including Canada and the United States) use the 850 MHz and 1900 MHz bands because the 900 and 1800 MHz frequency bands were already allocated. Most 3G GSM networks in Europe operate in the 2100 MHz frequency band. The rarer 400 and 450 MHz frequency bands are assigned in some countries where these frequencies were previously used for first-generation systems. GSM-900 uses 890–915 MHz to send information from the mobile station to the base station (uplink) and 935–960 MHz for the other direction (downlink), providing 124 RF channels (channel numbers 1 to 124) spaced at 200 kHz. Duplex spacing of 45 MHz is used. In some countries the GSM-900 band has been extended to cover a larger frequency range. This 'extended GSM', E-GSM, uses 880–915 MHz (uplink) and 925– 960 MHz (downlink), adding 50 channels (channel numbers 975 to 1023 and 0) to the original GSM-900 band. 36

Time division multiplexing is used to allow eight full-rate or sixteen half-rate speech channels per radio frequency channel. There are eight radio timeslots (giving eight burst periods) grouped into what is called a TDMA frame. Half rate channels use alternate frames in the same timeslot. The channel data rate for all 8 channels is 270.833 Kbit/s, and the frame duration is 4.615 ms. The transmission power in the handset is limited to a maximum of 2 watts in GSM850/900 and 1 watt in GSM1800/1900. GSM operates in the 900MHz and 1.8GHz bands in Europe and the 1.9GHz and 850MHz bands in the US. The 850MHz band is also used for GSM and 3G in Australia, Canada and many South American countries. By having harmonized spectrum across most of the globe, GSM’s international roaming capability allows users to access the same services when travelling abroad as at home. This gives consumers seamless and same number connectivity in more than 218 countries. Terrestrial GSM networks now cover more than 80% of the world’s population. GSM satellite roaming has also extended service access to areas where terrestrial coverage is not available.

Mobile Telephony Standards Standard Generation GSM GPRS EDGE UMTS

Frequency band

Throughput

2G

Allows transfer of voice or lowvolume digital data.

9.6 kbps

9.6 kbps

2.5G

Allows transfer of voice or moderate-volume digital data.

21.4-171.2 kbps

48 kbps

2.75G

Allows simultaneous transfer of voice and digital data.

43.2-345.6 kbps

171 kbps

3G

Allows simultaneous transfer of voice and high-speed digital data.

384 0.144-2 Mbps kbps

3.6.2 1G: The first generation of mobile telephony (written 1G) operated using analogue communications and portable devices that were relatively large. It used primarily the following standards:  AMPS (Advanced Mobile Phone System), which appeared in 1976 in the United States, was the first cellular network standard. It was used primarily in the Americas, Russia and Asia. This first-generation analogue network had weak security mechanisms which allowed hacking of telephones lines. 37



TACS (Total Access Communication System) is the European version of the AMPS model. Using the 900 MHz frequency band, this system was largely used in England and then in Asia (Hong-Kong and Japan).  ETACS (Extended Total Access Communication System) is an improved version of the TACS standard developed in the United Kingdom that uses a larger number of communication channels. The first-generation cellular networks were made obsolete by the appearance of an entirely digital second generation.

3.6.3 Second Generation of Mobile Networks (2G): The second generation of mobile networks marked a break with the first generation of cellular telephones by switching from analogue to digital. The main 2G mobile telephony standards are:  GSM (Global System for Mobile communications) is the most commonly used standard in Europe at the end of the 20th century and supported in the United States. This standard uses the 900 MHz and 1800 MHz frequency bands in Europe. In the United States, however, the frequency band used is the 1900 MHz band. Portable telephones that are able to operate in Europe and the United States are therefore called tri-band.  CDMA (Code Division Multiple Access) uses a spread spectrum technique that allows a radio signal to be broadcast over a large frequency range.  TDMA (Time Division Multiple Access) uses a technique of time division of communication channels to increase the volume of data transmitted simultaneously. TDMA technology is primarily used on the American continent, in New Zealand and in the Asia-Pacific region. With the 2G networks, it is possible to transmit voice and low volume digital data, for example text messages (SMS, for Short Message Service) or multimedia messages (MMS, for Multimedia Message Service). The GSM standard allows a maximum data rate of 9.6 kbps. Extensions have been made to the GSM standard to improve throughput. One of these is the GPRS (General Packet Radio System) service which allows theoretical data rates on the order of 114 Kbit/s but with throughput closer to 40 Kbit/s in practice. As this technology does not fit within the "3G" category, it is often referred to as 2.5G The EDGE (Enhanced Data Rates for Global Evolution) standard, billed as 2.75G, quadruples the throughput improvements of GPRS with its theoretical data rate of 384 Kbps, thereby allowing the access for multimedia applications. In reality, the EDGE standard allows maximum theoretical data rates of 473 Kbit/s, but it has been limited in order to comply with the IMT-2000(International Mobile Telecommunications-2000) specifications from the ITU (International Telecommunications Union).

38

3.6.4 3G: .The IMT-2000 (International Mobile Telecommunications for the year 2000) specifications from the International Telecommunications Union (ITU) defined the characteristics of 3G (third generation of mobile telephony). The most important of these characteristics are: 1. High transmission data rate. 2. 144 Kbps with total coverage for mobile use. 3. 384 Kbps with medium coverage for pedestrian use. 4. 2 Mbps with reduced coverage area for stationary use. 5. World compatibility. 6. Compatibility of 3rd generation mobile services with second generation networks. 7. 3G offers data rates of more than 144 Kbit/s, thereby allowing the access to multimedia uses such as video transmission, video-conferencing or high-speed internet access. 3G networks use different frequency bands than the previous networks: 1885-2025 MHz and 2110-2200 MHz. 8. The main 3G standard used in Europe is called UMTS (Universal Mobile Telecommunications System) and uses WCDMA (Wideband Code Division Multiple Access) encoding. UMTS technology uses 5 MHz bands for transferring voice and data, with data rates that can range from 384 Kbps to 2 Mbps. HSDPA (High Speed Downlink Packet Access) is a third generation mobile telephony protocol, (considered as "3.5G"), which is able to reach data rates on the order of 8 to 10 Mbps. HSDPA technology uses the 5 GHz frequency band and uses WCDMA encoding. The concept of cellular network Mobile telephone networks are based on the concept of cells, circular zones that overlap to cover a geographical area.

Cellular networks are based on the use of a central transmitter-receiver in each cell, called a "base station" (or Base Transceiver Station, written BTS). The smaller the radius of a cell, the higher is the available bandwidth. So, in highly populated urban 39

areas, there are cells with a radius of a few hundred meters, while huge cells of up to 30 kilometers provide coverage in rural areas. In a cellular network, each cell is surrounded by 6 neighbouring cells (thus a cell is generally drawn as a hexagon). To avoid interference, adjacent cells cannot use the same frequency. In practice, two cells using the same frequency range must be separated by a distance of two to three times the diameter of the cell.

3.6.5 Architecture of the GSM Network In a GSM network, the user terminal is called a mobile station. A mobile station is made up of a SIM (Subscriber Identity Module) card allowing the user to be uniquely identified and a mobile terminal. The terminals (devices) are identified by a unique 15digit identification number called IMEI (International Mobile Equipment Identity). Each SIM card also has a unique (and secret) identification number called IMSI (International Mobile Subscriber Identity). This code can be protected using a 4-digit key called a PIN code. The SIM card therefore allows each user to be identified independently of the terminal used during communication with a base station. Communications occur through a radio link (air interface) between a mobile station and a base station.

All the base stations of a cellular network are connected to a base station controller (BSC) which is responsible for managing distribution of the resources. The

40

system consisting of the base station controller and its connected base stations is called the Base Station Subsystem (BSS). Finally, the base station controllers are themselves physically connected to the Mobile Switching Centre (MSC), managed by the telephone network operator, which connects them to the public telephone network and the Internet. The MSC belongs to a Network Station Subsystem (NSS), which is responsible for managing user identities, their location and establishment of communications with other subscribers. The MSC is generally connected to databases that provide additional functions: 1. The Home Location Register (HLR) is a database containing information (geographic position, administrative information etc.) of the subscribers registered in the area of the switch (MSC). 2. The Visitor Location Register (VLR) is a database containing information of users other than the local subscribers. The VLR retrieves the data of a new user from the HLR of the user's subscriber zone. The data is maintained as long as the user is in the zone and is deleted when the user leaves or after a long period of inactivity (terminal off). 3. The Equipment Identify Register (EIR) is a database listing the mobile terminals. 4. The Authentication Centre (AUC) is responsible for verifying user identities. 5. The cellular network formed in this way is designed to support mobility via management of handovers (movements from one cell to another). Finally, GSM networks support the concept of roaming i.e., movement from one operator network to another.

41

A GSM modem can be an external device or a PC Card / PCMCIA Card. Typically, an external GSM modem is connected to a computer through a serial cable or a USB cable. A GSM modem in the form of a PC Card / PCMCIA Card is designed for use with a laptop computer. It should be inserted into one of the PC Card / PCMCIA Card slots of a laptop computer. Like a GSM mobile phone, a GSM modem requires a SIM card from a wireless carrier in order to operate. A SIM card contains the following information: 

Subscriber telephone number (MSISDN)



International subscriber number (IMSI, International Mobile Subscriber Identity)



State of the SIM card



Service code (operator)



Authentication key



PIN (Personal Identification Code)



PUK (Personal Unlock Code)

Computers use AT commands to control modems. Both GSM modems and dialup modems support a common set of standard AT commands. In addition to the standard AT commands, GSM modems support an extended set of AT commands. These extended AT commands are defined in the GSM standards. With the extended AT commands, the following operations can be performed:  Reading, writing and deleting SMS messages.  Sending SMS messages.  Monitoring the signal strength.  Monitoring the charging status and charge level of the battery.  Reading, writing and searching phone book entries.

42

The number of SMS messages that can be processed by a GSM modem per minute is very low i.e., about 6 to 10 SMS messages per minute. 3.6.6 Introduction to AT Commands: AT commands are instructions used to control a modem. AT is the abbreviation of ATtention. Every command line starts with "AT" or "at". That's the reason, modem commands are called AT commands. Many of the commands that are used to control wired dial-up modems, such as ATD (Dial), ATA (Answer), ATH (Hook control) and ATO (Return to online data state) are also supported by GSM modems and mobile phones. Besides this common AT command set, GSM modems and mobile phones support an AT command set that is specific to the GSM technology, which includes SMS-related commands like AT+CMGS (Send SMS message), AT+CMSS (Send SMS message from storage), AT+CMGL (List SMS messages) and AT+CMGR (Read SMS messages). It should be noted that the starting "AT" is the prefix that informs the modem about the start of a command line. It is not part of the AT command name. For example, D is the actual AT command name in ATD and +CMGS is the actual AT command name in AT+CMGS. Some of the tasks that can be done using AT commands with a GSM modem or mobile phone are listed below:

43

 Get basic information about the mobile phone or GSM modem. For example, name of manufacturer (AT+CGMI), model number (AT+CGMM), IMEI number (International Mobile Equipment Identity) (AT+CGSN) and software version (AT+CGMR).  Get basic information about the subscriber. For example, MSISDN (AT+CNUM) and IMSI number (International Mobile Subscriber Identity) (AT+CIMI).  Get the current status of the mobile phone or GSM/GPRS modem. For example, mobile phone activity status (AT+CPAS), mobile network registration status (AT+CREG), radio signal strength (AT+CSQ), battery charge level and battery charging status (AT+CBC).  Establish a data connection or voice connection to a remote modem (ATD, ATA, etc).  Send and receive fax (ATD, ATA, AT+F*).  Send (AT+CMGS, AT+CMSS), read (AT+CMGR, AT+CMGL), write (AT+CMGW) or delete (AT+CMGD) SMS messages and obtain notifications of newly received SMS messages (AT+CNMI).  Read (AT+CPBR), write (AT+CPBW) or search (AT+CPBF) phonebook entries.  Perform security-related tasks, such as opening or closing facility locks (AT+CLCK), checking whether a facility is locked (AT+CLCK) and changing passwords(AT+CPWD). (Facility lock examples: SIM lock [a password must be given to the SIM card every time the mobile phone is switched on] and PH-SIM lock [a certain SIM card is associated with the mobile phone. To use other SIM cards with the mobile phone, a password must be entered.])  Control the presentation of result codes / error messages of AT commands. For example, the user can control whether to enable certain error messages (AT+CMEE) and whether error messages should be displayed in numeric format or verbose format (AT+CMEE=1 or AT+CMEE=2).  Get or change the configurations of the mobile phone or GSM/GPRS modem. For example, change the GSM network (AT+COPS), bearer service type (AT+CBST), radio link protocol parameters (AT+CRLP), SMS center address (AT+CSCA) and storage of SMS messages (AT+CPMS).  Save and restore configurations of the mobile phone or GSM/GPRS modem. For example, save (AT+CSAS) and restore (AT+CRES) settings related to SMS messaging such as the SMS center address. It should be noted that the mobile phone manufacturers usually do not implement all AT commands, command parameters and parameter values in their mobile phones. Also, the behavior of the implemented AT commands may be different from that defined in the standard. In general, GSM modems, designed for wireless applications, have better support of AT commands than ordinary mobile phones. 44

3.6.7 Basic concepts of SMS technology: 1. Validity Period of an SMS Message An SMS message is stored temporarily in the SMS center if the recipient mobile phone is offline. It is possible to specify the period after which the SMS message will be deleted from the SMS center so that the SMS message will not be forwarded to the recipient mobile phone when it becomes online. This period is called the validity period. A mobile phone should have a menu option that can be used to set the validity period. After setting it, the mobile phone will include the validity period in the outbound SMS messages automatically. 2. Message Status Reports Sometimes the user may want to know whether an SMS message has reached the recipient mobile phone successfully. To get this information, you need to set a flag in the SMS message to notify the SMS center that a status report is required about the delivery of this SMS message. The status report is sent to the user mobile in the form of an SMS message. A mobile phone should have a menu option that can be used to set whether the status report feature is on or off. After setting it, the mobile phone will set the corresponding flag in the outbound SMS messages for you automatically. The status report feature is turned off by default on most mobile phones and GSM modems. 3. Message Submission Reports After leaving the mobile phone, an SMS message goes to the SMS center. When it reaches the SMS center, the SMS center will send back a message submission report to the mobile phone to inform whether there are any errors or failures (e.g. incorrect SMS message format, busy SMS center, etc). If there is no error or failure, the SMS center sends back a positive submission report to the mobile phone. Otherwise it sends back a negative submission report to the mobile phone. The mobile phone may then notify the user that the message submission was failed and what caused the failure. If the mobile phone does not receive the message submission report after a period of time, it concludes that the message submission report has been lost. The mobile phone may then send the SMS message again to the SMS center. A flag will be set in the new SMS message to inform the SMS center that this SMS message has been sent before. If the previous message submission was successful, the SMS center will ignore the new SMS message but send back a message submission report to the mobile phone. This mechanism prevents the sending of the same SMS message to the

45

recipient multiple times. Sometimes the message submission report mechanism is not used and the acknowledgement of message submission is done in a lower layer. 4. Message Delivery Reports After receiving an SMS message, the recipient mobile phone will send back a message delivery report to the SMS center to inform whether there are any errors or failures (example causes: unsupported SMS message format, not enough storage space, etc). This process is transparent to the mobile user. If there is no error or failure, the recipient mobile phone sends back a positive delivery report to the SMS center. Otherwise it sends back a negative delivery report to the SMS center. If the sender requested a status report earlier, the SMS center sends a status report to the sender when it receives the message delivery report from the recipient. If the SMS center does not receive the message delivery report after a period of time, it concludes that the message delivery report has been lost. The SMS center then ends the SMS message to the recipient for the second time. Sometimes the message delivery report mechanism is not used and the acknowledgement of message delivery is done in a lower layer.

46

Block Diagram

Power Supply (5V)

LCD

Micro Controller

GSM Modem

MAX 232

REL AY CKT

Relay1

Device

Relay2

Device

Relay3

Device

SOFTWARE TOOLS USED: 1) Keil compiler. 2) Express PCB/ORCAD HARDWARE TOOLS: 1) Micro controller 2) MAX 232 Serial Communication 3) Power Supply 5V. 4) GSM Module. 5) LCD. 6) Relays.

47

CHAPTER 4 HARDWARE MODULES 1 POWER SUPPLY: There are many types of power supply. Most are designed to convert high voltage AC mains electricity to a suitable low voltage supply for electronics circuits and other devices. A power supply can by broken down into a series of blocks, each of which performs a particular function. For example a 5V regulated supply:

Each of the blocks is described in more detail below:    

Transformer - steps down high voltage AC mains to low voltage AC. Rectifier - converts AC to DC, but the DC output is varying. Smoothing - smoothes the DC from varying greatly to a small ripple. Regulator - eliminates ripple by setting DC output to a fixed voltage.

Power supplies made from these blocks are described below with a circuit diagram and a graph of their output:    

Transformer only Transformer + Rectifier Transformer + Rectifier + Smoothing Transformer + Rectifier + Smoothing + Regulator

DUAL SUPPLIES: Some electronic circuits require a power supply with positive and negative outputs as well as zero volts (0V). This is called a 'dual supply' because it is like two ordinary supplies connected together as shown in the diagram. Dual supplies have three outputs, for example a ±9V supply has +9V, 0V and -9V outputs. 48

TRANSFORMER ONLY

The low voltage AC output is suitable for lamps, heaters and special AC motors. It is not suitable for electronic circuits unless they include a rectifier and a smoothing capacitor. Transformer + Rectifier

The varying DC output is suitable for lamps, heaters and standard motors. It is not suitable for electronic circuits unless they include a smoothing capacitor.

Transformer + Rectifier + Smoothing:

The smooth DC output has a small ripple. It is suitable for most electronic circuits. 49

TRANSFORMER + RECTIFIER + SMOOTHING + REGULATOR:

The Regulated DC output is very smooth with no ripple. It is suitable for all electronic circuits. TRANSFORMER: Transformers convert AC electricity from one voltage to another with little loss of power. Transformers work only with AC and this is one of the reasons why mains electricity is AC. Step-up transformers increase voltage, step-down transformers reduce voltage. Most power supplies use a step-down transformer to reduce the dangerously high mains voltage (230V in UK) to a safer low voltage. The input coil is called the primary and the output coil is called the secondary. There is no electrical connection between the two coils, instead they are linked by an alternating magnetic field created in the soft-iron core of the transformer. The two lines in the middle of the circuit symbol represent the core. Transformers waste very little power so the power out is (almost) equal to the power in. Note that as voltage is stepped down current is stepped up. The ratio of the number of turns on each coil, called the turns ratio, determines the ratio of the voltages. A step-down transformer has a large number of turns on its primary (input) coil which is connected to the high voltage mains supply, and a small number of turns on its secondary (output) coil to give a low output voltage.

turns ratio =

Vp Vs

=

Np Ns

and

power out = power in Vs × Is = Vp × Ip

50

4.2 RECTIFIER: There are several ways of connecting diodes to make a rectifier to convert AC to DC. The bridge rectifier is the most important and it produces full-wave varying DC. A full-wave rectifier can also be made from just two diodes if a centre-tap transformer is used, but this method is rarely used now that diodes are cheaper. A single diode can be used as a rectifier but it only uses the positive (+) parts of the AC wave to produce halfwave varying DC.

BRIDGE RECTIFIER: A bridge rectifier can be made using four individual diodes, but it is also available in special packages containing the four diodes required. It is called a full-wave rectifier because it uses all the AC wave (both positive and negative sections). 1.4V is used up in the bridge rectifier because each diode uses 0.7V when conducting and there are always two diodes conducting, as shown in the diagram below. Bridge rectifiers are rated by the maximum current they can pass and the maximum reverse voltage they can withstand (this must be at least three times the supply RMS voltage so the rectifier can withstand the peak voltages). Please see the Diodes page for more details, including pictures of bridge rectifiers.

51

Bridge rectifier

Output: full-wave varying DC (using all the AC wave)

SINGLE DIODE RECTIFIER: A single diode can be used as a rectifier but this produces half-wave varying DC which has gaps when the AC is negative. It is hard to smooth this sufficiently well to supply electronic circuits unless they require a very small current so the smoothing capacitor does not significantly discharge during the gaps. Please see the Diodes page for some examples of rectifier diodes.

Single diode rectifier

Output: half-wave varying DC (using only half the AC wave)

SMOOTHING: Smoothing is performed by a large value electrolytic capacitor connected across the DC supply to act as a reservoir, supplying current to the output when the varying DC voltage from the rectifier is falling. The diagram shows the unsmoothed varying DC (dotted line) and the smoothed DC (solid line). The capacitor charges quickly near the peak of the varying DC, and then discharges as it supplies current to the output.

52

Note that smoothing significantly increases the average DC voltage to almost the peak value (1.4 × RMS value). For example 6V RMS AC is rectified to full wave DC of about 4.6V RMS (1.4V is lost in the bridge rectifier), with smoothing this increases to almost the peak value giving 1.4 × 4.6 = 6.4V smooth DC. Smoothing is not perfect due to the capacitor voltage falling a little as it discharges, giving a small ripple voltage. For many circuits a ripple which is 10% of the supply voltage is satisfactory and the equation below gives the required value for the smoothing capacitor. A larger capacitor will give less ripple. The capacitor value must be doubled when smoothing half-wave DC.

Smoothing capacitor for 10% ripple, C =

5 × Io Vs × f

C = smoothing capacitance in farads (F) Io = output current from the supply in amps (A) Vs = supply voltage in volts (V), this is the peak value of the unsmoothed DC f = frequency of the AC supply in hertz (Hz), 50Hz in the UK

REGULATORS: Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or variable output voltages. They are also rated by the maximum current they can pass. Negative voltage regulators are available, mainly for use in dual supplies. Most regulators include some automatic protection from excessive current ('overload protection') and overheating ('thermal protection'). Many of the fixed voltage regulator ICs have 3 leads and look like power transistors, such as the 7805 +5V 1A regulator shown on the right. They include a hole for attaching a heat sink if necessary.

53

4.3 LCD DISPLAY: Liquid Crystal Display also called as LCD is very helpful in providing user interface as well as for debugging purpose. The most common type of LCD controller is HITACHI 44780 which provides a simple interface between the controller & an LCD. These LCD's are very simple to interface with the controller as well as are cost effective. The most commonly used ALPHANUMERIC displays are 1x16 (Single Line & 16 characters), 2x16 (Double Line & 16 character per line) & 4x20 (four lines & Twenty characters per line). The LCD requires 3 control lines (RS, R/W & EN) & 8 (or 4) data lines. The number on data lines depends on the mode of operation. If operated in 8-bit mode then 8 data lines + 3 control lines i.e. total 11 lines are required. And if operated in 4-bit mode then 4 data lines + 3 control lines i.e. 7 lines are required. How do we decide which mode to use? It’s simple if you have sufficient data lines you can go for 8 bit mode & if there is a time constrain i.e. display should be faster then we have to use 8-bit mode because basically 4-bit mode takes twice as more time as compared to 8-bit mode. Most projects you create with the 8051 CPU require some form of display. The most common way to accomplish this is with the LCD (Liquid Crystal Display). LCDs have become a cheap and easy way to get text display for embedded system Common displays are set up as 16 to 20 characters by 1 to 4 lines. When RS is low (0), the data is to be treated as a command. When RS is high (1), the data being sent is considered as text data which should be displayed on the screen. When R/W is low (0), the information on the data bus is being written to the LCD. When RW is high (1), the program is effectively reading from the LCD. Most of the times there is no need to read from the LCD so this line can directly be connected to Gnd thus saving one controller line. 54

The ENABLE pin is used to latch the data present on the data pins. A HIGH LOW signal is required to latch the data. The LCD interprets and executes our command at the instant the EN line is brought low. If you never bring EN low, your instruction will never be executed.

UNDERSTANDING LCD: Pin outline: • 8 data pins D7:D0 Bi-directional data/command pins. Alphanumeric characters are sent in ASCII format. • RS: Register Select RS = 0 -> Command Register is selected RS = 1 -> Data Register is selected

• R/W: Read or Write 0 -> Write, 1 -> Read • E: Enable (Latch data) Used to latch the data present on the data pins. A high-to-low edge is needed to latch the data. • VEE : contrast control

NOTE: When writing to the display, data is transferred only on the high to low transition of this signal. However, when reading from the display, data will become available shortly after the low to high transition and remain available until the signal falls low again.

55

Display Data RAM (DDRAM) Display data RAM (DDRAM) is where you send the characters (ASCII code) you want to see on the LCD screen. It stores display data represented in 8-bit character codes. Its capacity is 80 characters (bytes). Below you see DD RAM address layout of a 2*16 LCD. In the above memory map, the area shaded in black is the visible display (For 16x2 displays). For first line addresses for first 15 characters is from 00h to 0Fh. But for second line address of first character is 40h and so on up to 4Fh for the 16th character. So if you want to display the text at specific positions of LCD , we require to manipulate address and then to set cursor position accordingly . Character Generator RAM (CGRAM)-User defined character RAM In the character generator RAM, we can define our own character patterns by program. CG RAM is 64 bytes ,allowing for eight 5*8 pixel, character patterns to be defined. However how to define this and use it is out of scope of this tutorial. So I will not talk any more about CGRAM. Registers The HD44780 has two 8-bit registers, an instruction register (IR) and a data register (DR). The IR stores instruction codes. The DR temporarily stores data to be written into DDRAM or CGRAM and temporarily stores data to be read from DDRAM or CGRAM. Data written into the DR is automatically written into DDRAM or CGRAM by an internal operation. . These two registers can be selected by the register selector (RS) signal. See the table below:

RS

Register Selection R/W Operation

0

0

IR write as an internal operation (display clear, etc.)

0

1

Read busy flag (DB7) and address counter (DB0 to DB6)

1

0

DR write as an internal operation (DR to DDRAM or CGRAM)

1

1

DR read as an internal operation (DDRAM or CGRAM to DR)

56

Busy Flag (BF) When the busy flag is 1, the LCD is in the internal operation mode, and the next instruction will not be accepted. When RS = 0 and R/W = 1 (see the table above), the busy flag is output to DB7 (MSB of LCD data bus). The next instruction must be written after ensuring that the busy flag is 0. LCD Commands The LCD’s internal controller accept several commands and modify the display accordingly. These commands would be things like: –Clear screen – Return home – Shift display right/left Instruction Function set (8-bit interface, 2 lines, 5*7 Pixels) Function set (8-bit interface, 1 line, 5*7 Pixels) Function set (4-bit interface, 2 lines, 5*7 Pixels) Function set (4-bit interface, 1 line, 5*7 Pixels) Entry mode set Scroll display one character right (all lines)

Decimal 56 48 40 32 See Below 28

HEX 38 30 28 20 See Below 1E

Scroll display one character left (all lines) Home (move cursor to top/left character position) Move cursor one character left Move cursor one character right Turn on visible underline cursor Turn on visible blinking-block cursor Make cursor invisible Blank the display (without clearing) Restore the display (with cursor hidden) Clear Screen Set cursor position (DDRAM address)

24 2 16 20 14 15 12 8 12 1 128 + addr

18 2 10 14 0E 0F 0C 08 0C 01 80+ addr

Set pointer in character-generator RAM (CG RAM address)

64 + addr

40+ addr

57

ENTRY MODE SET: This command sets cursor move direction and display shift ON/OFF. There are 4 possible function set commands;04, 05, 06, and 07. This command changes the direction the cursor moves by setting the address counter to increment or decrement. This command is very important. If you do not understand it you may not see anything or what you actually wanted to see on LCD screen. I have created 4 animated gifs to demonstrate what the function set command is all about. Set cursor position (DDRAM address) As said earlier if we want to display the text at specific positions of LCD , we require to manipulate address and then to set cursor position accordingly. I want to display "MAHESH" in message "Hi MAHESH" at the right corner of first line then I should start from 10th character. So referring to table 80h+0Ah= 8Ah.

3.3.1 INTERFACING LCD TO 8051 :

58

The 44780 standard requires 3 control lines as well as either 4 or 8 I/O lines for the data bus. The user may select whether the LCD is to operate with a 4-bit data bus or an 8-bit data bus. If a 4-bit data bus is used, the LCD will require a total of 7 data lines. If an 8-bit data bus is used, the LCD will require a total of 11 data lines. The three control lines are EN, RS, and RW. Note that the EN line must be raised/lowered before/after each instruction sent to the LCD regardless of whether that instruction is read or write, text or instruction. In short, you must always manipulate EN when communicating with the LCD. EN is the LCD's way of knowing that you are talking to it. If you don't raise/lower EN, the LCD doesn't know you're talking to it on the other lines. Checking the Busy Flag: You can use subroutine for checking busy flag or just a big (and safe) delay. 1. 2. 3. 4.

Set R/W Pin of the LCD HIGH(read from the LCD) Select the instruction register by setting RS pin LOW Enable the LCD by Setting the enable pin HIGH The most significant bit of the LCD data bus is the state of the busy flag(1=Busy,0=ready to accept instructions/data). The other bits hold the current value of the address counter.

59

If the LCD never come out from "busy" status because of some problems ,The program will "hang," waiting for DB7 to go low. So in a real applications it would be wise to put some kind of time limit on the delay--for example, a maximum of 100 attempts to wait for the busy signal to go low. This would guarantee that even if the LCD hardware fails, the program would not lock up. CODE EXAMPLE It is easy (and clean tech. ) to make different subroutines and then call them as we need. Busy flag checking ready: setb P1.7 ;D7 as input clr P3.6 ;RS=0 cmd setb P3.5 ;RW=1 for read

clr P3.7 lcall ready ret Initialization

again: setb P3.7 ;H->L pulse on E clr P3.7 jb P1.7, again ret Data write Routine data: mov P1, A ;move acc. data to port setb P3.6 ;RS=1 data clr P3.5 ;RW=0 for write setb P3.7 ;H->L pulse on E clr P3.7 lcall ready ret Command write Routine command: mov P1, A ;move acc. data to port clr P3.6 ;RS=0 for cmd clr P3.5 ;RW=0 for write setb P3.7 ;H->L pulse on E

mov A, #38H ; Initialize, 2-lines, 5X7 matrix. lcall Command mov A, #0EH ; LCD on, cursor on lcall Command mov A, #01H ; Clear LCD Screen lcall Command mov A, #06H ; Shift cursor right lcall Command Display clear clear: setb p3.7 ;enable EN clr 3.6 ;RS=0 for cmd. mov DATA,#01h clr p3.7 ;disable EN lcall ready RET Note- As we need to clear the LCD frequently and not the whole

60

initialisation , it is better to use this routine separately.

Displaying "HI"

lcall initialization lcall clear mov A,#'H' acall data mov A,#'I' lcall data

Let's now try code for displaying text at specific positions. I want to display "MAHESH" in message "Hi MAHESH" at the right corner of first line then I should start from 10th character.

So referring to table 80h+0Ah= 8Ah. So below is code and I don's think that you will need explanation comments.

ASSEMBLY LANGUAGE: lcall Initialization lcall clear mov a,#'H' lcall data mov a,#'I' lcall data

lcall data mov a,#'S' lcall data mov a,#'H' lcall data

mov a,#8ah lcall command mov a,#'M' lcall data mov a,#'A' lcall data mov a,#'H' lcall data mov a,#'E' 61

3.4 MAX232: The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to signals suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual driver/receiver and typically converts the RX, TX, CTS and RTS signals. The drivers provide RS-232 voltage level outputs (approx. ± 7.5 V) from a single + 5 V supply via on-chip charge pumps and external capacitors. This makes it useful for implementing RS-232 in devices that otherwise do not need any voltages outside the 0 V to + 5 V range, as power supply design does not need to be made more complicated just for driving the RS-232 in this case. The receivers reduce RS-232 inputs (which may be as high as ± 25 V), to standard 5 V TTL levels. These receivers have a typical threshold of 1.3 V, and a typical hysteresis of 0.5 V. The later MAX232A is backwards compatible with the original MAX232 but may operate at higher baud rates and can use smaller external capacitors – 0.1 μF in place of the 1.0 μF capacitors used with the original device. The newer MAX3232 is also backwards compatible, but operates at a broader voltage range, from 3 to 5.5V. VOLTAGE LEVELS: It is helpful to understand what occurs to the voltage levels. When a MAX232 IC receives a TTL level to convert, it changes a TTL Logic 0 to between +3 and +15V, and changes TTL Logic 1 to between -3 to -15V, and vice versa for converting from RS232 to TTL. This can be confusing when you realize that the RS232 Data Transmission voltages at a certain logic state are opposite from the RS232 Control Line voltages at the same logic state.

62

Applications:     

Portable Computers Low-Power Modems Interface Translation Battery-Powered RS-232 Systems Multi drop RS-232 Networks

3.5 INTERFACING THE SERIAL / RS232 PORT The Serial Port is harder to interface than the Parallel Port. In most cases, any device you connect to the serial port will need the serial transmission converted back to parallel so that it can be used. This can be done using a UART. On the software side of things, there are many more registers that you have to attend to than on a Standard Parallel Port. (SPP) So what are the advantages of using serial data transfer rather than parallel? 1. Serial Cables can be longer than Parallel cables. The serial port transmits a '1' as -3 to 25 volts and a '0' as +3 to +25 volts where as a parallel port transmits a '0' as 0v and a '1' as 5v. Therefore the serial port can have a maximum swing of 50V compared to the parallel port which has a maximum swing of 5 Volts. Therefore cable loss is not going to be as much of a problem for serial cables than they are for parallel. 2. You don't need as many wires than parallel transmission. If your device needs to be mounted a far distance away from the computer then 3 core cable (Null Modem Configuration) is going to be a lot cheaper that running 19 or 25 core cable. However you must take into account the cost of the interfacing at each end. 3. Infra Red devices have proven quite popular recently. You may of seen many electronic diaries and palmtop computers which have infra red capabilities build in. However could you imagine transmitting 8 bits of data at the one time across the room and being able to (from the devices point of view) decipher which bits are which? Therefore serial transmission is used where one bit is sent at a time. IrDA-1 (The first infra red specifications) was capable of 115.2k baud and was interfaced into a UART. The pulse length however was cut down to 3/16th of a RS232 bit length to conserve power considering these devices are mainly used on diaries, laptops and palmtops. 4. Microcontroller's have also proven to be quite popular recently. Many of these have in built SCI (Serial Communications Interfaces) which can be used to talk to the outside world. Serial Communication reduces the pin count of these MPU's. Only two pins are commonly used, Transmit Data (TXD) and Receive Data (RXD) compared with at least 8 pins if you use a 8 bit Parallel method Devices which use serial cables for their communication are split into two categories. These are DCE (Data Communications Equipment) and DTE (Data Terminal Equipment.) Data Communications Equipment are devices such as your modem, TA adapter, plotter etc while Data Terminal Equipment is your Computer or Terminal. The electrical specifications of the serial port is contained in the EIA (Electronics Industry Association) RS232C standard. It states many parameters such as – 63

1. A "Space" (logic 0) will be between +3 and +25 Volts. 2. A "Mark" (Logic 1) will be between -3 and -25 Volts. 3. The region between +3 and -3 volts is undefined. 4. An open circuit voltage should never exceed 25 volts. (In Reference to GND) 5. A short circuit current should not exceed 500mA. The driver should be able to handle this without damage. (Take note of this one!) Above is no where near a complete list of the EIA standard. Line Capacitance, Maximum Baud Rates etc are also included. For more information please consult the EIA RS232-C standard. It is interesting to note however, that the RS232C standard specifies a maximum baud rate of 20,000 BPS!, which is rather slow by today's standards. A new standard, RS-232D has been recently released.

Serial Ports come in two "sizes", There are the D-Type 25 pin connector and the DType 9 pin connector both of which are male on the back of the PC, thus you will require a female connector on your device. Below is a table of pin connections for the 9 pin and 25 pin D-Type connectors.

3.5.1 HARDWARE PROPERTIES: Devices which use serial cables for their communication are split into two categories. These are DCE (Data Communications Equipment) and DTE (Data Terminal Equipment.) Data Communications Equipment are devices such as your modem, TA adapter, plotter etc while Data Terminal Equipment is your Computer or Terminal. The electrical specifications of the serial port is contained in the EIA (Electronics Industry Association) RS232C standard. It states many parameters such as - Above is no where near a complete list of the EIA standard. Line Capacitance, Maximum Baud Rates etc are also included. For more information please consult the EIA RS232-C standard. It is interesting to note however, that the RS232C standard specifies a maximum baud rate of 20,000 BPS!, which is rather slow by today's standards. A new standard, RS-232D has been recently released.Serial Ports come in two "sizes", There are the D-Type 25 pin connector and the D-Type 9 pin connector both of which are male on the back of the PC, thus you will require a female connector on your device. Below is a table of pin connections for the 9 pin and 25 pin D-Type connectors

DB9 CONNECTOR: 1. 2.

A "Space" (logic 0) will be between +3 and +25 Volts. A "Mark" (Logic 1) will be between -3 and -25 Volts. 64

3. The region between +3 and -3 volts is undefined. 4. An open circuit voltage should never exceed 25 volts. (In Reference to GND) 5. A short circuit current should not exceed 500mA. The driver should be able to handle this without damage.

DB9 CONNECTOR:

RS232 DB9Connector Pinout DB-9M Function Abbreviation Pin #1 Data Carrier Detect CD Pin #2 Receive Data RD or RX or RXD Pin #3 Transmitted Data TD or TX or TXD Pin #4 Data Terminal Ready DTR Pin #5 Signal Ground GND Pin #6 Data Set Ready DSR Pin #7 Request To Send RTS Pin #8 Clear To Send CTS Pin #9 Ring Indicator RI.

65

KEYPAD Introduction: A keypad is a set of buttons arranged in a block which usually bear digits and other symbols but not a complete set of alphabetical letters. If it mostly contains numbers then it can also be called a numeric keypad. Keypads are found on many alphanumeric keyboards and on other devices such as calculators, combination locks and telephones which require largely numeric input. An input device, sometimes part of a standard computer keyboard, consisting of a separate grid of numerical and function keys arranged for efficient data entry. A computer keyboard usually contains a small numeric keypad with a calculator-style arrangement of buttons duplicating the numeric and arithmetic keys on the main keyboard to allow efficient entry of numerical data. This number pad (commonly abbreviated to "numpad") is usually positioned on the right side of the keyboard because most people are right-handed. Many laptop computers have special function keys which turn part of the alphabetical keyboard into a numerical keypad as there is insufficient space to allow a separate keypad to be built into the laptop's chassis. Separate plug-in keypads can be purchased.The keypad of a calculator contains the digits 0 through 9, together with the four arithmetic operations, the decimal point and other more advanced functions. Keypads are a part of mobile phones that are replaceable and sit on a sensor board. Some multimedia mobile phones have a small joystick which has a cap to match the keypad.Keypads are also a feature of some combination locks. This type of lock is often used on doors, such as that found at the main entrance to some offices. Types of keypad: 1. 2. 3. 4.

Numeric keypad Telephony keypad Gaming keypad Matrix keypad

Numeric keypad: A numeric keypad, or numpad for short, is the small, palm-sized, seventeen key section of a computer keyboard, usually on the very far right. The numeric keypad features digits 0 to 9, addition (+), subtraction(-), multiplication (*) and division (/) symbols, a decimal point (.) and Num Lock and Enter keys. Laptop keyboards often do not have a numpad, but may provide numpad input by holding a modifier key (typically labelled "Fn") and operating keys on the standard keyboard. Particularly large laptops (typically those with a 17 inch screen or larger) may have space for a real numpad, and many companies sell separate numpads which connect to the host laptop by a USB connection. 66

Numeric keypads usually operate in two modes: when Num Lock is off, keys 8, 6, 2, 4 act like an arrow keys and 7, 9, 3, 1 act like Home, PgUp, PgDn and End; when Num Lock is on, digits keys produce corresponding digits. These, however, differ from the numeric keys at the top of the keyboard in that, when combined with the Alt key on a PC, they are used to enter characters which may not be otherwise available: for example, Alt0169 produces the copyright symbol. These are referred to as Alt codes. On Apple Computer Macintosh computers, which lack a Num Lock key, the numeric keypad always produces only numbers.

Telephony keypad: It is a keypad that appears on a “Touch Tone” telephone. It was standardized when the dual-tone multi-frequency (DTMF) system was introduced in the 1960s, and replaced the rotary dial. The contemporary keypad is laid out in a 3×4 grid, although the original DTMF keypad had an additional column for four now-defunct menu selector keys. When used to dial a telephone number, pressing a single key will produce a pitch consisting of two simultaneous pure tone sinusoidal frequencies. The row in which the key appears determines the low frequency, and the column determines the high frequency. For example, pressing the '1' key will result in a sound composed of both a 697 and a 1209 hertz (Hz) tone. The “*” is called the “star key” or “asterisk key”. The “#” is called the “number sign”, “pound key”, or “hash key”, depending on one's nationality or personal preference. What it is really called on its patent is an octothorpe (Flanagan et al., US 3,675,513 A, does not use the word octothorpe; however, Knowlton, US 3,967,273 A does. The earliest US patent to Mitchell [US 3,035,211 A] refers to "operator" [OP] and "Long-Distance" [LD] keys, and four additional keys for future services [at column 2, lines 65-71]). These can be used for special functions. For example, in the UK, users can order a 7.30am alarm call from a British Telecom telephone exchange by dialling: *55*0730#.

67

Gaming keypad: A gaming keypad is a small, auxiliary keyboard deisigned only for gaming. It has a limited number of the original keys from a standard keyboard, and they are arranged in a more ergonomic fashion to facilitate quick and efficient gaming key presses. The commonly used keys for gaming on a computer are the 'W', 'A', 'S', 'D', and the keys close and adjescent to these keys. These keys and style of using a keyboard is referred to as WASD. A gaming keypad will not only optimize the WASD layout, but will often contain extra funcitonality, such as volume control, the Esc. key, and the F1-F12 keys. Matrix keypad(4x4):

A sample schematic: A very simple circuit to experiment with AT90S2313, 2x16 LCD display and 4x4 keypad. The clock based on 4 MHz crystal, but you can use anyone crystal between 1-4 MHz. The keys with the name "A", "B" ... "F" are typed to the LCD with numbers 10-16

68

Operation: The AVR configure the PortB as PB0-PB3 inputs and PB4-PB7 outputs. At the firt, the AVR put the pin PB4 at logic '0' to enable the column1 (the first 4 keys) and reading the state of the keys. If we have pressed any of the 4 firt keys then the AVR send the number of the key to the LCD display. If we have not pressed any of 4 first keys, theAVR put the PB4 at logic '1' and PB5 at logic '0' to enable the 2th column. Reading the state of the keys and display the resault to LCD, etc, until to read the 16th key. After that, the circuit start again to read from the 1st key (1st column).

4.5 Relays:

69

A relay is an electrically operated switch. Many relays use an electromagnet to operate a switching mechanism mechanically, but other operating principles are also used. Relays are used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in long distance telegraph circuits, repeating the signal coming in from one circuit and re-transmitting it to another. Relays were used extensively in telephone exchanges and early computers to perform logical operations. A type of relay that can handle the high power required to directly drive an electric motor is called a contactor. Solid-state relays control power circuits with no moving parts, instead using a semiconductor device to perform switching. Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults; in modern electric power systems these functions are performed by digital instruments still called "protective relays".

Small relay as used in electronics A simple electromagnetic relay consists of a coil of wire surrounding a soft iron core, an iron yoke which provides a low reluctance path for magnetic flux, a movable iron armature, and one or more sets of contacts (there are two in the relay pictured). The armature is hinged to the yoke and mechanically linked to one or more sets of moving contacts. It is held in place by a spring so that when the relay is de-energized there is an air gap in the magnetic circuit. In this condition, one of the two sets of contacts in the relay pictured is closed, and the other set is open. Other relays may have more or fewer sets of contacts depending on their function. The relay in the picture also has a wire connecting the armature to the yoke. This ensures continuity of the circuit between the moving contacts on the armature, and the circuit track on the printed circuit board (PCB) via the yoke, which is soldered to the PCB. When an electric current is passed through the coil it generates a magnetic field that attracts the armature, and the consequent movement of the movable contact(s) either makes or breaks (depending upon construction) a connection with a fixed contact. If the set 70

of contacts was closed when the relay was de-energized, then the movement opens the contacts and breaks the connection, and vice versa if the contacts were open. When the current to the coil is switched off, the armature is returned by a force, approximately half as strong as the magnetic force, to its relaxed position. Usually this force is provided by a spring, but gravity is also used commonly in industrial motor starters. Most relays are manufactured to operate quickly. In a low-voltage application this reduces noise; in a high voltage or current application it reduces arcing.

Types of Relays Latching relay:

Latching relay with permanent magnet A latching relay has two relaxed states (bistable). These are also called "impulse", "keep", or "stay" relays. When the current is switched off, the relay remains in its last state. This is achieved with a solenoid operating a ratchet and cam mechanism, or by having two opposing coils with an over-center spring or permanent magnet to hold the armature and contacts in position while the coil is relaxed, or with a remanent core. In the ratchet and cam example, the first pulse to the coil turns the relay on and the second pulse turns it off. In the two coil example, a pulse to one coil turns the relay on and a pulse to the opposite coil turns the relay off. This type of relay has the advantage that it consumes power only for an instant, while it is being switched, and it retains its last setting across a power outage. A remanent core latching relay requires a current pulse of opposite polarity to make it change state.

Reed relay: A reed relay is a reed switch enclosed in a solenoid. The switch has a set of contacts inside an evacuated or inert gas-filled glass tube which protects the contacts against atmospheric corrosion; the contacts are made of magnetic material that makes them move under the influence of the field of the enclosing solenoid. Reed relays can switch faster than larger relays, require only little power from the control circuit, but have low switching current and voltage ratings.

71

Top, middle: reed switches, bottom: reed relay

Mercury-wetted relay: A mercury-wetted reed relay is a form of reed relay in which the contacts are wetted with mercury. Such relays are used to switch low-voltage signals (one volt or less) where the mercury reduces the contact resistance and associated voltage drop, for low-current signals where surface contamination may make for a poor contact, or for high-speed applications where the mercury eliminates contact bounce. Mercury wetted relays are position-sensitive and must be mounted vertically to work properly. Because of the toxicity and expense of liquid mercury, these relays are now rarely used. See also mercury switch.

Polarized relay: A polarized relay placed the armature between the poles of a permanent magnet to increase sensitivity. Polarized relays were used in middle 20th Century telephone exchanges to detect faint pulses and correct telegraphic distortion. The poles were on screws, so a technician could first adjust them for maximum sensitivity and then apply a bias spring to set the critical current that would operate the relay.

Machine tool relay: A machine tool relay is a type standardized for industrial control of machine tools, transfer machines, and other sequential control. They are characterized by a large number of contacts (sometimes extendable in the field) which are easily converted from normallyopen to normally-closed status, easily replaceable coils, and a form factor that allows compactly installing many relays in a control panel. Although such relays once were the backbone of automation in such industries as automobile assembly, the programmable logic controller (PLC) mostly displaced the machine tool relay from sequential control applications.

72

Contactor relay: A contactor is a very heavy-duty relay used for switching electric motors and lighting loads, although contactors are not generally called relays. Continuous current ratings for common contactors range from 10 amps to several hundred amps. High-current contacts are made with alloys containing silver. The unavoidable arcing causes the contacts to oxidize; however, silver oxide is still a good conductor.[2] Such devices are often used for motor starters. A motor starter is a contactor with overload protection devices attached. The overload sensing devices are a form of heat operated relay where a coil heats a bi-metal strip, or where a solder pot melts, releasing a spring to operate auxiliary contacts. These auxiliary contacts are in series with the coil. If the overload senses excess current in the load, the coil is de-energized. Contactor relays can be extremely loud to operate, making them unfit for use where noise is a chief concern.

Solid-state relay:

Solid state relay, which has no moving parts A solid state relay (SSR) is a solid state electronic component that provides a similar function to an electromechanical relay but does not have any moving components, increasing long-term reliability. With early SSR's, the tradeoff came from the fact that every transistor has a small voltage drop across it. This voltage drop limited the amount of current a given SSR could handle. As transistors improved, higher current SSR's, able to handle 100 to 1,200 Amperes, have become commercially available. Compared to electromagnetic relays, they may be falsely triggered by transients.

Solid state contactor relay: A solid state contactor is a heavy-duty solid state relay, including the necessary heat sink, used for switching electric heaters, small electric motors and lighting loads; where frequent on/off cycles are required. There are no moving parts to wear out and there is no contact bounce due to vibration. They are activated by AC control signals or DC control signals from Programmable logic controller (PLCs), PCs, Transistor-transistor logic (TTL) sources, or other microprocessor and microcontroller controls. 73

Buchholz relay: A Buchholz relay is a safety device sensing the accumulation of gas in large oil-filled transformers, which will alarm on slow accumulation of gas or shut down the transformer if gas is produced rapidly in the transformer oil.

Forced-guided contacts relay: A forced-guided contacts relay has relay contacts that are mechanically linked together, so that when the relay coil is energized or de-energized, all of the linked contacts move together. If one set of contacts in the relay becomes immobilized, no other contact of the same relay will be able to move. The function of forced-guided contacts is to enable the safety circuit to check the status of the relay. Forced-guided contacts are also known as "positive-guided contacts", "captive contacts", "locked contacts", or "safety relays".

Overload protection relay: Electric motors need over current protection to prevent damage from over-loading the motor, or to protect against short circuits in connecting cables or internal faults in the motor windings.[3] One type of electric motor overload protection relay is operated by a heating element in series with the electric motor. The heat generated by the motor current heats a bimetallic strip or melts solder, releasing a spring to operate contacts. Where the overload relay is exposed to the same environment as the motor, a useful though crude compensation for motor ambient temperature is provided.

ANALOG TO DIGITAL CONVERTER 8-Bit, Microprocessor-Compatible, A/D Converters The ADC080X family is CMOS 8-Bit, successive approximation A/D converters which use a modified potentiometer ladder and are designed to operate with the 8080A control bus via three-state outputs. These converters appear to the processor as memory locations or I/O ports, and hence no interfacing logic is required. The differential analog voltage input has good common mode-rejection and permits offsetting the analog zero-input voltage value. In addition, the voltage reference input can be adjusted to allow encoding any smaller analog voltage span to the full 8 bits of resolution. Features • 80C48 and 80C80/85 Bus Compatible - No Interfacing Logic Required • Conversion Time . . . . . . . . . . . . . . . . . . . . . . . . . . <100us • Easy Interface to Most Microprocessors • Will Operate in a “Stand Alone” Mode • Differential Analog Voltage Inputs • Works with Band gap Voltage References • TTL Compatible Inputs and Outputs • On-Chip Clock Generator 74

• Analog Voltage Input Range (Single + 5V Supply) . . . . . . . . . . . . . . . . . . . . . . 0V to 5V • No Zero-Adjust Required • 80C48 and 80C80/85 Bus Compatible - No Interfacing Logic Required

Fig.2.16. ADC Interfacing

Fig.2.17. ADC pin diagram 75

As the peripheral signals usually are substantially different from the ones that microcontroller can understand (zero and one), they have to be converted into a pattern which can be comprehended by a micro-controller. This task is performed by a block for analog to digital conversion or by an ADC. This block is responsible for converting an information about some analog value to a binary number and for follow it through to a CPU block so that CPU block can further process it.

This analog to digital converter (ADC) converts a continuous analog input signal, into an n-bit binary number, which is easily acceptable to a computer. As the input increases from zero to full scale, the output code stair steps. The width of an ideal step represents the size of the least significant Bit (LSB) of the converter and corresponds to an input voltage of VES/2n for an n-bit converter. Obviously for an input voltage range of one LSB, the output code is constant. For a given output code, the input voltage can be any where within a one LSB quantization interval. An actual converter has integral linearity and differential linearity errors. Differential linearity error is the difference between the actual code-step width and one LSB. Integral linearity error is a measure of the deviation of the code transition points from the fitted line. The errors of the converter are determined by the fitting of a line through the code transition points, using least square fit, the terminal point method, or the zero base technique to provide the reference line. A good converter will have less than 0.5 LSB linearity error and no missing codes over its full temperature range. In the basic conversion scheme of ADC, the un-known input voltage VX is connected to one input of an analog signal comparator, and a time dependant reference voltage VR is connected to the other input of the comparator. In this project work ADC 080X (8 Bit A/D converter) is used to convert analog voltage variations (according to the condition of the parameters) into digital pulses. This IC is having built in multi-plexer so that channel selection can be done automatically. Functional Description: The ADC 0804 shown in figure can be functionally divided into 2 basic sub circuits. These two sub circuits are an analog multiplexer and an A/D Converter. The multiplexer uses 8 standard CMOS analog switches to provide to up to 4 analog inputs. The switches are selectively turned on, depending on the data latched in to 3-bit multiplexer address register. The second functional block, the successive approximation A/D converter, transforms the analog output of the multiplexer to an 8-bit digital word. The output of the multiplexer goes to one of two comparator inputs. The other input is derived from a 256R resistor ladder, which is tapped by a MOSFET transistor switch tree. The converter control logic controls the switch tree, funneling a particular tap voltage to comparator.

76

Based on the result of this comparison, the control logic and the successive approximation register (SAR) will decide whether the next tap to be selected should be higher or lower than the present tap on the resistor ladder. This algorithm is executed 8 times per conversion, once every 8-clock period, yielding a total conversion time of clock periods. When the conversion cycle is complete the resulting data is loaded into the TRISTATE output latch. The data in the output latch can be then be read by the host system any time before the end of the next conversion. The TRI-STATE capability of the latch allows easy interfaces to bus oriented systems. The operation on these converters by a microprocessor or some control logic is very simple. The controlling device first selects the desired input channel. To do this, a 3-bit channel address is placed on the A, B, C in and out pins; and the ALE input is pulsed positively, clocking the address into the multiplexer address register. To begin the conversion, the START pin is pulsed. On the rising edge of this pulse the internal registers are cleared and on the falling edge the start conversion is initiated.

As mentioned earlier, there are 8 clock periods per approximation. Even though there is no conversion in progress the ADC0804 is still internally cycling through these 8 clock periods. A start pulse can occur any time during this cycle but the conversion will not actually begin until the converter internally cycles to the beginning of the next 8 clock period sequence. As long as the start pin is held high no conversion begins, but when the start pin is taken low the conversion will start within 8 clock periods. The EOC output is triggered on the rising edge of the start pulse. It, too, is controlled by the 8 clock period cycle, so it will go low within 8 clock periods of the rising edge of the start pulse. One can see that it is entirely possible for EOC to go low before the conversion starts internally, but this is not important, since the positive transition of EOC, which occurs at the end of a conversion, is what the control logic is looking for. Once EOC does go high this signals the interface logic that the data resulting from the conversion is ready to be read. The output enable(OE) is then raised high. This enables the TRI-STATE outputs, allowing the data to be read. Figure shows the timing diagram.

77

CHAPTER -5 SOFTWARE DESCRIPTION KEIL: This software is used to write the microcontroller code and to simulate it on the computer itself. It is also used to generate the hex code for the code written in ALP or C. User Vs machine (microcontroller): as the microcontroller know only about the digital value (i.e. either logic zero or one), so we need to convert the written code in the sets of zero n one. The KEIL environment provide us the facility to convert the code written in C or ALP to sets of zero n one (i.e. called hex code).

How to use keil: After installing the software when you open the ‘keil’ , one window will appear as shown in figure.

Create a new project: To create a new project go to ‘project’ option then click the ‘new project’ option. it will ask to save the project in your desired folder. All the project is saved in the ‘Uv2’ format with the extension of Uv2.

Selecting the device:

78

After saving the project the window will appear which will ask for selecting the device, then select the company “philips” or “ nxp” and then select the device number ‘P89V51RD2’.

After selection of device, the one more window will appear to copy the start up code .after clicking it ‘ok’ the project format is ready to simulate the code. Then after click the ‘new file’ in the FILE menu. Then a new file will appear in which we write our code in any programming language like C or ALP. The window will appear as shown below.

79

After writing the code we need to save it. For code written in ‘C’ we need to save the file with the extension ‘.c’ (i.e. the file is stored as filename.c). The code written in ALP(assembly language programming) has to save with the extension of ‘.a’ fter saving the file we need to add the written code in our project. For that right click of mouse on ‘source group 1’ ,the option ‘Add files to group ‘source group1’ will appear.

80

After completing all these stuff now its time to simulate your code n check its output with the given input. For that click the ‘debug’ option and click ‘ window will appear.

start/stop debug session’ then the the following

81

The keil we use having limitation to simulate the maximum code size 2KB.this window is just for a warning msg, so, just press ‘ok’ for that option. After that the project is ready to run. The microcontroller is having 4 ports. Each port is having 8 pins. Each port can be used either as input or output port. By using keil integrated development environment we can check all the input and output on computer itself. For that when your project is ready to run then click the option ‘peripheral’ then go to ‘I/O ports’ and then select the ports which all are required.

82

Testing of code : code can be tested on computer itself. After selecting the port, just press ‘run’ on the window. and give the input to the port and the corresponding output will automatically appear on other port..

83

After adding the file we need to compile it. The compilation can be done by first click ‘translate current file’ and then

84

Click ‘built target’ it will generate the hex code .but before that we need to change the settings . for that go to ‘project’ option and then click ‘Options for Target ’target 1’’. A new window will appear as shown below

85

Here we need to change the ‘Xtal(MHz): ‘. Here fill the frequency of crystal which we are going to use. For the microcontroller which we are using the crystal that we are using is having crystal frequency 12MHz.and click the option for ‘Use On-chip ROM(0x00xFFFF)’.then click the option ‘Output’ where we have to select the option ‘Create HEX File’. After that we can translate the current file n built target will generate the HEX code automatically.

Flash magic

: Flash Magic is Windows software from that microcontroller is easyly programmed using In-System Programming technology to all the ISP feature empowered devices.

86

After installing the software when we click on the icon of the software the window will open on the screen as shown in figure. We need to change the device and have to select the device 89V51RD2 , and then we set to ‘erase all flash’ option on the flash magic window. If we need to verify the proper dumping of the program in the microcontroller then we need to set the ‘verify after program’ option. Loading of hex file: After selecting device we load the hex file in the given block by using the ‘browse’ option on the ‘FLASH MAGIC’ window.. Programming of device : after loading the file next step is dumping of code in microcontroller. For that we first connect the computer’s serial port to your controller board through serial cable. Then after give the power supply to the controller board.. Now its time to dump the code in controller.. Press the start option on your flash magic window. Then your microcontroller will be programmed in few seconds..

87

CHAPTER 6 Advantages: 1.The status of various devices can be monitored and controlled from anywhere. 2.The operation of the system is very simple and can be used by anyone with a basic knowledge of operating mobile phones. 2. Higher reliability. 3. Cost effective. 4. Fast and efficient Applications: 1. Industrial automation. 2.To control water pump sets in agricultural fields. 3. Can also be used for security purpose after modification. 4. In places where control of action has no time limit. Future Development 1. We can monitor and control more parameters and devices. 2. Voice announcement system can be added to indicate device

88

Industrial Device OS using Mobile Comm..pdf

Industrial Device OS using Mobile Comm..pdf. Industrial Device OS using Mobile Comm..pdf. Open. Extract. Open with. Sign In. Main menu.

2MB Sizes 2 Downloads 190 Views

Recommend Documents

Notification of event by mobile communications device using radio ...
Oct 2, 2012 - device having a processor, memory, a wireless network inter- face, and a ... Other features, objects, and advantages of the disclo- sure will be ...

Programmable mobile device with thumb wheel
Oct 19, 2004 - may display inventory information, pricing detail, etc. which is to be transmitted to .... The spring button is always in contact with contact SW2 of.

Programmable mobile device with thumb wheel
Oct 19, 2004 - wired network, such as a local area network (LAN) or a wide area network ..... memory 50 may also serve as a storage medium for tempo.

8.2.4.4 Worksheet - Mobile Device Information.pdf
Device: Pathway Features/Information. Page 2 of 3 ... 8.2.4.4 Worksheet - Mobile Device Information.pdf. 8.2.4.4 Worksheet - Mobile Device Information.pdf.

Mobile Device Management (MDM) -
Cloud-based solution provides ease of access for the administrator. How does it provide ... Almost all MDM products support easy integration with Exchange.

Citrix® XenMobile Mobile Device Management - Phoenix Akash.pdf ...
Page 1 of 1. Citrix® XenMobileTM Mobile Device Management - Phoenix. Akash. Page 1 of 1. Citrix® XenMobile Mobile Device Management - Phoenix Akash.pdf. Citrix® XenMobile Mobile Device Management - Phoenix Akash.pdf. Open. Extract. Open with. Sign

Industrial Automation Mobile Unit 200Hour.pdf
Whoops! There was a problem previewing this document. Retrying... Download ... Industrial Automation Mobile Unit 200Hour.pdf. Industrial Automation Mobile ...

Optimizing Mobile-Device Design with Targeted Content - Media15
Form factor reference design did not meet customization targets for groups of ... standardized issues-management application, is accessible through the.

Securing a Remote Terminal Application with a Mobile Trusted Device
we trust it to a certain extent (e.g., not to deny service). If users want to access their sensitive home computing environment from an untrusted terminal, it would ...

Mobile Strike Hacks For Fire Os 901
GTA 5 Modded Accounts for Sale Buy GTA V Accounts . ... online games, free TV channel laptop, PC, Mobile, Desktop, Computer etc. so enjoy it Code Generator ...

Optimizing Mobile-Device Design with Targeted Content - Media15
To realize these goals, we worked with the business to separate content ... Management and Training Lead, Intel. Acronyms ... in one portal. • Reduce the amount ... all relevant platform content (bundles) into XML and routing them to their final ..

Global Mobile Device Management Market 2016 Industry Trend and ...
Global Mobile Device Management Market 2016 Industry Trend and Forecast 2021.pdf. Global Mobile Device Management Market 2016 Industry Trend and ...

Bring your own device mobile security.pdf
Bring your own device mobile security.pdf. Bring your own device mobile security.pdf. Open. Extract. Open with. Sign In. Main menu.

Google App Engine Helps MokiMobility Simplify Mobile Device ...
Organization. MokiMobility used Google App Engine to build a cutting-edge, cloud-based mobile device management (MDM) platform for managing iPads, ...

Student Mobile Device Checkout Agreement 1-1 Computing.pdf ...
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Student Mobile ...

High School Mobile Device Usage Policies.pdf
Sign in. Loading… Whoops! There was a problem loading more pages. Retrying... Whoops! There was a problem previewing this document. Retrying.