Sunteți pe pagina 1din 129

VEHICLE TRACKING SYSTEM Description: Global Positioning System (GPS) satellites broadcast signals from space that GPS

receivers, use to provide three-dimensional location (latitude, longitude, and altitude) plus precise time. GPS receivers provides reliable positioning, navigation, and timing services to orld ide users on a continuous basis in all eather, day and night, any here on or near the !arth. "his ultra-sensitive GPS receiver can ac#uire GPS signals from $% channels of satellites and output position data ith high accuracy in e&tremely challenging environments and under poor signal conditions due to its active antenna and high sensitivity. "he GPS receiver's -($)d*m trac+ing sensitivity allo s continuous position coverage in nearly all application environments. "he output is serial data of ,$)) baud rate devices. 2n this pro3ect microcontroller is connected to GPS and GS. modems. 4sing this pro3ect use can +no the position of vehicle in google maps. .icrocontroller can ta+e coordinate values from GPS modem and send to particular mobile numbers through GS. modem.GS. modem or+ under /" commands. 4sing this latitude and longitude e can +no the vehicle position on google maps through internet. *ut user has to enter coordinate values in google maps. hich is standard -.!/ )(01 v1.) protocol offering industry standard data messages and a command set for easy interface to mapping soft are and embedded

2n this pro3ect 50)% is a regulator and it avoids noise spi+es in po er supply. GPS modem is connected microcontroller through serial port. "hese GPS modem or+s under ,$)) or 60)) baud rates.

TECHNICAL SPECIFICATIONS: HARDWARE: .icro controller 8rystal ;!D Serial Driver GPS modem GS. modm Po er supply "ransformer >ilter =oltage <egulator SOFTWARE: @eil micro vision Proteus 48 flash : : : (7= step do n ()))uf?7%= 50)% : : : : /"0,S%7 ((.)%,7 .9: %mm <ed ;!D .a& 717

APPLICATIONS: "ransport service /utomobiles

BLOCK DIAGRAM: Po er Supply 0

GS. .odem

.a&-717

($A7 ;8D GPS .odem .a&-717

POWER SUPPLY BLOCK DIAGRAM Step do n "ransformer *ridge <ectifier >ilter <egulator Cutput

EMBEDDED SYSTEMS: Introduct on: /n embedded system is a system hich is going to do a predefined specified tas+ is the embedded system and is even defined as combination of both soft are and hard are. / general-purpose definition of embedded systems is that they are devices used to control, monitor or assist the operation of e#uipment, machinery or plant. B!mbeddedB reflects the fact that they are an integral part of the system. /t the other e&treme a generalpurpose computer may be used to control the operation of a large comple& processing plant, and its presence ill be obvious. /ll embedded systems are including computers or microprocessors. Some of these computers are ho ever very simple systems as compared ith a personal computer. "he very simplest embedded systems are capable of performing only a single function or set of functions to meet a single predetermined purpose. 2n more comple& systems an application program that enables the embedded system to be used for a particular purpose in a specific application determines the functioning of the embedded system. "he ability

to have programs means that the same embedded system can be used for a variety of different purposes. 2n some cases a microprocessor may be designed in such a second process, after ay that application soft are for a particular purpose can be added to the basic soft are in a hich it is not possible to ma+e further changes. "he applications hich soft are on such processors is sometimes referred to as firm are. "he simplest devices consist of a single microprocessor (often called a BchipD), may itself be pac+aged ith other chips in a hybrid system or /pplication Specific

2ntegrated 8ircuit (/S28). 2ts input comes from a detector or sensor and its output goes to a s itch or activator hich (for e&ample) may start or stop the operation of a machine or, by operating a valve, may control the flo of fuel to an engine. /s the embedded system is the combination of both soft are and hard are E&("dd"d S)*t"&

So't-%r"

H%rd-%r"

ALP C VB Etc./ F !ur": B#oc$ d %!r%& o' E&("dd"d S)*t"& Soft are deals

Proc"**or P"r +,"r%#* &"&or)

ith the languages li+e /;P, 8, and =* etc., and 9ard are deals

ith

Processors, Peripherals, and .emory. M"&or): 2t is used to store data or address. P"r +,"r%#*: "hese are the e&ternal devices connected Proc"**or: 2t is an 28 hich is used to perform some tas+ A++# c%t on* o' "&("dd"d *)*t"&* .anufacturing and process control 8onstruction industry

"ransport *uildings and premises Domestic service 8ommunications Cffice systems and mobile e#uipment *an+ing, finance and commercial .edical diagnostics, monitoring and life support "esting, monitoring and diagnostic systems

Proc"**or* %r" c#%** ' "d nto 'our t)+"* # $": .icro Processor (Ep) .icro controller (Ec) Digital Signal Processor (DSP) /pplication Specific 2ntegrated 8ircuits (/S28) orld of personal computers, the terms

M cro Proc"**or 01+2: / silicon chip that contains a 8P4. 2n the and most microprocessor and 8P4 are used interchangeably. /t the heart of all personal computers or+stations sits a microprocessor. .icroprocessors also control the logic of almost all digital devices, from cloc+ radios to fuel-in3ection systems for automobiles. T,r"" (%* c c,%r%ct"r *t c* d ''"r"nt %t" & cro+roc"**or*: In*truct on *"t: "he set of instructions that the microprocessor can e&ecute. B%nd- dt, : "he number of bits processed in a single instruction. C#oc$ *+""d : Given in megahert: (.9:), the cloc+ speed determines ho many

instructions per second the processor can e&ecute. 2n both cases, the higher the value, the more po erful the 8P4. >or e&ample, a 17-bit microprocessor that runs at %).9: is more po erful than a ($-bit microprocessor that runs at 7%.9:. 2n addition to band idth and cloc+ speed, microprocessors are classified

as being either <2S8 (reduced instruction set computer) or 82S8 (comple& instruction set computer). / microprocessor has three basic elements, as sho n above. "he /;4 performs all arithmetic computations, such as addition, subtraction and logic operations (/-D, C<, etc). 2t is controlled by the 8ontrol 4nit and receives its data from the <egister /rray. "he <egister /rray is a set of registers used for storing data. "hese registers can be accessed by the /;4 very #uic+ly. Some registers have specific functions e ill deal ith these later. "he 8ontrol 4nit controls the entire process. 2t provides the timing and a control signal for getting data into and out of the registers and the /;4 and it synchroni:es the e&ecution of instructions ( e later date). ill deal ith instruction e&ecution at a

T,r"" B%* c E#"&"nt* o' % M cro+roc"**or M cro Contro##"r 01c2: / microcontroller is a small computer on a single nt"!r%t"d c rcu t containing a processor core, memory, and programmable n+ut3out+ut peripherals. Program memory in the form of NOR '#%*, or OTP ROM is also often included on chip, as ell as a typically small amount of </.. .icrocontrollers are designed for embedded applications, in contrast to the & cro+roc"**or* used in +"r*on%# co&+ut"r* or other general purpose applications.

ALU CU
"imer,M"&or) 8ounter, serial communication <C., /D8, D/8, "imers, 4S/<", Cscillators

!tc.,

F !ur": B#oc$ D %!r%& o' M cro Contro##"r 01c2 Digital Signal Processors (DSPs): Digital Signal Processors is one hich performs scientific and mathematical operation. ith architectures designed ith its o n native

Digital Signal Processor chips - speciali:ed microprocessors

specifically for the types of operations re#uired in digital signal processing. ;i+e a general-purpose microprocessor, a DSP is a programmable device, instruction code. DSP chips are capable of carrying out millions of floating point operations per second, and li+e their better-+no n general-purpose cousins, faster and more po erful versions are continually being introduced. DSPs can also be embedded ithin comple& Bsystem-on-chipB devices, often containing both analog and digital circuitry. A++# c%t on S+"c ' c Int"!r%t"d C rcu t 0ASIC2 /S28 is a combination of digital and analog circuits pac+ed into an 28 to achieve the desired control?computation function ASIC t)+ c%##) cont% n* 8P4 cores for computation and control Peripherals to control timing critical functions .emories to store data and program

/nalog circuits to provide cloc+s and interface to the real

orld

hich is

analog in nature etc. Co&+ut"r In*truct on S"t "here are t o different types of computer instruction set there are: (. <2S8 (<educed 2nstruction Set 8omputer) and 7. 82S8 (8omple& 2nstruction Set computer) R"duc"d In*truct on S"t Co&+ut"r 0RISC2 / <2S8 (reduced instruction set computer) is a microprocessor that is designed to perform a smaller number of types of computer instruction so that it can operate at a higher speed (perform more million instructions per second, or millions of instructions per second). Since each instruction type that a computer must perform re#uires additional transistors and circuitry, a larger list or set of computer instructions tends to ma+e the microprocessor more complicated and slo er in operation. *esides performance improvement, some advantages of <2S8 and related design improvements are: / ne microprocessor can be developed and tested more #uic+ly if one of its ho use the microprocessorFs aims is to be less complicated. Cperating system and application programmers instructions ill find it easier to develop code ith a smaller instruction set. "he simplicity of <2S8 allo s more freedom to choose ho to use the space on a microprocessor. 9igher-level language compilers produce more efficient code than formerly because they have al ays tended to use the smaller set of instructions to be found in a <2S8 computer. RISC c,%r%ct"r *t c* S &+#" n*truct on*"t: hich 2n a <2S8 machine, the instruction set contains simple, basic instructions, from more comple& instructions can be composed. S%&"#"n!t, n*truct on*. !ach instruction is the same length, so that it may be fetched in a single operation. 2?Cs to connect to e&ternal components li+e ;!Ds, memories, monitors

4&%c, n"5c)c#" n*truct on*. hich allo s the processor to handle

.ost instructions complete in one machine cycle, <2S8 machines. Co&+#"6 In*truct on S"t Co&+ut"r 0CISC2 82S8,

several instructions at the same time. "his pipelining is a +ey techni#ue used to speed up

hich stands for Co&+#"6 In*truct on S"t Co&+ut"r/ is a philosophy for hich ma+e efficient use of memory. !ach

designing chips that are easy to program and

instruction in a 82S8 instruction set might perform a series of operations inside the processor. "his reduces the number of instructions re#uired to implement a given program, and allo s the programmer to learn a small but fle&ible set of instructions. T,"%d7%nt%!"*o'CISC /t the time of their initial development, 82S8 machines used available technologies to optimi:e computer performance. .icroprogramming is as easy as assembly language to implement, and much less "he ease of micro-coding ne computer instructions allo ed designers to ma+e 82S8 computer could run the same programs as earlier ould contain a superset of the instructions of the e&pensive than hard iring a control unit. machines up ardly compatible: a ne computers because the ne earlier computers. /s each instruction became more capable, fe er instructions could be used to main implement a given tas+. "his made more efficient use of the relatively slo memory. *ecause micro program instruction sets can be ritten to match the constructs of high-level languages, the compiler does not have to be as complicated. T,"d *%d7%nt%!"*o'CISC Still, designers soon reali:ed that the 82S8 philosophy had its o n problems, including: !arlier generations of a processor family generally ere contained as a subset in ith every ne version --- so instruction set G chip hard are become more comple&

each generation of computers.

So that as many instructions as possible could be stored in memory

ith the least

possible

asted space, individual instructions could be of almost any length---this means ill ta+e different amounts of cloc+ time to e&ecute, slo ing

that different instructions

do n the overall performance of the machine. .any speciali:ed instructions arenFt used fre#uently enough to 3ustify their e&istence --- appro&imately 7)H of the available instructions are used in a typical program. 82S8 instructions typically set the condition codes as a side effect of the instruction. -ot only does setting the condition codes ta+e time, but programmers have to remember to e&amine the condition code bits before a subse#uent instruction changes them. M"&or) Arc, t"ctur" "here t o different type's memory architectures there are: 9arvard /rchitecture =on--eumann /rchitecture

H%r7%rd Arc, t"ctur" 8omputers have separate memory areas for program instructions and data. "here are t o or more internal data buses, hich allo simultaneous access to both instructions and ith physically separate storage ide) data. "he 8P4 fetches program instructions on the program memory bus. "he H%r7%rd %rc, t"ctur" is a computer architecture .ar+ 2 relay-based computer, entirely contained could not boot itself. and signal path ays for instructions and data. "he term originated from the 9arvard hich stored instructions on punched tape (76 bits and data in electro-mechanical counters. "hese early machines had limited data storage, ithin the central processing unit, and provided no access to the instruction storage as data. Programs needed to be loaded by an operator, the processor

F !ur": H%r7%rd Arc, t"ctur" Modern uses of the Harvard architecture: "he principal advantage of the pure 9arvard architecture - simultaneous access to more than one memory system - has been reduced by modified 9arvard processors using modern 8P4 cache systems. <elatively pure 9arvard architecture machines are used mostly in applications spaces. Digital signal processors (DSPs) generally e&ecute small, highly-optimi:ed audio ith multiple address spaces are of or video processing algorithms. "hey avoid caches because their behavior must be e&tremely reproducible. "he difficulties of coping secondary concern to speed of e&ecution. /s a result, some DSPs have multiple data memories in distinct address spaces to facilitate S2.D and =;2I processing. "e&as 2nstruments ".S17) 8%%& processors, as one e&ample, have multiple parallel data busses (t o rite, three read) and one instruction bus. .icrocontrollers are characteri:ed by having small amounts of program (flash ith no cache, and ta+e advantage of the 9arvard memory) and data (S</.) memory, here tradeoffs, such as the cost and po er savings from omitting caches, out eigh the programming penalties from having distinct code and data address

architecture to speed processing by concurrent instruction and data access. "he separate storage means the program and data memories can have different bit depths, for e&ample using ($-bit ide instructions and 0-bit ide data. "hey also mean that instruction prefetch can be performed in parallel ith other activities. !&amples include, the /=< by

/tmel 8orp, the P28 by .icrochip "echnology, 2nc. and the /<. 8orte&-.1 processor (not all /<. chips have 9arvard architecture).

!ven in these cases, it is common to have special instructions to access program memory as data for read-only tables, or for reprogramming. Von5N"u&%nn Arc, t"ctur" / computer has a single, common memory space in hich both program instructions and data are stored. "here is a single internal data bus that fetches both instructions and data. "hey cannot be performed at the same time "he 7on N"u&%nn %rc, t"ctur" is a design model for a stored-program digital computer that uses a central processing unit (8P4) and a single separate storage structure (BmemoryB) to hold both instructions and data. 2t is named after the mathematician and early computer scientist John von -eumann. Such computers implement a universal "uring machine and have a se#uential architecture. / *tor"d5+ro!r%& digital computer is one that +eeps its programmed instructions, as ell as its data, in read- rite, random-access memory (</.). Stored-program computers ere advancement over the program-controlled computers of the (,6)s, such hich ere programmed by setting s itches and as the 8olossus and the !-2/8,

inserting patch leads to route data and to control signals bet een various functional units. 2n the vast ma3ority of modern computers, the same memory is used for both data and program instructions. "he mechanisms for transferring the data and instructions bet een the 8P4 and memory are, ho ever, considerably more comple& than the original von -eumann architecture. "he terms Bvon -eumann architectureB and Bstored-program computerB are generally used interchangeably, and that usage is follo ed in this article.

F !ur": Sc,"&%t c o' t," Von5N"u&%nn Arc, t"ctur".

B%* c D ''"r"nc" ("t-""n H%r7%rd %nd Von5N"u&%nn Arc, t"ctur" "he primary difference bet een 9arvard architecture and the =on -eumann architecture is in the =on -eumann architecture data and programs are stored in the same memory and managed by the same information handling system. Ihereas the 9arvard architecture stores data and programs in separate memory 2n a computer using the =on--eumann architecture ithout cacheK the central riting?reading data devices and they are handled by different subsystems. processing unit (8P4) can either be reading and instruction or and instructions use the same system bus. 2n a computer using the 9arvard architecture the 8P4 can both read an instruction and access data memory at the same time ithout cache. "his means that a computer ith 9arvard architecture can potentially be faster for a given circuit comple&ity because data access and instruction fetches do not contend for use of a single memory path ay. "oday, the vast ma3ority of computers are designed and built using the =on -eumann architecture template primarily because of the dynamic capabilities and efficiencies gained in designing, implementing, operating one memory system as opposed to t o. =on -eumann architecture may be some hat slo er than the contrasting 9arvard /rchitecture for certain specific tas+s, but it is much more fle&ible and allo s for many concepts unavailable to 9arvard architecture such as self programming, and so on. 9arvard architectures are typically only used in either speciali:ed systems or for very specific uses. 2t is used in speciali:ed digital signal processing (DSP), typically for video and audio processing products. 2t is also used in many small microcontrollers used in electronics applications such as /dvanced <2S@ .achine (/<.) based products for many vendors. THE MICROCONTROLLER: / microcontroller is a general purpose device, but that is meant to read data, perform limited calculations on that data and control its environment based on those calculations. "he prime use of a microcontroller is to control the operation of a machine ord processing

to?from the memory. *oth of these operations cannot occur simultaneously as the data

using a fi&ed program that is stored in <C. and that does not change over the lifetime of the system. "he microcontroller design uses a much more limited set of single and double byte instructions that are used to move data and code from internal memory to the /;4. "he microcontroller is concerned ith getting data from and to its o n pinsK the architecture and instruction set are optimi:ed to handle data in bit and byte si:e. "he /"0,8%( is a lo -po er, high-performance 8.CS 0-bit microcontroller ith 6+ bytes of >lash Programmable and erasable read only memory (!<C.). "he device is manufactured using /tmel's high-density nonvolatile memory technology and is functionally compatible ith the industry-standard 0)8%( microcontroller instruction ith >lash on a monolithic chip, the hich provides a high fle&ible and costset and pin out. *y combining versatile 0-bit 8P4 /tmel's /"0,c%( is a po erful microcomputer, AT89C:4 MICROCONTROLLER FEATURES 0)8%( based architecture 6-@bytes of on-chip <eprogrammable >lash .emory (70 & 0 </. " o ($-bit "imer?8ounters >ull duple& serial channel *oolean processor >our 0-bit 2?C ports, 17 2?C lines .emory addressing capability L L $6@ <C. and $6@ </. 2dle and po er-do n Po er save modes: Si& interrupt sources .ost instructions e&ecute in ).1 us 8.CS and ""; compatible .a&imum speed: 6) .9: M =cc N %=

effective solution to many embedded control applications.

2ndustrial temperature available Pac+ages available: L 6)-pin D2P L 66-pin P;88 L 66-pin PO>P

P n con' !ur%t on:

AT89C:4 B#oc$ D %!r%&

PIN DESCRIPTION: VCC Supply voltage

GND Ground Port ; Port ) is an 0-bit open drain bi-directional 2?C port. /s an output port, each pin can sin+ eight ""; inputs. Ihen (s are impedance inputs. Port ) can also be configured to be the multiple&ed lo order address?data bus during access to e&ternal program and data memory. 2n this mode, P ) has internal pullups. Port ) also receives the code bytes during >lash programming and outputs the code bytes during program verification. !&ternal pull-ups are re#uired during program verification. Port 4 Port ( is an 0-bit bi-directional 2?C port ith internal pull-ups. "he port (output ritten to port ( pins, they are buffers can sin+?source four ""; inputs. Ihen (s are e&ternally being pulled lo Port < Port 7 is an 0-bit bi-directional 2?C port ith internal pull-ups. "he port 7 output ritten to port 7 pins, they are buffers can sin+?source four ""; inputs. Ihen (s are e&ternally being pulled lo ritten to port ) pins, the pins can be used as high

pulled high by the internal pull-ups can be used as inputs. /s inputs, Port ( pins that are ill source current (() because of the internal pull-ups.

pulled high by the internal pull-ups can be used as inputs. /s inputs, Port 7 pins that are ill source current because of the internal pull-ups.

Port 7 emits the high-order address byte during fetches from e&ternal program memory and during access to DP"<. 2n this application Port 7 uses strong internal pullups hen emitting (s. During accesses to e&ternal data memory that use 0-bit data address (.C=AM<(), Port 7 emits the contents of the P7 Special >unction <egister. Port 7 also receives the high-order address bits and some control signals during >lash programming and verification. Port = Port 1 is an 0-bit bi-directional 2?C port ith internal pull-ups. "he port 1 output ritten to port 1 pins, they are buffers can sin+?source four ""; inputs. Ihen (s are

pulled high by the internal pull-ups can be used as inputs. /s inputs, Port 1 pins that are e&ternally being pulled lo ill source current because of the internal pull-ups. Port 1 also receives some control signals for >lash Programming and verification. Port + n P1.) P1.( P1.7 P1.1 P1.6 P1.% P1.$ P1.5 RST <est input / on this pin for t o machine cycles device. ALE3PROG: /ddress ;atch !nable is an output pulse for latching the lo during >lash programming. 2n normal operation /;! is emitted at a constant rate of (?($ the oscillator fre#uency and may be used for e&ternal timing or cloc+ing purpose. -ote, ho ever, that one /;! pulse is s+ipped during each access to e&ternal Data memory. PSEN Program Store !nable is the read strobe to e&ternal program memory hen the /"0,c%( is e&ecuting code from e&ternal program memory PS!- is activated t ice each machine cycle, e&cept that t o PS!- activations are s+ipped during each access to e&ternal data memory. byte of the address during access to e&ternal memory. "his pin is also the program pulse input (P<CG) hile the oscillator is running resets the A#t"rn%t" Funct on* <AD(serial input port) "AD(serial input port) 2-")(e&ternal interrupt )) 2-"((e&ternal interrupt () ")(timer ) e&ternal input) "((timer ( e&ternal input) I<(e&ternal data memory rite strobe) <D(e&ternal data memory read strobe)

EA 3VPP !&ternal /ccess !nable (!/) must be strapped to G-D in order to enable the device to fetch code from e&ternal program memory locations starting at ))))h up to >>>>9. -ote, ho ever, that if loc+ bit ( is programmed !/ ill be internally latched on hen reset. !/ should be strapped to =cc for internal program e&ecutions. "his pin also receives the (7-volt programming enable voltage (=pp) during >lash programming (7-volt programming is selected. >TAL4 2nput to the inverting oscillator amplifier and input to the internal cloc+ operating circuit. >TAL < Cutput from the inverting oscillator amplifier. OPERATING DESCRIPTION "he detail description of the /"0,8%( included in this description is: P .emory .ap and <egisters P "imer?8ounters P 2nterrupt System MEMORY MAP AND REGISTERS M"&or) "he /"0,8%( has separate address spaces for program and data memory. "he program and data memory can be up to $6@ bytes long. "he lo er 6@ program memory can reside on-chip. "he /"0,8%( has (70 bytes of on-chip </.. "he lo er (70 bytes can be accessed either by direct addressing or by indirect addressing. "he lo er (70 bytes of </. can be divided into 1 segments as listed belo (. R"! *t"r B%n$* ;5=: locations ))9 through (>9 (17 bytes). "he device after reset defaults to register ban+ ). "o use the other register ban+s, the user must select them in soft are. !ach register ban+ contains eight (-byte registers <)-<5. <eset initiali:es the stac+ point to location )59, and is incremented once to start from )09, register of the second register ban+. hich is the first

7. B t Addr"**%(#" Ar"%: ($ bytes have been assigned for this segment 7)9-7>9. !ach one of the (70 bits of this segment can be directly addressed ()-5>9). !ach of the ($ bytes in this segment can also be addressed as a byte. 1. Scr%tc, P%d Ar"%: 1)9-5>9 are available to the user as data </.. 9o ever, if the data pointer has been initiali:ed to this area, enough bytes should be left aside to prevent SP data destruction.

SPECIAL FUNCTION REGISTERS: "he Special >unction <egisters (S><Fs) are located in upper (70 *ytes direct addressing area. "he S>< .emory .ap in sho s that. -ot all of the addresses are occupied. 4noccupied addresses are not implemented on the chip. <ead accesses to these addresses in general return random data, and accesses have no effect. 4ser soft are should not that case, the reset or inactive values of the ne values ill be (. "he functions of the S><'s are outlined in the follo ing sections. bits locations, since they may be used in future microcontrollers to invo+e ne rite rite (s to these unimplemented features. 2n ill al ays be ), and their active

Accu&u#%tor 0ACC2 /88 is the /ccumulator register. "he mnemonics for /ccumulator-specific instructions, ho ever, refer to the /ccumulator simply as /. B R"! *t"r 0B2 "he * register is used during multiply and divide operations. >or other instructions it can be treated as another scratch pad register. Pro!r%& St%tu* Word 0PSW2 "he PSI register contains program status information. St%c$ Po nt"r 0SP2 "he Stac+ Pointer <egister is eight bits ide. 2t is incremented before data is stored during P4S9 and 8/;; e&ecutions. Ihile the stac+ may reside any here in on chip </., the Stac+ Pointer is initiali:ed to )59 after a reset. "his causes the stac+ to begin at location )09. D%t% Po nt"r 0DPTR2 "he Data Pointer consists of a high byte (DP9) and a lo bit registers. S"r %# D%t% Bu''"r 0SBUF2 "he Serial Data *uffer is actually t o separate registers, a transmit buffer and a receive buffer register. Ihen data is moved to S*4>, it goes to the transmit buffer, data is moved from S*4>, it comes from the receive buffer. T &"r R"! *t"r* <egister pairs ("9), ";)) and ("9(, ";() are the ($-bit 8ounter registers for "imer?8ounters ) and (, respectively. Contro# R"! *t"r* Special >unction <egisters 2P, 2!, ".CD, "8C-, S8C-, and P8C- contain control and status bits for the interrupt system, the "imer?8ounters, and the serial port. TIMER3COUNTERS here it is held for serial transmission. (.oving a byte to S*4> initiates the transmission.) Ihen byte (DP;). 2ts function is to hold a ($-bit address. 2t may be manipulated as a ($-bit register or as t o independent 0-

"he 2S0,8%( has t o ($-bit "imer?8ounter registers: "imer ) and "imer (. /ll t o can be configured to operate either as "imers or event counters. /s a "imer, the register is incremented every machine cycle. "hus, the register counts machine cycles. Since a machine cycle consists of (7 oscillator periods, the count rate is (?(7 of the oscillator fre#uency. /s a 8ounter, the register is incremented in response to a (-to-) transition at its corresponding e&ternal input pin, ") and "(. "he e&ternal input is sampled during S%P7 of every machine cycle. Ihen the samples sho a high in one cycle and a lo in the ne&t cycle, the count is incremented. "he ne of the cycle follo ing the one in count value appears in the register during S1P( as detected. Since t o machine hich the transition

cycles (76 oscillator periods) are re#uired to recogni:e a (-to-) transition, the ma&imum count rate is (?76 of the oscillator fre#uency. "here are no restrictions on the duty cycle of the e&ternal input signal, but it should be held for at least one full machine cycle to ensure that a given level is sampled at least once before it changes. 2n addition to the "imer or 8ounter functions, "imer ) and "imer ( have four operating modes: (1-bit timer, ($-bit timer, 0-bit auto-reload, split timer. "2.!<S:

CS82;;/"C< ><!O4!-8Q

(7D
"< ";A "9A ">A

SFR?S USED IN TIMERS "he special function registers used in timers are, ".CD <egister "8C- <egister

"imer(")) G timer("() <egisters

0 2 TMOD R"! *t"r: ".CD is dedicated solely to the t o timers (") G "(). "he timer mode S>< is used to configure the mode of operation of each of the t o timers. 4sing this S>< your program may configure each timer to be a ($-bit timer, or (1 bit timer, 0-bit auto reload timer, or t o separate timers. /dditionally you may configure the timers to only count hen an e&ternal pin is activated or to count ReventsD that are indicated on an e&ternal pin. 2t can consider as t o duplicate 6-bit registers, each of of one of the timers. 0 2 TCON R"! *t"r: "he timer control S>< is used to configure and modify the 0)%('s t o timers operate. "his S>< controls ay in hich the hether each of the t o timers is hich controls the action

running or stopped and contains a flag to indicate that each timer has overflo ed. /dditionally, some non-timer related bits are located in "8C- S><. "hese bits are used to configure the ay in hich the e&ternal interrupt flags are

activated, hich are set hen an e&ternal interrupt occurs.

0 2 TIMER ; 0T;2: "C ("imer ) lo ?high, address 0/?08 h) "hese t o S><'s ta+en together represent timer ). "heir e&act behavior depends on ho the timer is configured in the ".CD S><K ho ever, these timers al ays count up. Ihat is configurable is ho and hen they increment in value.
" 9) " ;)

0 72 TIMER 4 0T42: "( ("imer ( ;o ?9igh, address 0*? 0D h)

"hese t o S><'s, ta+en together, represent timer (. "heir e&act behavior depends on ho the timer is configured in the ".CD S><K ho ever, these timers al ays count up. Ihat is 8onfigurable is ho and hen they increment in value.
"9( ";(

"he "imer or 8ounter function is selected by control bits 8?" in the Special >unction <egister ".CD. "hese t o "imer?8ounters have four operating modes, "imer?8ounters, but .ode 1 is different. "he four modes are described in the follo ing sections. Mod" ;: *oth "imers in .ode ) are 0-bit 8ounters ith a divide-by-17 pre scalar. >igure 0 sho s the .ode ) operation as it applies to "imer (. 2n this mode, the "imer register is configured as a (1-bit register. /s the count rolls over from all (s to all )s, it sets the "imer interrupt flag ">(. "he counted input is enabled to the "imer e&ternal input 2-"(, to facilitate pulse hen "<( N ( and either G/"! N ) or 2-"( N (. Setting G/"! N ( allo s the "imer to be controlled by idth measurements. "<( is a control bit in the Special >unction <egister "8C-. Gate is in ".CD. "he (1-bit register consists of all eight bits of "9( and the lo er five bits of ";(. "he upper three bits of ";( are indeterminate and should be ignored. Setting the run flag ("<() does not clear the registers. .ode ) operation is the same for "imer ) as for "imer (, e&cept that "<), ">) and 2-") replace the corresponding "imer ( signals. "here are t o different G/"! bits, one for "imer ( (".CD.5) and one for "imer ) (".CD.1). Mod" 4 .ode ( is the same as .ode ), e&cept that the "imer register is run bits. "he cloc+ is applied to the combined high and lo occurs on the >>>>9-to-))))9 overflo Mod" < ith all ($ timer registers (";(?"9(). /s hich are selected by bit pairs (.(, .)) in ".CD. .odes ), (, and 7 are the same for both

cloc+ pulses are received, the timer counts up: ))))9, )))(9, )))79, etc. /n overflo flag. "he timer continues to count. "he overflo flag is the ">( bit in "8C- that is read or ritten by soft are

.ode 7 configures the "imer register as an 0-bit 8ounter (";() reload, as sho n in >igure (). Cverflo ";( ith the contents of "9(,

ith automatic

from ";( not only sets ">(, but also reloads

hich is preset by soft are. "he reload leaves the "9(

unchanged. .ode 7 operation is the same for "imer?8ounter ). Mod" = "imer ( in .ode 1 simply holds its count. "he effect is the same as setting "<( N ). "imer ) in .ode 1 establishes ";)and "9) as t o separate counters. "he logic for .ode 1 on "imer ) is sho n in >igure ((. ";) uses the "imer ) control bits: 8?", G/"!, "<), 2-"), and ">). "9) is loc+ed into a timer function (counting machine cycles) and over the use of "<( and ">( from "imer (. "hus, "9) no "imer ( interrupt. .ode 1 is for applications re#uiring an e&tra 0-bit timer or counter. Iith "imer ) in .ode 1, the /"0,8%( can appear to have three "imer?8ounters. Ihen "imer ) is in .ode 1, "imer ( can be turned on and off by s itching it out of and into its o n .ode 1. 2n this case, "imer ( can still be used by the serial port as a baud rate generator or in any application not re#uiring an interrupt. INTERRUPT SYSTEM /n interrupt is an e&ternal or internal event that suspends the operation of micro controller to inform it that a device needs its service. 2n interrupt method, signal. 4pon receiving an interrupt signal, the micro controller interrupts doing and serves the device. "he program associated *"r7 c" *u(rout n" 0ISR)..ain advantage serve many devices. B%ud R%t" "he baud rate in .ode ) is fi&ed as sho n in the follo ing e#uation. .ode ) *aud <ate N Cscillator >re#uency ?(7 the baud rate in .ode 7 depends on the value of the S.CD bit in Special >unction <egister P8C-. 2f S.CD N ) the baud rate is (?$6 of the oscillator fre#uency. 2f S.CD N (, the baud rate is (?17 of the oscillator fre#uency. .ode 7 *aud <ate N 7S.CD& (Cscillator >re#uency)?$6. henever any hatever it is device needs its service, the device notifies the micro controller by sending it an interrupt ith interrupt is called as nt"rru+t controls the

ith interrupts is that the micro controller can

2n the 2S0,8%(, the "imer ( overflo rate determines the baud rates in .odes ( and 1. NUMBER OF INTERRUPTS IN 89C:4: "here are basically five interrupts available to the user. <eset is also considered as an interrupt. "here are t o interrupts for timer, t o interrupts for e&ternal hard are interrupt and one interrupt for serial communication. .emory location ))))9 )))19 )))*9 ))(19 ))(*9 ))719 2nterrupt name <eset !&ternal interrupt ) "imer interrupt ) !&ternal interrupt ( "imer interrupt ( Serial 8C. interrupt

;o er the vector, higher the priority. "he !&ternal 2nterrupts 2-") and 2-"( can each be either level-activated or transition-activated, depending on bits 2") and 2"( in <egister "8C-. "he flags that actually generate these interrupts are the 2!) and 2!( bits in "8C-. Ihen the service routine is vectored, hard are clears the flag that generated an e&ternal interrupt only if the interrupt controls the re#uest flag. "he "imer ) and "imer ( 2nterrupts are generated by ">)and ">(, hich are set by a rollover in their respective "imer?8ounter registers (e&cept for "imer ) in .ode 1).Ihen a timer interrupt is generated, the on-chip hard are clears the flag that is generated. "he Serial Port 2nterrupt is generated by the logical C< of <2 and "2. "he service routine normally must determine must be cleared in soft are. /ll of the bits that generate interrupts can be set or cleared by soft are, generated and pending interrupts can be canceled in soft are. !ach of these interrupt sources can be individually enabled or disabled by setting or clearing a bit in Special >unction <egister 2! (interrupt enable) at address )/09. ith the same result as though they had been set or cleared by hard are. "hat is, interrupts can be hether <2 or "2 generated the interrupt, and the bit as transition-activated. 2f the interrupt as level-activated, then the e&ternal re#uesting source (rather than the on-chip hard are)

"here is a global enable?disable bit that is cleared to disable all interrupts or to set the interrupts. IE 0Int"rru+t "n%(#" r"! *t"r2: St"+* n "n%(# n! %n nt"rru+t: *it D5 of the 2! register must be set to high to allo in 2! are high. 2f !/N), no interrupt 2! register is high. D"*cr +t on o' "%c, ( t n IE r"! *t"r: D5 bit: Disables all interrupts. 2f !/ N), no interrupt is ac+no ledged, if !/N( each interrupt source is individually enabled or disabled by setting or clearing its enable bit. D$ bit: <eserved. D% bit: !nables or disables timer 7 over flo interrupt (in 0)%7). D6 bit: !nables or disables serial port interrupt. D1 bit: !nables or disables timer ( over flo interrupt. D7 bit: !nables or disables e&ternal interrupt (. D( bit: !nables or disables timer ) over flo interrupt. D) bit: !nables or disables e&ternal interrupt ). Int"rru+t +r or t) n 89C:4: "here is one more S<> to assign priority to the interrupts hich is named as interrupt priority (2P). 4ser has given the provision to assign priority to one interrupt. Iriting one to that particular bit in the 2P register fulfils the tas+ of assigning the priority. D"*cr +t on o' "%c, ( t n IP r"! *t"r: D5 bit: <eserved. D$ bit: <eserved. D% bit: "imer 7 interrupt priority bit (in 0)%7). D6 bit: Serial port interrupt priority bit. D1 bit: "imer ( interrupt priority bit. D7 bit: !&ternal interrupt ( priority bit. the rest of register to ta+e effect. 2f !/N(, interrupts are enabled and ill be responded to if their corresponding bits ill be responded to even if the associated bit in the

D( bit: "imer ) interrupt priority bit. D) bit: !&ternal interrupt ) priority bit.

POWER SUPPLY: B#oc$ d %!r%&:

F !ur": Po-"r Su++#)

C rcu td %!r%&:

D"*cr +t on: Tr%n*'or&"r:

/ tr%n*'or&"r is a device that transfers electrical energy from one circuit to another through inductively coupled conductorsSthe transformerFs coils. / varying current in the first or primary inding creates a varying magnetic flu& in the transformerFs core, and thus a varying magnetic field through the secondary inding. "his varying magnetic field induces a varying electromotive force (!.>) or BvoltageB in the secondary inding. "his effect is called mutual induction.

F !ur": Tr%n*'or&"r S)&(o# 0or2 "ransformer is a device that converts the one form energy to another form of energy li+e a transducer.

F !ur": Tr%n*'or&"r B%* c Pr nc +#" :

/ transformer ma+es use of >aradayFs la

and the ferromagnetic properties of an iron

core to efficiently raise or lo er /8 voltages. 2t of course cannot increase po er so that if the voltage is raised, the current is proportionally lo ered and vice versa.

F !ur": B%* c Pr nc +#"

Tr%n*'or&"r Wor$ n!:

/ transformer consists of t o coils (often called F indingsF) lin+ed by an iron core, as sho n in figure belo . "here is no electrical connection bet een the coils, instead they are lin+ed by a magnetic field created in the core.

F !ur": B%* c Tr%n*'or&"r "ransformers are used to convert electricity from one voltage to another loss of po er. "hey only or+ ith minimal

ith /8 (alternating current) because they re#uire a

changing magnetic field to be created in their core. "ransformers can increase voltage (step-up) as ell as reduce voltage (step-do n). /lternating current flo ing in the primary (input) coil creates a continually changing magnetic field in the iron core. "his field also passes through the secondary (output) coil and the changing strength of the magnetic field induces an alternating voltage in the secondary coil. 2f the secondary coil is connected to a load the induced voltage electromotive forceF hich is usually abbreviated to induced e.m.f. "he iron core is laminated to prevent Feddy currentsF flo ing in the core. "hese are currents produced by the alternating magnetic field inducing a small voltage in the core, 3ust li+e that induced in the secondary coil. !ddy currents aste po er by needlessly heating up the core but they are reduced to a negligible amount by laminating the iron ill ma+e an induced current flo . "he correct term for the induced voltage is Finduced

because this increases the electrical resistance of the core properties.

ithout affecting its magnetic

"ransformers have t o great advantages over other methods of changing voltage: (. "hey provide total electrical isolation bet een the input and output, so they can be safely used to reduce the high voltage of the mains supply. 7. /lmost no po er is asted in a transformer. "hey have a high efficiency (po er out ? po er in) of ,%H or more. C#%** ' c%t on o' Tr%n*'or&"r: Step-4p "ransformer Step-Do n "ransformer St"+5Do-n Tr%n*'or&"r: Step do n transformers are designed to reduce electrical voltage. "heir primary voltage is greater than their secondary voltage. "his +ind of transformer Bsteps do nB the voltage applied to it. >or instance, a step do n transformer is needed to use a (()v product in a country ith a 77)v supply. Step do n transformers convert electrical voltage from one level or phase configuration usually do n to a lo er level. "hey can include features for electrical isolation, po er distribution, and control and instrumentation applications. Step do n transformers typically rely on the principle of magnetic induction bet een coils to convert voltage and?or current levels. Step do n transformers are made from t o or more coils of insulated ire ound around a core made of iron. Ihen voltage is applied to one coil (fre#uently called the primary or input) it magneti:es the iron core, hich induces a voltage in the other coil, (fre#uently indings determines called the secondary or output). "he turn's ratio of the t o sets of the amount of voltage transformation.

F !ur": St"+5Do-n Tr%n*'or&"r /n e&ample of this ratio of 7 to (. St"+ do-n tr%n*'or&"r* c%n (" con* d"r"d not, n! &or" t,%n % 7o#t%!" r%t o d"7 c". Iith step do n transformers the voltage ratio bet een primary and secondary ill mirror the Bturn's ratioB (e&cept for single phase smaller than ( +va secondary). / practical application of this 7 to ( turn's ratio voltage step do n. -ote that if the input volts. "he ratio bet een input and output voltage hich have compensated ould be a 60) to 76) ould be 77) ould be: ()) turns on the primary and %) turns on the secondary, a

ere 66) volts then the output

ill stay constant. "ransformers should

not be operated at voltages higher than the nameplate rating, but may be operated at lo er voltages than rated. *ecause of this it is possible to do some non-standard applications using standard transformers. Single phase step do n transformers ( +va and larger may also be reverse connected to step-do n or step-up voltages. (-ote: single phase step up or step do n transformers si:ed less than ( @=/ should not be reverse connected because the secondary have additional turns to overcome a voltage drop connected, the output voltage ill be less than desired.) St"+5U+ Tr%n*'or&"r: indings hen the load is applied. 2f reverse

/ step up transformer has more turns of ire on the secondary coil, hich ma+es a larger induced voltage in the secondary coil. 2t is called a step up transformer because the voltage output is larger than the voltage input. Step-up transformer (()v 77)v design is one hose secondary voltage is greater than its ith a (()v

primary voltage. "his +ind of transformer Bsteps upB the voltage applied to it. >or instance, a step up transformer is needed to use a 77)v product in a country supply. / step up transformer (()v 77)v converts alternating current (/8) from one voltage to another voltage. 2t has no moving parts and or+s on a magnetic induction principleK it can be designed to Bstep-upB or Bstep-do nB voltage. So a step up transformer increases the voltage and a step do n transformer decreases the voltage. "he primary components for voltage transformation are the step up transformer core and coil. "he insulation is placed bet een the turns of ire to prevent shorting to one another or to ground. "his is typically comprised of .ylar, nome&, @raft paper, varnish, or other materials. /s a transformer has no moving parts, it bet een 7) and 7% years. ill typically have a life e&pectancy

F !ur": St"+5U+ Tr%n*'or&"r A++# c%t on* Generally these St"+5U+ Tr%n*'or&"r* are used in industries applications only.

Turn* R%t o %nd Vo#t%!" "he ratio of the number of turns on the primary and secondary coils determines the ratio of the voltages...

... here =p is the primary (input) voltage, = s is the secondary (output) voltage, - p is the number of turns on the primary coil, and -s is the number of turns on the secondary coil. D od"*: Diodes allo electricity to flo in only one direction. "he arro of the circuit symbol

sho s the direction in

hich the current can flo . Diodes are the electrical version of a

valve and early diodes ere actually called valves.

F !ur": D od" S)&(o# / d od" is a device there hich only allo s current to flo through it in one direction. 2n this

direction, the diode is said to be Ffor ard-biasedF and the only effect on the signal is that ill be a voltage loss of around ).5=. 2n the opposite direction, the diode is said to be Freverse-biasedF and no current ill flo through it. R"ct ' "r "he purpose of a rectifier is to convert an /8 aveform into a D8 aveform (C<)

<ectifier converts /8 current or voltages into D8 current or voltage. "here are t o

different rectification circuits, +no n as @,%#'5-%7"@ and @'u##5-%7"@ r"ct ' "r*. *oth use components called d od"* to convert AC nto DC. The Half-wave Rectifier "he half- ave rectifier is the simplest type of rectifier since it only uses one diode, as sho n in figure .

F !ur": H%#' W%7" R"ct ' "r >igure 7 sho s the /8 input can see, aveform to this circuit and the resulting output. /s you

hen the /8 input is positive, the diode is for ard-biased and lets the current

through. Ihen the /8 input is negative, the diode is reverse-biased and the diode does not let any current through, meaning the output is )=. *ecause there is a ).5= voltage loss across the diode, the pea+ output voltage ill be ).5= less than =s.

F !ur": H%#'5W%7" R"ct ' c%t on Ihile the output of the half- ave rectifier is D8 (it is all positive), it ould not be

suitable as a po er supply for a circuit. >irstly, the output voltage continually varies bet een )= and =s-).5=, and secondly, for half the time there is no output at all. The Full-wave Rectifier "he circuit in figure 1 addresses the second of these problems since at no time is the output voltage )=. "his time four diodes are arranged so that both the positive and negative parts of the /8 sho n in figure 6. aveform are converted to D8. "he resulting aveform is

F !ur": Fu##5W%7" R"ct ' "r

F !ur": Fu##5W%7" R"ct ' c%t on Ihen the /8 input is positive, diodes / and * are for ard-biased, hile diodes 8 and D are reverse-biased. Ihen the /8 input is negative, the opposite is true - diodes 8 and D are for ard-biased, hile diodes / and * are reverse-biased. Ihile the full- ave rectifier is an improvement on the half- ave rectifier, its output still isnFt suitable as a po er supply for most circuits since the output voltage still varies bet een )= and =s-(.6=. So, if you put (7= /8 in, you ill ().$= D8 out.

C%+%c tor F #t"r "he c%+%c tor5 n+ut ' #t"r, also called BPiB filter due to its shape that loo+s li+e the Gree+ letter pi, is a type of electronic filter. >ilter circuits are used to remove un anted or undesired fre#uencies from a signal.

F !ur": C%+%c tor F #t"r / typical capacitor input filter consists of a filter capacitor 8(, connected across the rectifier output, an inductor ;, in series and another filter capacitor connected across the load. (. "he capacitor 8( offers lo reactance to the /8 component of the rectifier output hile the D8 component

hile it offers infinite reactance to the D8 component. /s a result the capacitor shunts an appreciable amount of the /8 component continues its 3ourney to the inductor ; 7. "he inductor ; offers high reactance to the /8 component but it offers almost :ero reactance to the D8 component. /s a result the D8 component flo s through the inductor hile the /8 component is bloc+ed. 1. "he capacitor 87 bypasses the /8 component hich the inductor had failed to bloc+. /s a result only the D8 component appears across the load <;.

F !ur": C"nt"r"d T%++"d Fu##5W%7" R"ct ' "r - t, % C%+%c tor F #t"r

Vo#t%!" R"!u#%tor: / 7o#t%!" r"!u#%tor is an electrical regulator designed to automatically maintain a constant voltage level. 2t may use an electromechanical mechanism, or passive or active electronic components. Depending on the design, it may be used to regulate one or more /8 or D8 voltages. "here are t o types of regulator are they. Positive =oltage Series (50&&) and -egative =oltage Series (5,&&) A866:'50' indicate the positive series and T&&'indicates the voltage rating. Suppose 50)% produces the ma&imum %=.')%'indicates the regulator output is %=. A966:'50' indicate the negative series and T&&'indicates the voltage rating. Suppose 5,)% produces the ma&imum -%=.')%'indicates the regulator output is -%=. "hese regulators consists the three pins there are P n4: 2t is used for input pin. P n<: "his is ground pin for regulator

P n=: 2t is used for output pin. "hrough this pin e get the output.

F !ur": R"!u#%tor

SERIAL COMMUNICATION THEORY: 2n order to connect micro controller to a modem or a pc to modem a serial port is used. Serial is a very common protocol for device communication that is standard on almost every P8. .ost computers include t o <S-717 based serial ports. Serial is also a common communication protocol that is used by many devices for instrumentationK numerous GP2*-compatible devices also come device. "he concept of serial communication is simple. "he serial port sends and receives bytes of information one bit at a time. /lthough this is slo er than parallel communication, hich allo s the transmission of an entire byte at once, it is simpler and can be used over longer distances. >or e&ample, the 2!!! 600 specifications for parallel communication state that the cabling bet een e#uipment can be no more than 7) meters total, ith no more than 7 meters bet een any t o devices. Serial, ho ever, can e&tend "ypically, serial is used to transmit /S822 data. 8ommunication is completed using 1 transmission lines: (() Ground, (7) "ransmit, and (1) <eceive. Since serial is as much as (7)) meters. ith an <S-717 port. >urthermore, serial ith a remote sampling communication can be used for data ac#uisition in con3unction

asynchronous, the port is able to transmit data on one line

hile receiving data on

another. Cther lines are available for handsha+ing, but are not re#uired. "he important serial characteristics are baud rate, data bits, stop bits, and parity. >or t o ports to communicate, these parameters must match. B%ud r%t": 2t is a speed measurement for communication. 2t indicates the number of

bit transfers per second. >or e&ample, 1)) baud is 1)) bits per second. Ihen a cloc+ cycle is referred it means the baud rate. >or e&ample, if the protocol calls for a 60)) baud rate, then the cloc+ is running at 60))9:. "his means that the serial port is sampling the data line at 60))9:. 8ommon baud rates for telephone lines are (66)), 700)), and 11$)). *aud rates greater than these are possible, but these rates reduce the distance by hich devices can be separated. "hese high baud rates are used for device communication here the devices are located together, as is typically the case ith GP2* devices. D%t% ( t*: .easurement of the actual data bits in a transmission. Ihen the computer hat

sends a pac+et of information, the amount of actual data may not be a full 0 bits. Standard values for the data pac+ets are %, 5, and 0 bits. Ihich setting chosen depends on information transferred. >or e&ample, standard /S822 has values from ) to (75 (5 bits). !&tended /S822 uses ) to 7%% (0 bits). 2f the data being transferred is simple te&t (standard /S822), then sending 5 bits of data per pac+et is sufficient for communication. / pac+et refers to a single byte transfer, including start?stop bits, data bits, and parity. Since the number of actual bits depend on the protocol selected, the term pac+et is used to cover all instances. Sto+ ( t*: used to signal the end of communication for a single pac+et. "ypical values are (, (.%, and 7 bits. Since the data is cloc+ed across the lines and each device has its o n cloc+, it is possible for the t o devices to become slightly out of sync. "herefore, the stop bits not only indicate the end of transmission but also give the computers some room for error in the cloc+ speeds. "he more bits that are used for stop bits, the greater the lenience in synchroni:ing the different cloc+s, but the slo er the data transmission rate.

P%r t): / simple form of error chec+ing that is used in serial communication. "here are four types of parity: even, odd, mar+ed, and spaced. "he option of using no parity is also available. >or even and odd parity, the serial port sets the parity bit (the last bit after the data bits) to a value to ensure that the transmission has an even or odd number of logic high bits. >or e&ample, if the data is )((, then for even parity, the parity bit is ) to +eep the number of logic-high bits even. 2f the parity is odd, then the parity bit is (, resulting in 1 logic-high bits. .ar+ed and spaced parity does not actually chec+ the data bits, but simply sets the parity bit high for mar+ed parity or lo receiving device to +no WHAT IS RS B<=<C <S-717 (/-S2?!2/-717 Standard) is the serial connection found on 2*.compatible P8s. 2t is used for many purposes, such as connecting a mouse, printer, or modem, as ell as industrial instrumentation. *ecause of improvements in line drivers and cables, applications often increase the performance of <S-717 beyond the distance and speed listed in the standard. <S-717 is limited to point-to-point connections bet een P8 serial ports and devices. <S-717 hard are can be used for serial communication up to distances of %) feet . for spaced parity. "his allo s the the state of a bit to enable the device to determine if noise is

corrupting the data or if the transmitting and receiving device cloc+s are out of sync.

DB59 + n conn"ctor (716% $50, (Cut of computer and e&posed end of cable)

P n Funct on*: Data: 9andsha+e: "&D on pin 1, <&D on pin 7 <"S on pin 5, 8"S on pin 0, DS< on pin $,

8D on pin (, D"< on pin 6 8ommon: Cther: 8ommon pin %(ground) <2 on pin ,

"he method used by <S-717 for communication allo s for a simple connection of three lines: "&, <&, and Ground. "he three essential signals for 7 ay <S-717 8ommunications are these: T>D: carries data from D"! to the D8!. R>D: carries data from D8! to the D"! SG: signal ground Conn"ct on D %!r%&:

"AD

<AD "AD

7 1 %

!mbedded 8ontroller

<AD G-D

./A 717

F !ur".: Int"r'%c n! to MCU RS <=< SFR* U*"d 'or S"r %# Co&&un c%t on: SCON:
S.7 S.( S.) <!"*0 <*0

"2

<2

TMOD:

T4:
"9( ";(

CONNECTIONS IN MA> <=<: 2f you anted to do a general <S-717 connection, you could ta+e a bunch of long ires and solder them directly to the electronic circuits of the e#uipment you are using, but this tends to ma+e a big mess and often those solder connections tend to brea+ and other problems can develop. "o deal ith these issues, and to ma+e it easier to setup or ta+e do n e#uipment, some standard connectors have been developed that is commonly found on most e#uipment using the <S-717 standards. "hese connectors come in t o forms: / male and a female connector. "he female connector has holes that allo the pins on the male end to be inserted into the connector. "his is a female BD*-,B connector (properly +no n as D!,>):

F"&%#" Conn"ctor "he female D*-, connector is typically used as the BplugB that goes into a typical P8. 2f you see one of these on the bac+ of your computer, it is li+ely not to be used for serial communication, but rather for things li+e early =G/ or 8G/ monitors (not S=G/) or for some special control?3oystic+ e#uipment. /nd this is a male BD*-,B connector (properly +no n as D!,.):

M%#" Conn"ctor "his is the connector that you are more li+ely to see for serial communications on a BgenericB P8. Cften you ill see t o of them side by side (for 8C.( and 8C.7). ith ould have either connector, or Special e#uipment that you might communicate even one of the D*-7% connectors listed belo . "he iring of <S-717 devices involves first identifying the actual pins that are being

used. 9ere is ho a female D*-, connector is numbered:

>igure.: >ront =ie 2f the numbers are hard to read, it starts at the top-right corner as B(B, and goes left until the end of the ro and then starts again as pin $ on the ne&t ro until you get to pin , on the bottom-left pin. B"opB is defined as the ro "he male connector (li+e reversed from right to left. 9ere each pin is usually defined as: ,-pin ( 7 7%-pin pin definition 0 D8D (Data 8arrier Detect) 1 <A (<eceive Data) ith % pins.

hat you have on your P8) is simply this same order, but

1 6 % $ 5 0 ,

7 7) 5 $ 6 % 77

"A ("ransmit Data) D"< (Data "erminal <eady) G-D (Signal Ground) DS< (Data Set <eady) <"S (<e#uest "o Send) 8"S (8lear "o Send)) <2 (<ing 2ndicator)

P n D"' n t on o' Conn"ctor* Cne thing to +eep in mind very closely tied together theoretical level. MA><=<: .a& 717 is a communications device used mainly for serial commands to and from a flash <C.."he MA><=< is an integrated circuit that converts signals from an <S-717 serial port to signals suitable for use in ""; compatible digital logic circuits. "he ./A717 is a dual driver?receiver and typically converts the <A, "A, 8"S and <"S signals. "he drivers provide <S-717 voltage level outputs (appro&. U 5.% =) from a single V % = supply via on-chip charge pumps and e&ternal capacitors. "his ma+es it useful for implementing <S-717 in devices that other ise do not need any voltages outside the ) = to V % = range, as po er supply design does not need to be made more complicated 3ust for driving the <S-717 in this case. "he receivers reduce <S-717 inputs ( hich may be as high as U 7% =), to standard % = ""; levels. "hese receivers have a typical threshold of (.1 =, and a typical hysteresis of ).% =. "he later ./A717/ is bac+ ards compatible the (.) W> capacitors used ith the original device. ith the original ./A717 but may hen discussing these pins and their meaning is that they are ith modems and modem protocols. Cften you donFt have a ere a modem on a

modem attached in the loop, but you still treat the e#uipment as if it

operate at higher baud rates and can use smaller e&ternal capacitors L ).( W> in place of

"he ne er ./A1717 is also bac+ ards compatible, but operates at a broader voltage range, from 1 to %.%=. Vo#t%!" #"7"#* 2t is helpful to understand hat occurs to the voltage levels. Ihen a ./A717 28

receives a ""; level to convert, it changes a ""; ;ogic ) to bet een V1 and V(%=, and changes ""; ;ogic ( to bet een -1 to -(%=, and vice versa for converting from <S717 to "";. "his can be confusing hen you reali:e that the <S717 Data "ransmission voltages at a certain logic state are opposite from the <S717 8ontrol ;ine voltages at the same logic state. "o clarify the matter, see the table belo . >or more information see <S717 =oltage ;evels. RS<=< Vo#t%!" -1= to -(%= -1= to -(%= TTL Vo#t%!" to3'ro&

RS<=< L n" T)+" C Lo! c L"7"# Data "ransmission (<&?"&) ;ogic ) Data "ransmission (<&?"&) ;ogic ( 8ontrol ;ogic ) 8ontrol ;ogic ( Signals (<"S?8"S?D"<?DS<) Signals (<"S?8"S?D"<?DS<)

MA><=< %= %=

V1= to V(%= )=

V1= to V(%= )= ith P8 or any <S7178 Standard

Standard serial interfacing of microcontroller ("";)

device , re#uires ""; to <S717 ;evel converter . / ./A717 is used for this purpose. 2t provides 7-channel <S7178 port and re#uires e&ternal ()u> capacitors. "he driver re#uires a single supply of V%=.

F !ur" 4D:Int"rn%# D %!r%& F !ur" 4=:MA> <=< P n D %!r%&

GSM : D"' n t on o' GSM: GS. (Global System for .obile communications) is an open, digital cellular technology used for transmitting mobile voice and data services. GS. (Global System for .obile communication) is a digital mobile telephone system that is digital idely used in !urope and other parts of the orld. GS. uses a variation idely used of the three of "ime Division .ultiple /ccess ("D./) and is the most compresses data, then sends it do n a channel

ireless telephone technologies ("D./, GS., and 8D./). GS. digiti:es and ith t o other streams of user data, each ith the

in its o n time slot. 2t operates at either the ,)) .9: or (,0)) .9: fre#uency band. 2t supports voice calls and data transfer speeds of up to ,.$ +bit?s, together transmission of S.S (Short .essage Service).

H *tor) 2n (,07, the !uropean 8onference of Postal and "elecommunications /dministrations (8!P") created the Group Special .obile (GS.) to develop a standard for a mobile telephone system that could be used across !urope. 2n (,05, a memorandum of understanding as signed by (1 countries to develop a common cellular telephone system across !urope. >inally the system created by S2-"!> lead by "orleiv .aseng as selected. 2n (,0,, GS. responsibility as transferred to the !uropean "elecommunications Standards 2nstitute (!"S2) and phase 2 of the GS. specifications ere published in (,,). "he first GS. net or+ as launched in (,,( by <adiolin3a in ere using GS. phone net or+s >inland ith 3oint technical infrastructure maintenance from !ricsson. *y the end of (,,1, over a million subscribers being operated by 5) carriers across 60 countries. /s of the end of (,,5, GS. service as available in more than ()) countries and has become the de facto standard in !urope and /sia. GSM Fr"Eu"nc "* GS. net or+s operate in a number of different fre#uency ranges (separated into GS. fre#uency ranges for 7G and 4."S fre#uency bands for 1G). .ost 7G GS. net or+s operate in the ,)) .9: or (0)) .9: bands. Some countries in the /mericas (including 8anada and the 4nited States) use the 0%) .9: and (,)) .9: bands because the ,)) and (0)) .9: fre#uency bands ere already allocated. .ost 1G GS. net or+s in !urope operate in the 7()) .9: fre#uency band. "he rarer 6)) and 6%) .9: fre#uency bands are assigned in some countries used for first-generation systems. GS.-,)) uses 0,)L,(% .9: to send information from the mobile station to the base station (uplin+) and ,1%L,$) .9: for the other direction (do nlin+), providing (76 <> channels (channel numbers ( to (76) spaced at 7)) +9:. Duple& spacing of 6% .9: is used. 2n some countries the GS.-,)) band has been e&tended to cover a larger fre#uency range. "his Fe&tended GS.F, !-GS., uses 00)L,(% .9: (uplin+) and ,7%L here these fre#uencies ere previously

,$) .9: (do nlin+), adding %) channels (channel numbers ,5% to ()71 and )) to the original GS.-,)) band. "ime division multiple&ing is used to allo eight burst periods) grouped into eight full-rate or si&teen half-rate speech channels per radio fre#uency channel. "here are eight radio timeslots (giving hat is called a "D./ frame. 9alf rate channels use alternate frames in the same timeslot. "he channel data rate for all 0 channels is 75).011 @bit?s, and the frame duration is 6.$(% ms. "he transmission po er in the handset is limited to a ma&imum of 7 GS.0%)?,)) and ( atts in att in GS.(0))?(,)). GS. operates in the ,)).9: and (.0G9:

bands in !urope and the (.,G9: and 0%).9: bands in the 4S. "he 0%).9: band is also used for GS. and 1G in /ustralia, 8anada and many South /merican countries. *y having harmoni:ed spectrum across most of the globe, GS.'s international roaming capability allo s users to access the same services countries. "errestrial GS. net or+s no coverage is not available. Mo( #" T"#"+,on) St%nd%rd* cover more than 0)H of the orld's population. here terrestrial GS. satellite roaming has also e&tended service access to areas hen travelling abroad as at home. "his gives consumers seamless and same number connectivity in more than 7(0

4G "he first generation of mobile telephony ( ritten 4G) operated using analogue communications and portable devices that follo ing standards: ere relatively large. 2t used primarily the

AMPS (/dvanced .obile Phone System), States,

hich appeared in (,5$ in the 4nited as used primarily in the ea+

as the first cellular net or+ standard. 2t

/mericas, <ussia and /sia. "his first-generation analogue net or+ had security mechanisms hich allo ed hac+ing of telephones lines.

TACS ("otal /ccess 8ommunication System) is the !uropean version of the /.PS model. 4sing the ,)) .9: fre#uency band, this system in !ngland and then in /sia (9ong-@ong and Japan). as largely used

ETACS (!&tended "otal /ccess 8ommunication System) is an improved version of the "/8S standard developed in the 4nited @ingdom that uses a larger number of communication channels.

"he first-generation cellular net or+s entirely digital second generation.

ere made obsolete by the appearance of an

S"cond G"n"r%t on o' Mo( #" N"t-or$* 0<G2 "he second generation of mobile net or+s mar+ed a brea+ standards are: GS. (Global System for Mobile communications) is the most commonly used standard in !urope at the end of the 7)th century and supported in the 4nited States. "his standard uses the ,)) .9: and (0)) .9: fre#uency bands in !urope. 2n the 4nited States, ho ever, the fre#uency band used is the (,)) .9: band. Portable telephones that are able to operate in !urope and the 4nited States are therefore called tr 5(%nd. CDMA (Code Division Multiple Access) uses a spread spectrum techni#ue that allo s a radio signal to be broadcast over a large fre#uency range. TDMA (Time Division Multiple Access) uses a techni#ue of time division of communication channels to increase the volume of data transmitted simultaneously. "D./ technology is primarily used on the /merican continent, in -e Xealand and in the /sia-Pacific region. Iith the 7G net or+s, it is possible to transmit voice and lo volume digital data, for ith the first generation of cellular telephones by s itching from analogue to digital. "he main 7G mobile telephony

e&ample te&t messages (SMS, for Short Message Service) or multimedia messages

(MMS, for Multimedia Message Service). "he GS. standard allo s a ma&imum data rate of ,.$ +bps. !&tensions have been made to the GS. standard to improve throughput. Cne of these is the GPRS (General Packet Radio System) service rates on the order of ((6 @bit?s but hich allo s theoretical data ith throughput closer to 6) @bit?s in practice. /s volution ) standard, billed ith its theoretical data rate

this technology does not fit ithin the B1GB category, it is often referred to as <.:G "he EDGE ( nhanced Data Rates for Global as <.A:G, #uadruples the throughput improvements of GP<S

of 106 @bps, thereby allo ing the access for multimedia applications. 2n reality, the !DG! standard allo s ma&imum theoretical data rates of 651 @bit?s, but it has been limited in order to comply ith the 2."-7))) from the (!nternational 2"4 Mobile Telecommunications"#$$$) Telecommunications %nion). =G "he 2."-7))) (!nternational Mobile Telecommunications for the year #$$$) specifications from the 2nternational "elecommunications 4nion (2"4) defined the characteristics of =G (third generation of mobile telephony). "he most important of these characteristics are: (. 9igh transmission data rate. 7. (66 @bps ith total coverage for mobile use. 1. 106 @bps ith medium coverage for pedestrian use. 6. 7 .bps ith reduced coverage area for stationary use. %. Iorld compatibility. $. 8ompatibility of 1rd generation mobile services ith second generation net or+s. 1G offers data rates of more than (66 @bit?s, thereby allo ing the access to multimedia uses such as video transmission, video-conferencing or high-speed internet access. 1G net or+s use different fre#uency bands than the previous net or+s: (00%7)7% .9: and 7(()-77)) .9:. "he main 1G standard used in !urope is called UMTS (%niversal Mobile Telecommunications System) and uses WCDMA (&ideband Code Division Multiple Access) encoding. 4."S technology uses % .9: bands for transferring voice and data, specifications (!nternational

ith data rates that can range from 106 @bps to 7 .bps. HSDPA ('igh Speed Do(nlink Packet Access) is a third generation mobile telephony protocol, (considered as B1.%GB), hich is able to reach data rates on the order of 0 to () .bps. 9SDP/ technology uses the % G9: fre#uency band and uses I8D./ encoding. Introduct on to t," GSM St%nd%rd "he GSM (Global System for Mobile communications ) net or+ is at the start of the 7(st century, the most commonly used mobile telephony standard in !urope. 2t is called as Second Generation (7G) standard because communications occur in an entirely digital mode, unli+e the first generation of portable telephones. Ihen it standardi:ed in (,07, it as first as called as Grou+ S+"c %# Mo( #" and later, it became an

international standard called FG#o(%# S)*t"& 'or Mo( #" co&&un c%t on*F in (,,(. 2n !urope, the GS. standard uses the ,)) .9: and (0)) .9: fre#uency bands. 2n the 4nited States, ho ever, the fre#uency band used is the (,)) .9: band. >or this reason, portable telephones that are able to operate in both !urope and the 4nited States are called tr 5(%nd hile those that operate only in !urope are called ( 5(%nd. "he GS. standard allo s a ma&imum throughput of ,.$ +bps hich allo s transmission of voice and lo -volume digital data li+e te&t messages (SMS, for Short Message Service) or multimedia messages (MMS, for Multimedia Message Service). GSM St%nd%rd*: GS. uses narro band "D./, hich allo s eight simultaneous calls on the same radio fre#uency. "here are three basic principles in multiple access, >D./ (>re#uency Division .ultiple /ccess), "D./ ("ime Division .ultiple /ccess), and 8D./ (8ode Division .ultiple /ccess). /ll three principles allo user sharing the common resource. "D./ allo s the users to share the same fre#uency channel by dividing the signal into different time slots. !ach user ta+es turn in a round robin fashion for transmitting and receiving over the channel. 9ere, users can only transmit in their respective time slot multiple users to ay share the same physical channel. *ut the t o competing technologies differ in the

8D./ uses a spread spectrum technology that is it spreads the information contained in a particular signal of interest over a much greater band idth than the original signal. 4nli+e "D./, in 8D./ several users can transmit over the channel at the same time.

TDMA n (r "': 2n late(,0)'s, as a search to convert the e&isting analog net or+ to digital as a means to improve capacity, the cellular telecommunications industry association chose "D./ over >D./. "ime Division .ultiple& /ccess is a type of multiple&ing here t o or more channels of information are transmitted over the same lin+ by allocating a different time interval for the transmission of each channel. "he most comple& implementation using "D./ principle is of GS.'s (Global System for .obile communication). "o reduce the effect of co-channel interference, fading and multipath, the GS. technology can use fre#uency hopping, here a call 3umps from one channel to another channel in a short interval.

"D./ systems still rely on s itch to determine

hen to perform a handoff.

9andoff occurs hen a call is s itched from one cell site to another hile travelling. "he

"D./ handset constantly monitors the signals coming from other sites and reports it to the s itch i.e., ithout caller's a areness. "he s itch then uses this information for ma+ing better choices for handoff at appropriate times. "D./ handset performs hard handoff, henever the user moves from one site to another, it brea+s the connection and then provides a ne connection ith the ne site. Ad7%nt%!"* o' TDMA: "here are lots of advantages of "D./ in cellular technologies. (. 2t can easily adapt to transmission of data as ell as voice communication. 7. 2t has an ability to carry $6 +bps to (7) .bps of data rates. "his allo s the operator to do services li+e fa&, voice band data and S.S as intensive application such as multimedia and video conferencing. 1. Since "D./ technology separates users according to time, it ensures that there ill be no interference from simultaneous transmissions. 6. 2t provides users ith an e&tended battery life, since it transmits only portion of the time during conversations. Since the cell si:e gro s smaller, it proves to save base station e#uipment, space and maintenance. "D./ is the most cost effective technology to convert an analog system to digital. D *%d7%nt%!"* o' TDMA: Cne ma3or disadvantage using "D./ technology is that the users has a predefined time slot. Ihen moving from one cell site to other, if all the time slots in this cell are full the user might be disconnected. ;i+e ise, if all the time slots in the cell in hich the user is currently in are already occupied, the user ill not receive a dial tone. "he second problem in "D./ is that it is sub3ected to multipath distortion. "o overcome this distortion, a time limit can be used on the system. Cnce the time limit is e&pired, the signal is ignored. T," conc"+t o' c"##u#%r n"t-or$ .obile telephone net or+s are based on the concept of c"##*, circular :ones that overlap to cover a geographical area. ell as band idth

8ellular net or+s are based on the use of a central transmitter-receiver in each cell, called a B(%*" *t%t onB (or )ase Transceiver Station, areas, there are cells ith a radius of a fe hundred meters, ritten BTS). "he smaller the hile huge cells of up to 1) radius of a cell, the higher is the available band idth. So, in highly populated urban +ilometers provide coverage in rural areas. 2n a cellular net or+, each cell is surrounded by $ neighbouring cells (thus a cell is generally dra n as a he&agon). "o avoid interference, ad3acent cells cannot use the same fre#uency. 2n practice, t o cells using the same fre#uency range must be separated by a distance of t o to three times the diameter of the cell. Arc, t"ctur" o' t," GSM N"t-or$ 2n a GS. net or+, the user terminal is called a &o( #" *t%t on. / mobile station is made up of a SIM (Subscriber !dentity Module) card allo ing the user to be uni#uely identified and a mobile terminal. "he terminals (devices) are identified by a uni#ue (%digit identification number called IMEI (!nternational Mobile *uipment !dentity). !ach S2. card also has a uni#ue (and secret) identification number called IMSI (!nternational Mobile Subscriber !dentity). "his code can be protected using a 6-digit +ey called a P!+ code. "he S2. card therefore allo s each user to be identified independently of the terminal used during communication ith a base station. 8ommunications occur through a radio lin+ (air interface) bet een a mobile station and a base station.

/ll the base stations of a cellular net or+ are connected to a (%*" *t%t on contro##"r (BSC) hich is responsible for managing distribution of the resources. "he system consisting of the base station controller and its connected base stations is called the B%*" St%t on Su(*)*t"& (BSS). >inally, the base station controllers are themselves physically connected to the Mo( #" S- tc, n! C"ntr" (MSC), managed by the telephone net or+ operator, hich connects them to the public telephone net or+ and the 2nternet. "he .S8 belongs to a N"t-or$ St%t on Su(*)*t"& (NSS), hich is responsible for managing user identities, their location and establishment of communications ith other subscribers. "he .S8 is generally connected to databases that provide additional functions: (. "he Ho&" Loc%t on R"! *t"r (HLR) is a database containing information (geographic position, administrative information etc.) of the subscribers registered in the area of the s itch (.S8). 7. "he V * tor Loc%t on R"! *t"r (VLR) is a database containing information of users other than the local subscribers. "he =;< retrieves the data of a ne user from the 9;< of the userFs subscriber :one. "he data is maintained as long as the

user is in the :one and is deleted inactivity (terminal off).

hen the user leaves or after a long period of

1. "he EEu +&"nt Id"nt ') R"! *t"r (EIR) is a database listing the mobile terminals. 6. "he Aut,"nt c%t on C"ntr" (AUC) is responsible for verifying user identities. %. "he cellular net or+ formed in this ay is designed to support mobility via management of handovers (movements from one cell to another). >inally, GS. net or+s support the concept of ro%& n! i.e., movement from one operator net or+ to another. Introduct on to Mod"&:

Mod"& *t%nd* 'or modulator-demodulator / modem is a device or program that enables a computer to transmit data over telephone or cable lines. 8omputer information is stored digitally, converts bet een these t o forms. >ortunately, there is one standard interface for connecting e&ternal modems to computers called RS"#,#- 8onse#uently, any e&ternal modem can be attached to any computer that has an <S-717 port, hich almost all personal computers have. "here are also modems that come as an e&pansion board that can be inserted into a vacant e&pansion slot. "hese are sometimes called onboard or internal modems. Ihile the modem interfaces are standardi:ed, a number of different protocols for formatting data to be transmitted over telephone lines e&ist. Some, li+e 882"" =.16 are official standards, hile others have been developed by private companies. .ost modems have built-in support for the more common protocols at slo data transmission speeds at hereas information aves. / modem transmitted over telephone lines is transmitted in the form of analog

least, most modems can communicate

ith each other. /t high transmission speeds,

ho ever, the protocols are less standardi:ed. /part from the transmission protocols that they support, the follo ing characteristics distinguish one modem from another: B+*: 9o fast the modem can transmit and receive data. /t slo rates, modems are measured in terms of baud rates. "he slo est rate is 1)) baud (about 7% cps). /t higher speeds, modems are measured in terms of bits per second (bps). "he fastest modems run at %5,$)) bps, although they can achieve even higher data transfer rates by compressing the data. Cbviously, the faster the transmission rate, the faster the data can be sent and received. 2t should be noted that the data cannot be received at a faster rate than it is being sent. Vo c"3d%t%: .any modems support a s itch to change bet een voice and data modes. 2n data mode, the modem acts li+e a regular modem. 2n voice mode, the modem acts li+e a regular telephone. .odems that support a voice?data s itch have a built-in loudspea+er and microphone for voice communication. Auto5%n*-"r: /n auto-ans er modem enables the computer to receive calls in the absence of the operator. D%t% co&+r"** on: Some modems perform data compression, hich enables them to send data at faster rates. 9o ever, the modem at the receiving end must be able to decompress the data using the same compression techni#ue. F#%*, &"&or): Some modems come <C. necessary. F%6 c%+%( # t): .ost modern modems are fa& modems, can send and receive fa&es. GSM Mod"&: / GS. modem is a ireless modem that or+s ith a GS. ireless net or+. / hile a ireless ireless modem behaves li+e a dial-up modem. "he main difference bet een them is that a dial-up modem sends and receives data through a fi&ed telephone line modem sends and receives data through radio aves. hich mean that they ith flash memory rather than conventional hich means that the communications protocols can be easily updated if

/ GS. modem can be an e&ternal device or a P8 8ard ? P8.82/ 8ard. "ypically, an e&ternal GS. modem is connected to a computer through a serial cable or a 4S* cable. / GS. modem in the form of a P8 8ard ? P8.82/ 8ard is designed for use ith a laptop computer. 2t should be inserted into one of the P8 8ard ? P8.82/ 8ard slots of a laptop computer. ;i+e a GS. mobile phone, a GS. modem re#uires a S2. card from a ireless carrier in order to operate. / S2. card contains the follo ing information: Subscriber telephone number (.S2SD-) 2nternational subscriber number (IMSI/ Int"rn%t on%# Mo( #" Su(*cr ("r Id"nt t)2 State of the S2. card Service code (operator) /uthentication +ey P2- (Personal !dentification "ode) P4@ (Personal #nloc$ "ode)

8omputers use /" commands to control modems. *oth GS. modems and dial-up modems support a common set of standard /" commands. 2n addition to the standard /" commands, GS. modems support an e&tended set of /" commands. "hese e&tended /" commands are defined in the GS. standards. Iith the e&tended /" commands, the follo ing operations can be performed:

<eading, riting and deleting S.S messages. Sending S.S messages. .onitoring the signal strength. .onitoring the charging status and charge level of the battery. <eading, riting and searching phone boo+ entries.

"he number of S.S messages that can be processed by a GS. modem per minute is very lo i.e., about $ to () S.S messages per minute. Introduct on to AT Co&&%nd*

/" commands are instructions used to control a modem. /" is the abbreviation of /"tention. !very command line starts ith B/"B or BatB. "hatFs the reason, modem commands are called /" commands. .any of the commands that are used to control ired dial-up modems, such as /"D (Dial), /"/ (/ns er), /"9 (9oo+ control) and /"C (<eturn to online data state) are also supported by GS. modems and mobile phones. *esides this common /" command set, GS. modems and mobile phones support an /" command set that is specific to the GS. technology, hich includes S.S-related commands li+e /"V8.GS (Send S.S message), /"V8.SS (Send S.S message from storage), /"V8.G; (;ist S.S messages) and /"V8.G< (<ead S.S messages). 2t should be noted that the starting B/"B is the prefi& that informs the modem about the start of a command line. 2t is not part of the /" command name. >or e&ample, D is the actual /" command name in /"D and V8.GS is the actual /" command name in /"V8.GS. Some of the tas+s that can be done using /" commands phone are listed belo :

ith a GS. modem or mobile

Get basic information about the mobile phone or GS. modem. >or e&ample, name of manufacturer (/"V8G.2), model number (/"V8G..), 2.!2 number (2nternational .obile !#uipment 2dentity) (/"V8GS-) and soft are version (/"V8G.<). Get basic information about the subscriber. >or e&ample, .S2SD- (/"V8-4.) and 2.S2 number (2nternational .obile Subscriber 2dentity) (/"V82.2). Get the current status of the mobile phone or GS.?GP<S modem. >or e&ample, mobile phone activity status (/"V8P/S), mobile net or+ registration status (/"V8<!G), radio signal strength (/"V8SO), battery charge level and battery charging status (/"V8*8). !stablish a data connection or voice connection to a remote modem (/"D, /"/, etc). Send and receive fa& (/"D, /"/, /"V>Y).

Send (/"V8.GS, /"V8.SS), read (/"V8.G<, /"V8.G;), ne ly received S.S messages (/"V8-.2).

rite

(/"V8.GI) or delete (/"V8.GD) S.S messages and obtain notifications of <ead (/"V8P*<), rite (/"V8P*I) or search (/"V8P*>) phoneboo+ entries. Perform security-related tas+s, such as opening or closing facility loc+s (/"V8;8@), chec+ing pass ords(/"V8PID). (>acility loc+ e&amples: S2. loc+ Za pass ord must be given to the S2. card every time the mobile phone is s itched on[ and P9-S2. loc+ Za certain S2. card is associated ith the mobile phone. "o use other S2. cards ith the mobile phone, a pass ord must be entered.[)

hether a facility is loc+ed (/"V8;8@) and changing

8ontrol the presentation of result codes ? error messages of /" commands. >or e&ample, the user can control (/"V8.!!) and hether to enable certain error messages hether error messages should be displayed in numeric format

or verbose format (/"V8.!!N( or /"V8.!!N7).

Get or change the configurations of the mobile phone or GS.?GP<S modem. >or e&ample, change the GS. net or+ (/"V8CPS), bearer service type (/"V8*S"), radio lin+ protocol parameters (/"V8<;P), S.S center address (/"V8S8/) and storage of S.S messages (/"V8P.S). Save and restore configurations of the mobile phone or GS.?GP<S modem. >or e&ample, save (/"V8S/S) and restore (/"V8<!S) settings related to S.S messaging such as the S.S center address.

2t should be noted that the mobile phone manufacturers usually do not implement all /" commands, command parameters and parameter values in their mobile phones. /lso, the behavior of the implemented /" commands may be different from that defined in the standard. 2n general, GS. modems, designed for support of /" commands than ordinary mobile phones. B%* c conc"+t* o' SMS t"c,no#o!) ireless applications, have better

% &alidit' Period of an SMS Message /n S.S message is stored temporarily in the S.S center if the recipient mobile phone is offline. 2t is possible to specify the period after deleted from the S.S center so that the S.S message recipient mobile phone hich the S.S message ill be ill not be for arded to the

hen it becomes online. "his period is called the validity period. ill include the validity period in the outbound S.S

/ mobile phone should have a menu option that can be used to set the validity period. /fter setting it, the mobile phone messages automatically. ( Message Status Re)orts Sometimes the user may ant to +no hether an S.S message has reached the

recipient mobile phone successfully. "o get this information, you need to set a flag in the S.S message to notify the S.S center that a status report is re#uired about the delivery of this S.S message. "he status report is sent to the user mobile in the form of an S.S message. / mobile phone should have a menu option that can be used to set status report feature is on or off. /fter setting it, the mobile phone hether the ill set the

corresponding flag in the outbound S.S messages for you automatically. "he status report feature is turned off by default on most mobile phones and GS. modems. * Message Su+mission Re)orts /fter leaving the mobile phone, an S.S message goes to the S.S center. Ihen it reaches the S.S center, the S.S center ill send bac+ a message submission report to the mobile phone to inform hether there are any errors or failures (e.g. incorrect S.S message format, busy S.S center, etc). 2f there is no error or failure, the S.S center sends bac+ a positive submission report to the mobile phone. Cther ise it sends bac+ a negative submission report to the mobile phone. "he mobile phone may then notify the user that the message submission as failed and hat caused the failure. 2f 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. "he mobile phone may then send the S.S message again to the S.S center. / flag the previous message submission as successful, the S.S center ill be set in the ne ill ignore the ne S.S message to inform the S.S center that this S.S message has been sent before. 2f

S.S message but send bac+ a message submission report to the mobile phone. "his mechanism prevents the sending of the same S.S message to the recipient multiple times. Sometimes the message submission report mechanism is not used and the ac+no ledgement of message submission is done in a lo er layer. , Message Deliver' Re)orts /fter receiving an S.S message, the recipient mobile phone message delivery report to the S.S center to inform ill send bac+ a

hether there are any errors or

failures (e&ample causes: unsupported S.S message format, not enough storage space, etc). "his process is transparent to the mobile user. 2f there is no error or failure, the recipient mobile phone sends bac+ a positive delivery report to the S.S center. Cther ise it sends bac+ a negative delivery report to the S.S center. 2f the sender re#uested a status report earlier, the S.S center sends a status report to the sender hen it receives the message delivery report from the recipient. 2f the S.S center does not receive the message delivery report after a period of time, it concludes that the message delivery report has been lost. "he S.S center then ends the S.S message to the recipient for the second time. Sometimes the message delivery report mechanism is not used and the ac+no ledgement of message delivery is done in a lo er layer. GPS

-asic conce)t of .PS / GPS receiver calculates its position by precisely timing the signals sent by GPS satellites high above the !arth. !ach satellite continually transmits messages that include

the time the message as transmitted precise orbital information (the ephemeris) the general system health and rough orbits of all GPS satellites (the almanac).

"he receiver uses the messages it receives to determine the transit time of each message and computes the distance to each satellite. "hese distances along locations are used ith the possible aid of trilateration, depending on ith the satellitesF hich algorithm is

used, to compute the position of the receiver. "his position is then displayed, perhaps ith a moving map display or latitude and longitudeK elevation information may be

included. .any GPS units sho calculated from position changes.

derived information such as direction and speed,

"hree satellites might seem enough to solve for position since space has three dimensions and a position near the !arthFs surface can be assumed. 9o ever, even a very small cloc+ error multiplied by the very large speed of lightZ1%[ S the speed at hich satellite signals propagate S results in a large positional error. "herefore receivers use four or more satellites to solve for the receiverFs location and time. "he very accurately computed time is effectively hidden by most GPS applications, hich use only the location. / fe speciali:ed GPS applications do ho ever use the timeK these include time transfer, traffic signal timing, and synchroni:ation of cell phone base stations. /lthough four satellites are re#uired for normal operation, fe er apply in special cases. 2f one variable is already +no n, a receiver can determine its position using only three satellites. >or e&ample, a ship or aircraft may have +no n elevation. Some GPS receivers may use additional clues or assumptions (such as reusing the last +no n altitude, dead rec+oning, inertial navigation, or including information from the vehicle computer) to give a less accurate (degraded) position visible. Po* t on c%#cu#%t on ntroduct on hen fe er than four satellites are

" o sphere surfaces intersecting in a circle

Surface of sphere intersecting a circle (not a solid dis+) at t o points "o provide an introductory description of ho a GPS receiver or+s, error effects are deferred to a later section. 4sing messages received from a minimum of four visible satellites, a GPS receiver is able to determine the times sent and then the satellite positions corresponding to these times sent. "he &, y, and : components of position, and the time sent, are designated as here the subscript i is the satellite number as received , , if ould be and has the value (, 7, 1, or 6. @no ing the indicated time the message the GPS receiver could compute the transit time of the message as e#ual to correct reception time, . / pseudorange, ,

ould be the traveling

distance of the message, assuming it traveled at the speed of light, c. / satelliteFs position and pseudorange define a sphere, centered on the satellite, ith radius e#ual to the pseudorange. "he position of the receiver is some here on the surface of this sphere. "hus ith four satellites, the indicated position of the GPS receiver is at or near the intersection of the surfaces of four spheres. 2n the ideal case of no errors, the GPS receiver ould be at a precise intersection of the four surfaces. 2f the surfaces of t o spheres intersect at more than one point, they intersect in a circle. "he article trilateration sho s this mathematically. / figure, T(o Sphere Surfaces !ntersecting in a Circle, is sho n belo . " o points here the surfaces of the spheres intersect are clearly sho n in the figure. "he distance bet een these t o points is the diameter of the circle of intersection. "he intersection of a third spherical surface ith the first t o ill be its intersection ith that circleK in most cases of practical interest, this

means they intersect at t o points.Z1,[ /nother figure, Surface of Sphere !ntersecting a Circle .not a solid disk/ at T(o Points, illustrates the intersection. "he t o intersections are mar+ed ith dots. /gain the article trilateration clearly sho s this mathematically. >or automobiles and other near-earth vehicles, the correct position of the GPS receiver is the intersection closest to the !arthFs surface. Z6)[ >or space vehicles, the intersection farthest from !arth may be the correct one. "he correct position for the GPS receiver is also the intersection closest to the surface of the sphere corresponding to the fourth satellite. GPS COMMANDS LIST

-.!/

input

Some units also support an -.!/ input mode. Ihile not too many programs support this mode it does provide a standardi:ed ay to update or add aypoint and route data. -ote that there is no handsha+ing or commands in -.!/ mode so you 3ust send the data in the correct sentence and the unit ill accept the data and add or over rite the ill simply be ignored. aypoint name is the same you information in memory. 2f the data is not in the correct format it / carriage return?line feed se#uence is re#uired. 2f the ill over rite e&isting data but no identical to arning

ill be issued. "he sentence construction is

hat the unit do nloads so you can, for e&ample, capture a IP; sentence

from one unit and then send that same sentence to another unit but be careful if the t o

units support

aypoint names of different lengths since the receiving unit might truncate aypoint accidently. 2f you create a sentence from scratch you and have set you unit to the correct support <"! as ell.

the name and over rite a

should create a correct chec+sum. *e sure you +no

datum. .any units support the input of IP; sentences and a fe

Cn -.!/ input the receiver stores information based on interpreting the sentence itself. Ihile some receivers accept standard -.!/ input this can only be used to update a aypoint or similar tas+ and not to send a command to the unit. Proprietary input sentences could be used to send commands. Since the .agellan upload and do nload maintenance protocol is based on -.!/ sentences they support a modified IP; message that adds comments, altitude, and icon data.

Some marine units may accept input for alarms such as deep or shallo the DP" sentence or ."I to read the

ater based on

ater temperature. >or e&ample the Garmin

.ap5$ supports DP", ."I (temperature), and =9I (speed) input sentences. Cther units may use -.!/ input to provide initiali:ation data via proprietary sentences, or to select data, the <.8 hich -.!/ sentences to output. "he most important -.!/ sentences include the GG/ hich provides the Satellite status data. GG/ - essential fi& data hich provide 1D location and accuracy data. hich provides the current >i&

hich provides the minimum gps sentences information, and the GS/

\GPGG/,(71%(,,60)5.)10,-,)((1(.))),!,(,)0,).,,%6%.6,.,6$.,,.,,Y65 Ihere: GG/-Global Positioning System >i& Data (71%(,->i& ta+en at (7:1%:(, 4"8 60)5.)10,--;atitude 60 deg )5.)10F -

)((1(.))),!-;ongitude (

(( >i& ( 1 N

deg #uality: 7 N % 5 0 N N satellites dilution above N ) GPS

1(.)))F N fi& DGPS PPS N >loat input being of mean sea

! invalid (SPS) fi& fi& <"@ mode mode trac+ed position level

6 N <eal "ime @inematic $ N estimated (dead rec+oning) (7.1 feature) .anual Simulation

)0 )., %6%.6,. 6$.,,.

-umber 9ori:ontal /ltitude,

of

.eters,

9eight of geo id (mean sea level) above IGS06

(empty field) time in seconds since last DGPS update (empty field) DGPS station 2D number 2f the height of geoid is missing then the altitude should be suspect. Some non-standard implementations report altitude altitude. GS/ - GPS DCP and active satellites. "his sentence provides details on the nature of the fi&. 2t includes the numbers of the satellites being used in the current solution and the DCP. DCP (dilution of precision) is an indication of the effect of satellite geometry on the accuracy of the fi&. 2t is a unitless number here smaller is better. >or 1D fi&es using 6 satellites a (.) ould be considered to be a perfect number, ho ever for overdetermined solutions it is possible to see numbers belo (.). "here are differences in the ay the P<-Fs are presented hich can effect the ability of some programs to display ith respect to the ellipsoid rather than geoid altitude. Some units do not report negative altitudes at all. "his is the only sentence that reports

this data. >or e&ample, in the e&ample sho n belo

there are % satellites in the solution ould sho satellites in the

and the null fields are scattered indicating that the almanac all of the satellites used at the beginning of the sentence

null positions that are not being used as part of this solution. Cther receivers might output ith the null field all stac+ed up all satellites that have at the end. "his difference accounts for some satellite display programs not al ays being able to display the satellites being trac+ed. Some units may sho ephemeris data ithout regard to their use as part of the solution but this is non-standard. \GPGS/,/,1,)6,)%,,),,(7,,,76,,,,,7.%,(.1,7.(Y1, Ihere: GS/ / 1 /uto 1D selection fi& 7 1 )6,)%... 7.% (.1 7.( Y1, the P<-s of satellites used (dilution dilution dilution data, of of al ays PDCP 9ori:ontal =ertical chec+sum of 7D values or Satellite 1D N N for fi& of precision precision begins fi& (. ( 7D 1D (space for (7) precision) (9DCP) (=DCP) ith Y N N include: no status manual) fi& fi& fi&

GS= - Satellites in =ie sho s data about the satellites that the unit might be able to find based on its vie ing mas+ and almanac data. 2t also sho s current ability to trac+ this data. -ote that one GS= sentence only can provide data for up to 6 satellites and thus there may need to be 1 sentences for the full information. 2t is reasonable for the GS= sentence to contain more satellites than GG/ might indicate since GS= may include satellites that are not used as part of the solution. 2t is not a re#uirment that the GS= sentences all appear in se#uence. "o avoid overloading the data band idth some receivers may place the various sentences in totally different samples since each sentence identifies hich one it is.

"he field called S-< (Signal to -oise <atio) in the -.!/ standard is often referred to as signal strength. S-< is an indirect but more useful value that ra various manufacturers send different ranges of numbers of or+ing values in a given gps that are in ill usually sho vie but signal strength. 2t can range from ) to ,, and has units of d* according to the -.!/ standard, but the ith different starting numbers so the values themselves cannot necessarily be used to evaluate different units. "he range a difference of about 7% to 1% not being trac+ed. bet een the lo est and highest values, ho ever ) is a special case and may be sho n on satellites

\GPGS=,7,(,)0,)(,6),)01,6$,)7,(5,1)0,6(,(7,)5,166,1,,(6,77,770,6%Y5% Ihere: GS= 7 ( )0 )( 6) )01 6$ for Y5% up the S-< to chec+sum 6 data, -umber -umber of sentence of Satellite !levation, /:imuth, higher satellites al ays is per begins ith Satellites sentences ( satellites P<in for full of in vie number degrees degrees better sentence Y vie data 7

<.8 - -.!/ has its o n version of essential gps pvt (position, velocity, time) data. 2t is called <.8, "he <ecommended .inimum, hich ill loo+ similar to:

\GP<.8,(71%(,,/,60)5.)10,-,)((1(.))),!,)77.6,)06.6,71)1,6,))1.(,IY$/

Ihere: <.8 (71%(, / 60)5.)10,)((1(.))),! )77.6 )06.6 71)1,6 Y$/ "he <ecommended >i& Status ;atitude ;ongitude Speed "rac+ Date ))1.(,I chec+sum data, over angle 71rd ta+en 60 (( the in of al ays .agnetic begins .inimum at /Nactive deg deg ground or )5.)10F 1(.)))F in degrees .arch ith sentence (7:1%:(, 8 4"8 =N=oid. ! +nots "rue (,,6 =ariation Y

-ote that, as of the 7.1 release of -.!/, there is a ne field in the <.8 sentence at the end 3ust prior to the chec+sum. >or more information on this field see here. G;; - Geographic ;atitude and ;ongitude is a holdover from ;oran data and some old units may not send the time and data active information if they are emulating ;oran data. 2f a gps is emulating ;oran data they may use the ;8 ;oran prefi& instead of GP. \GPG;;,6,($.6%,-,(71((.(7,I,77%666,/,Y(D Ihere: G;; 6,($.6$,(71((.(7,I 77%666 / YiD Geographic ;atitude ;ongitude >i& Data position, 6, (71 ta+en /ctive deg. deg. at or chec+sum ;atitude ($.6% ((.(7 = and min. min. 77:%6:66 ;ongitude -orth Iest 4"8 (void) data

-ote that, as of the 7.1 release of -.!/, there is a ne

field in the G;; sentence at the

end 3ust prior to the chec+sum. >or more information on this field see here.

="G - =elocity made good. "he gps receiver may use the ;8 prefi& instead of GP if it is emulating ;oran output.

\GP="G,)%6.5,",)16.6,.,))%.%,-,)().7,@Y60 here: ="G )%6.5," )16.6,. ))%.%,)().7,@ Ground Y60 -ote that, as of the 7.1 release of -.!/, there is a ne "rac+ "rue made trac+ .agnetic Ground speed, good made trac+ @ilometers and ground good made speed, per speed (degrees) good +nots hour 8hec+sum field in the ="G sentence at the

end 3ust prior to the chec+sum. >or more information on this field see here. <eceivers that donFt have a magnetic deviation (variation) table built in .agnetic Decode of trac+ some made -avigation ill null out the good. Sentences hen

IP; - Iaypoint ;ocation data provides essential redefine a for each sentence, aypoint location. -ote that

aypoint data. 2t is output

navigating to indicate data about the destination and is sometimes supported on input to aypoint data as defined in the standard does not aypoints have been reported, the ill be sent. define altitude, comments, or icon data. Ihen a route is active, this sentence is sent once aypoint in the route, in se#uence. Ihen all or an <"! sentence, <"! sentence is sent in the ne&t data set. 2n any group of sentences, only one IP;

\GPIP;,60)5.)10,-,)((1(.))),!,IP"-.!Y%8

Iith

an IP; 60)5.)10,)((1(.))),! IP"-.! Y%8 "he chec+sum data,

interpretation Iaypoint

of: ;ocation ;atitude ;ongitude

Iaypoint al ays begins ith

-ame Y

//. - Iaypoint /rrival /larm is generated by some units to indicate the Status of arrival (entering the arrival circle, or passing the perpendicular of the course line) at the destination aypoint. \GP//.,/,/,).(),-,IP"-.!Y17 Ihere: //. / / ).() IP"-.! Y17 /rrival 8ircle -autical Iaypoint 8hec+sum /rrival circle Perpendicular /larm entered passed radius miles name data them to be used to

/P* - /utopilot format * is sent by some gps receivers to allo navigation receiver arning flag status, cross-trac+-error,

control an autopilot unit. "his sentence is commonly used by autopilots and contains aypoint arrival status, initial aypoint for the active 3ourney. bearing from origin aypoint to the destination, continuous bearing from present position to destination and recommended heading-to-steer to destination navigation leg of the

-ote: some autopilots, <obertson in particular, misinterpret Bbearing from origin to

destinationB as Bbearing from present position to destinationB. "his is li+ely due to the difference bet een the /P* sentence and the /P/ sentence. for the /P/ sentence this ould be the correct thing to do for the data in the same field. /P/ only differs from /P* in this one field and /P/ leaves off the last t o fields clearly spelled out. "his course that the t o bearings here this distinction is are different. ill result in poor performance if the boat is sufficiently off-

\GP/P*,/,/,).(),<,-,=,=,)((,.,D!S",)((,.,)((,.Y18 here: /P* / / ).() < = )((,. D!S" )((,. )((,. magnetic magnetic = steer cross-trac+ ;oran-8 ;oran-8 cross-trac+ <ight error arrival magnetic arrival bearing, destination bearing, to present steer heading to units correct nautical alarm alarm origin position could to to "rue aypoint (bearings /utopilot blin+?S-< arning, cycle error (or miles ; (@ format general arning distance for for circle perpendicular destination 2D destination as )11,") ;eft) +ilometers) arning *

*CD - *earing - Crigin to Destination sho s the bearing angle of the line, calculated at the origin the aypoint, e&tending to the destination active navigation leg aypoint from the origin of the aypoint for 3ourney.

\GP*CD,)6%.,",)71.,.,D!S",S"/<"Y)( here: *CD *earing origin to destination aypoint

)6%.," )71.,.

bearing bearing D!S" S"/<"

)6% )71

"rue .agnetic

from from

BS"/<"B BS"/<"B aypoint aypoint

to to

BD!S"B BD!S"B 2D 2D chec+sum

destination origin Y)(

*I8 - *earing G Distance to Iaypoint using a Great 8ircle route. "ime (4"8) and distance G bearing to, and location of, a specified the great aypoint from present position along circle path.

\GP*I8,77%666,6,(5.76,-,(71),.%5,I,)%(.,,",)1(.$,.,))(.1,-,))6Y7, here: *I8 77%666 6,(5.76,(71),.%5,I )%(.,," )1(.$,. ))(.1,*earing *earing Distance ))6 Y7, <.* - "he recommended minimum navigation sentence is sent to to *earing and 4"8 distance time ;atitude ;ongitude to aypoint, aypoint, aypoint, Iaypoint to aypoint of of of degrees degrees -autical fi& great circle 77:%6:66 aypoint aypoint true magnetic miles 2D chec+sum henever a route or a

goto is active. Cn some systems it is sent all of the time ith null data. "he /rrival alarm flag is similar to the arrival alarm inside the unit and can be decoded to drive an e&ternal alarm. -ote the use of leading :eros in this message to preserve the character spacing. "his is done, 2 believe, because some autopilots may depend on e&act character spacing. \GP<.*,/,).$$,;,))1,))6,6,(5.76,-,(71),.%5,I,))(.1,)%7.%,))).%,=Y7)

here: <.* / ).$$,; ))1 ))6 6,(5.76,(71),.%5,I ))(.1 )%7.% ))).% = /rrival Destination Destination <ange to Data steer <ecommended status ;eft / to Crigin Destination aypoint latitude 6, 8ross-trac+ error minimum N C@, (nautical correct = navigation N miles, (or < aypoint aypoint deg. miles to destination, = N not (5.76 min. =oid ,.,, N information ( arning) ma&), right) 2D 2D -

aypoint longitude (71 deg. ),.%5 min. I destination, "rue nautical (,,,., ma&) +nots arrived chec+sum aypoints used in an active route. "here aypoints in the aypoints. data. bearing to ards / N arrived, destination

=elocity alarm Y7)

<"! - <"! is sent to indicate the names of the

are t o types of <"! sentences. "his route sentence can list all of the

entire route or it can list only those still ahead. *ecause an -.!/ sentence is limited to 0) characters there may need to be multiple sentences to identify all of the "he data about the hich ill be aypoints themselves sent in future cycles of the ill be sent in subse#uent IP; sentences -.!/

\GP<"!,7,(,c,),I12I2,D<2=IQ,178!D<,17-7,,17*@;D,17-2,%,17-4S(,*I17,*I-(,0Y$, Ihere: <"! 7 ( c "ype N c first total this N listed Iaypoints number of is complete list aypoint sentences sentence of is start in needed ( aypoints of in active for full of this current route data 7 route leg

) I12I2,... Iaypoint Y$,

<oute identifiers

identifier (names) chec+sum

A"! - .easured cross trac+ error is a small subset of the <.* message for compatibility ith some older e#uipment designed to autopilot. \GPA"!,/,/,).$5,;,-Y$> Ihere: A"! / / ).$5 ; Steer left -ot General (;oran-8 used for cross to Y$> Cther sentences that may be Distance 8ross arning *lin+ GPS correct units trac+ error trac+ flag or (;oran-8 error, = S-< cycle error (or < -autical for loc+ N measured arning arning) flag) distance right) miles chec+sum useful or+ ith ;oran. -ote that the same limitations apply to this message as the ones in the <.* since it is e&pected to be decoded by an

/;. - GPS /lmanac Data contains GPS

ee+ number, satellite health and the complete

almanac data for one satellite. .ultiple messages may be transmitted, one for each satellite in the GPS constellation, up to ma&imum of 17 messages. -ote that these sentences can ta+e a long time to send so they are not generally sent automatically by the gps receiver. (Sorry 2 donFt have an e&act e&ample of the sentence.) -ote that this sentence brea+s the 0) character rule. /lso note that this sentence is often accepted as input so that you can preload a ne almanac in a receiver.

\GP/;.,/.*,8.D,!,>,hh,hhhh,... Ihere: /;. / * 8 D ! hh hhhh ... GPS Satellite t inde& sigma C.!G/DC" SO</(/) Cmega, Cmega . a a inde& inde& inde& ), inde& root health > C/, inde& rate of argument longitude ), f), f(, of cloc+ cloc+ almanac (, of inclination right semi-ma3or of ascension mean Satellite ee+ (bits /lmanac "otal Data number .essage P<number (5-76 ()-()71) of reference message) eccentricity time angle ascension a&is perigee node anomaly parameter parameter of being sent messages number number

989DG - 8ompass output is used on Garmin etre& summit, vista , and 5$S receivers to output the value of the internal flu&-gate compass. Cnly the magnetic heading and magnetic variation is sho n in the message.

\989DG,()(.(,,,5.(,IY18 here: 989DG ,, .agnetic ()(.( deviation 5.(,I (no heading, deviation, variation heading data) variation

XD/

Data

and

"ime

\GPXD/,hhmmss.ss,dd,mm,yyyy,&&,yyY88 \GPXD/,7)(%1).)),)6,)5,7))7,)),))Y$) here: hhmmss dd,mm,yyy && yy local local Y88 .S@ 8ontrol for a *eacon :one :one hours minutes 9r.inSec(4"8) Day,.onth,Qear -(1..(1 )..%, chec+sum <eceiver

\GP.S@,1(0.),/,()),.,7Y6% here: 1(0.) / ()) . 7 fre#uency for .SS Y6% .SS *eacon <eceiver >re#uency *itrate, message >re#uency mode, *eacon /Nauto, status (null for to /Nauto, bit no use .Nmanual rate .Nmanual status) chec+sum Status

\GP.SS,%%,75,1(0.),()),Y$$ here: %% signal strength in d*

75 1(0.) ())

signal *eacon

to *eacon Y$$

noise >re#uency bitrate

ratio in in

in

d* @9: bps chec+sum Sentences

Proprietary

Proprietary sentences can either be output from the gps or used as input to control information. "hey al ays start code Garmin "he follo ing are Garmin proprietary sentences. BPB denotes proprietary, BG<.B is GarminFs manufacturer code, and B.B or BXB indicates the specific sentence type. -ote that the PG<.! sentence is not set if the output is set to -.!/ (.% mode. \PG<.!,(%.),.,6%.),.,7%.),.Y(8 here: (%.),. 6%.),. 7%.),. !stimated Cverall hori:ontal vertical spherical position error error in meters in position (9P!) meters error !stimated (=P!) and additional ith P hich is follo ed by a 1 character manufactures to define the sentence type. characters

e#uivalent

\PG<.X,,1,f,1Y7( here: ,1,f 1 Position fi& 1 /ltitude dimensions N 7 N GPS in user feet altitude altitude

"his sentence sho s in feet, regardless of units sho n on the display.

-ote that for units by

ith an altimeter this the

ill be altitude computed altimeter.

internal

\PG<..,-/D75 8urrently PS;2* active hori:ontal

8anadaY7> datum

Proprietary sentences are used to control a Starlin+ differential beacon receiver. (GarminFs D*< is Starlin+ compatible as are many others.) Ihen the GPS receiver is set to change the D*< fre#uency or b?s rate, the BJB sentence is replaced (3ust once) by (for e&ample): \PS;2*,17).),7))Y%, \PS;2*,,,JY77 \PS;2*,,,@Y71 to set the D*< to 17) @9:, 7)) b?s.

Status configuration

re#uest re#uest

"hese t o sentences are normally sent together in each group of sentences from the GPS. "he three fields are: >re#uency, bit <ate, <e#uest "ype. "he value in the third field may be: J N status re#uest, @ N configuration re#uest, or null (blan+) N tuning message. "he correct values for fre#uency range from 701.%-17%.) @9: ), .agellan .agellan uses proprietary sentences to do all of their specification and sentence sent aypoint and route maintenance. 7%, %), ()) or hile the bit rate can be set to 7)) bps.

"hey use the .G- prefi& for their sentences. "his use is documented in their interface ill not be repeated here. 9o ever, they also send proprietary by the GPS 8ompanion product: sentences to augment the gps data 3ust li+e Garmin does. 9ere is an e&ample of a

\P.G-S",)7.(7,1,",%16,)%.),V)1175,))Y6)

here: S" )7.(7 1 " %16 )%.) V)1175 )) time P<"rue if left numbers number Y6) e numbers on the change 7D have a change gps receiving (fre#. fi& status =ersion or >alse battery current in information number] 1D other ise un+no n hours focus chec+sum compensation])

/ trac+log on a .eridian is made up of propretary sentences that loo+ li+e: \P.G-"<@,6177.)$(,-,)5,60.651,I,))(($,.,(51,6,.67,/,,)7)$)7Y$5 \P.G-"<@,6177.)%0,-,)5,60.601,I,))),),.,(567)7.6%,/,,)7)$)7Y$,. here "<@ 6177.)5( I ))(($ . (51,6,.67 / ,, )7)$)7 Y$5 /ctive "rac+ .eters 4"8 or or -orth )5,60.651 !ast or or "rac+log ;atitude South ;ongitude Iest /ltitude >eet time =oid -ame date chec+sum

.otorola "he P.C"G is used by .otorola Cncore receivers to send a command to the receiver. "his command is used to set the output of the sentence to a particular fre#uency in seconds (or to )) or to s itch the output formula to motorola binary, gps, or loran. \P.C"G,&&&,yyyy here: &&& yyyy or here: y <oc+ ell .P*N), GPSN(, ;oranN7 2nternational the the sentence time interval to be ()-,,,, controlled seconds)

\P.C"G,>C<,y

"he <oc+ ell chipset is used on a number of gps receivers. 2t outputs some proprietary sentences ith the P<I2 prefi& and accepts input from some special sentences similar to the approach used by .agellan. 2t can also be s itched to a separate binary mode using a proprietary sentence. "he input sentence most used to initiali:e the unit is \P<I22-2" and one output sentence is \P<I2<2D

\P<I2<2D,(7,)(.01,(7?(%?,5,)))1,Y67 here: \P<I2<2D (7 )(.01 (7 soft are channel unit version

(7?(%?,5 )))1 *it *it soft are ) ( Y67 /n input sentence that <oc+ ell ill define minimi:e

soft are options <C. </. minimi:e (9!A usage

date value) usage chec+sum

hich -.!/ sentences are to be output from the unit is: \P<I22;CG,GG/,/,",(,)

here: \P<I22;CG GG/ / " ( every ) "he initiali:ation sentence ( type /Nactivate, of sentence =Ndeactivate cyclic second ]]

hich can be input to speed up ac#uisition loo+s li+e:

\P<I22-2",=,,,61)0.5%),-,)5(%,.5,(,I,()).),).),.,).),",(5%766,71)%)1Y55 here: \P<I22-2" = ,, I I N N = N 2-2" reset, <eserved 61)0.5%) -orth, Iest, S ! N )5(%,.5,( N / for N N future South ;ongitude !ast initiali:ation no reset use ;atitude

()).) ).) . " (5%766 71)%)1 . " 4"8 4"8 Y55 N m?s, ).) N

/ltitude "rue, time date N +nots, . (hour, (day,

in @ N min, month, N

meters Speed +m?hr 9eading .agnetic sec) year) 8hec+sum

-ote: 8ommas may be used to signify using e&isting data. 2f units are supplied then the data must be present. Speed and direction must be supplied together. ;at?;on must be supplied together. 4"8 time and date must be supplied together. 2f heading is magnetic then lat?lon needs to be supplied along ith 4"8 time and date.

"he sentences available for the <oc+ ell Jupiter chipset are: GG/, GS/, GS=, ="G, <.8 Si<> "he Si<> line of chips support several input sentences that permit the user to customi:e the ay the chip behaves. 2n addition Si<> has a binary protocol that is even more ill need to ma+e po erful permitting different implementations to behave entirely differently. 9o ever, most applications do not attempt to customi:e the behavior so a user sure that the any customi:ation is compatible use. "here are % input sentences defined that begin fields, and is terminated ith \PS<> ith the application they are planning to hich is follo ed by hich must e&ist, no null and some proprietary sentences.

three digits. !ach sentence ta+es a fi& amount of input fields

ith the standard 8<?;> se#uence. "he chec+sum is re#uired. hile ()7 sets

"he sentences ()) and ()7 set the serial ports. ()) sets the main port /

the DGPS input port *. ()) has an e&tra field that can be used to s itch the interface to binary mode. *inary mode re#uires 0 bits, ( stop bit, no parity. "here is a command in binary mode that ill s itch the interface bac+ to -.!/. Do not use the -.!/

command to s itch to binary mode unless you have the ability to s itch it bac+. Qou could render your gps inoperative.

\PS<>()),),,$)),0,(,)Y)8 \PS<>()7,,$)),0,(,)Y18 here \PS<>()) ) )NSi<>, ,$)) 0 ( ) Y)8 )Nnone, (Nodd, 7Neven Parity chec+sum (N-.!/ b?s "his 5, ), is here the 0 ( protocol (,7)), is changed. 106)) Databits Stopbits rate 60)), ,$)),

"he sentences ()( and ()6 can be used to initiali:e values to be used by the gps. Supplying these values can shorten the initial loc+ time. 2f the cloc+ offset is set to ) then an internal default traditional ill be used. Sentence ()( supplies data in the internal !8!> (!arth hile sentence ()6 supplies the data in the ? ;on format. ;at centered, !arth >i&ed) format in meters

\PS<>()(,-7$0$5)),-61)67)),10%($76,,%))),6,57$),,7(,(7,1Y77 \PS<>()6,15.105%(((,-(7(.,5717,),,%))),7155%,,,77,(7,1Y1/ here \PS<>()6 15.105%((( -(7(.,5717 ) ,%))) 7155%, GPS "ime of !llipsoid ;atitude ;ongitude /ltitude 8loc+ Iee+ in in in in degrees degrees meters offset seconds

,77 (7 1 ( 7 1 6 0 N N N N N clear 8hannel

GPS count <eset arm ephemeris, ith start, start, set cold cold Y1/ initiali:e start, arm

Iee+ (( config ephemeris start clear clear factory all (>irst to

-umber (7) here valid >i&) data defaults chec+sum ephemeris

data,

"he sentence ()1 is used to control hich -.!/ sentences are to be sent and ho often. !ach sentence type is controlled individually. 2f the #uery bit is set then the gps responds by sending this message in the ne&t second no matter the selected update rate times the tric+le rate less fre#uently than hat the rate is set to. -ote that if ill be sent here. tric+le po er is in use (can only be set in binary mode) then the actual update rate ill be hich could mean that the data as set

\PS<>()1,)%,)),)(,)(Y7) here \PS<>()1 )% ))NGG/ )(NG;; )7NGS/ )1NGS= )6N<.8 )%N="G )) )( )( mode, rate chec+sum Y7) )Nset in rate, seconds, )Nno, (N#uery )-7%% (Nyes chec+sum

"he ()% sentence controls a debug mode hich causes the gps to report any errors it finds ith the input data. \PS<>()%,(Y1! turn .agnavo& "he old .agnavo& system used mostly proprietary sentences. "he .agnavo& system as ac#uired by ;eica Geosystems in (,,6. 2nformation on this system can be found at this site. "he -.!/ sentences themselves are described here. "hey all use the .=A prefi& and 8ontrol Y Y Y Y Port \P.=AG,))) \P.=AG,))( 2nitiali:ation?.ode 2nitiali:ation?.ode 8ontrol "ime 2nput 8ontrol 8ontrol Port <ecovery include: sentences Part Part / * ould turn debug on it hile \PS<>()%,)Y1> ould off.

\P.=AG,))5 \P.=AG,)71

8onfiguration 8onfiguration

Y \8DGPO,QQQ Ouery >rom a <emote Device ? <e#uest to Cutput a Sentence 8ontrol Y Y Y Y Y Y Sony Y \P.=AG,)1) \P.=AG,()( \P.=AG,%71 \P.=AG,01) 8ontrol "ime "ime Port \P.=AG,))) \P.=AG,)7( Position, \P.=AG,)77 Soft are Sentence <ecovery <ecovery Cutput <eceiver 9eight, Sentences Status =elocity DCPs 8onfiguration /ccept?<e3ect 8onfiguration <esults

"he

Sony

interface

uses

proprietary

sentence

that

loo+s

li+e:

\PS-Q,),)),)%,%)),)$,)$,)$,)$Y(6 here PS-Q ) Preamp ) ( 7 )) )% %)) )$ )$ )$ )$ Y(6 Sample "hese streams ill be modified data. Garmin Garmin g(7 sentences for version 6.%5 hen a route is active PDCP 9DCP PDCP 9DCP Geodesic system (datum) Speed limit limit limit limit !levation (e&ternal N N N )-7%, mas+ ;imit ith ith ith ith ) in in DGPS DGPS DGPS DGPS N antenna) status -ormal Cpen shorted IGS06 degrees @m on on off off 8hec+sum Streams ith the inclusion of route specific

\GP<.8,(0157,,/,1,)5.1%$,-,(7()7.607,I,))).),1$).),)0)1)(,)(%.%,!Y$> \GP<.*,/,,,,,,,,,,,,=Y5( \GPGG/,(0151),1,)5.1%$,-,(7()7.607,I,(,)%,(.$,$6$.6,.,-76.(,.,,Y5% \GPGS/,/,1,)7,,,)5,,),,76,7$,,,,,(.$,(.$,(.)Y1D

\GPGS=,7,(,)0,)7,61,)00,10,)6,67,(6%,)),)%,((,7,(,)),)5,$),)61,1%Y5( \GPGS=,7,7,)0,)0,)7,(6%,)),),,6$,1)1,65,76,($,(50,17,7$,(0,71(,61Y55 \PG<.!,77.),.,%7.,,.,%(.),.Y(6 \GPG;;,1,)5.1$),-,(7()7.60(,I,(0151),/Y11 \PG<.X,7)$7,f,1Y7D \PG<..,IGS \GP*CD,,",,.,,Y65 \GP<"!,(,(,c,)Y)5 \GP<.8,(0151(,/,1,)5.607,-,(7()7.61$,I,))).),1$).),)0)1)(,)(%.%,!Y$5 \GP<.*,/,,,,,,,,,,,,=Y5( Ihile originally a military pro3ect, GPS is considered a dual"use technology, meaning it has significant military and civilian applications. GPS has become a idely deployed and useful tool for commerce, scientific uses, ell 06Y)$

trac+ing, and surveillance. GPSFs accurate time facilitates everyday activities such as ban+ing, mobile phone operations, and even the control of po er grids by allo ing synchroni:ed hand-off s itching

LCD 0L Eu d Cr *t%# D *+#%)2: / li#uid crystal display (;8D) is a thin, flat display device made up of any number of color or monochrome pi&els arrayed in front of a light source or reflector. !ach pi&el consists of a column of li#uid crystal molecules suspended bet een t o transparent electrodes, and t o polari:ing filters, the a&es of polarity of hich are perpendicular to each other. Iithout the li#uid crystals bet een them, light passing through one ould be bloc+ed by the other. "he li#uid crystal t ists the polari:ation of light entering one filter to allo it to pass through the other.

/ program must interact communicate directly

ith the outside

orld using input and output devices that

ith a human being. Cne of the most common devices attached to

an controller is an ;8D display. Some of the most common ;8Ds connected to the contollers are ($A(, ($&7 and 7)&7 displays. "his means ($ characters per line by ( line ($ characters per line by 7 lines and 7) characters per line by 7 lines, respectively.

.any microcontroller devices use Fsmart ;8DF displays to output visual information. ;8D displays designed around ;8D -"-8($(( module, are ine&pensive, easy to use, and it is even possible to produce a readout using the %A5 dots plus cursor of the display. "hey have a standard /S822 set of characters and mathematical symbols. >or an 0-bit data bus, the display re#uires a V%= supply plus () 2?C lines (<S <I D5 D$ D% D6 D1 D7 D( D)). >or a 6-bit data bus it only re#uires the supply lines plus $ e&tra lines(<S <I D5 D$ D% D6). Ihen the ;8D display is not enabled, data lines are tri-state and they do not interfere ith the operation of the microcontroller.

available. ;ine lengths of

0, ($,

7), 76, 6) charact all standar d, one, t o

17 and

ers are

in

F"%tur"*: (() 2nterface ith either 6-bit or 0-bit microprocessor.

^(7) Display data </. (1) 0)&^0 bits (0) characters). ^(6) 8haracter generator <C. (%). ($) different % ^5 dot-matri& character patterns. ($).^ 8haracter generator </. (5) ^0 different user programmed % ^5 dot-matri& patterns. (0).Display data </. and character generator </. may be /ccessed by the microprocessor. ^(,) -umerous instructions ^(()) .8lear Display, 8ursor 9ome, Display C-?C>>, 8ursor C-?C>>, *lin+ 8haracter, 8ursor Shift, Display ^(((). *uilt-in reset circuit is ^((7). *uilt-in oscillator. triggered Shift. C-. at po er

D"*cr +t on O' 4G6<: "his is the first interfacing e&ample for the Parallel Port. Ie should or+ ill start ith something the use of the

simple. "his e&ample doesnFt use the *i-directional feature found on ne er ports, thus it ith most, if no all Parallel Ports. 2t ho ever doesnFt sho hat are Status Port as an input. So e interfacing] / ($ 8haracter & 7 ;ine ;8D

.odule to the Parallel Port. "hese ;8D .odules are very common these days, and are #uite simple to or+ ith, as all the logic re#uired to run them is on board.

Sc,"&%t c D %!r%&:

o /bove

is

the

#uite

simple

schematic.

"he

;8D

panelFs nable and Register Select is connected to the 8ontrol Port. "he 8ontrol Port is an open collector ? open drain output. Ihile most Parallel Ports have internal pull-up resistors, there are a fe portable for a ider range of computers, some of hich donFt. "herefore hich may have no by incorporating the t o ()@ e&ternal pull up resistors, the circuit is more internal pull up resistors. o Ie ma+e no effort to place the Data bus into reverse direction. "herefore e hard ire the R0& line of the ;8D panel, into rite mode. "his ill cause no bus conflicts on the data lines. /s a result the ;8DFs internal *usy >lag e cannot read bac+

hich tells us if the ;8D has accepted and

finished processing the last instruction. "his problem is overcome by inserting +no n delays into our program. o "he ()+ Potentiometer controls the contrast of the ;8D panel. -othing fancy here. /s <emember a fe ith all the e&amples, 2Fve left the po er supply out. Qou de-coupling capacitors, especially if you have trouble ide range of can use a bench po er supply set to %v or use a onboard V% regulator. ith the circuit or+ing properly. "he 7 line & ($ character ;8D modules are available from a

manufacturers and should all be compatible used to test this circuit ;"-7((>-() hich

ith the 9D6650). "he one 2

as a Po er tip P8-($)7> and an old Philips

as e&tracted from a Po+er .achine_ "he diagram to

the right, sho s the pin numbers for these devices. Ihen vie ed from the front, the left pin is pin (6 and the right pin is pin ( . 4G 6 < A#+,%nu&"r c LCD Modu#" F"%tur"*:

2ntelligent,

ith built-in 9itachi 9D6650) compatible ;8D controller and </.

providing simple interfacing


$( & (%.0 mm vie ing area % & 5 dot matri& format for 7.,$ & %.%$ mm characters, plus cursor line 8an display 776 different symbols ;o po er consumption (( m/ typical) Po erful command set and user-produced characters ""; and 8.CS compatible 8onnector for standard ).(-pitch pin headers

4G 6 < A#+,%nu&"r c LCD Modu#" S+"c ' c%t on*: S)&(o# Pn ( =SS 7 =DD 1 =o 6 <S L"7"# 9?; Funct on Po er, G-D Po er, %= Po er, for ;8D Drive <egister Select 9: Data ;: 2nstruction 2nput 9: Data <ead

Signal 2nput (;8D-`.P4)

% $

<?I !

9?;

;: Data Irite (.P4-`;8D) 9,9-`; !nable

5-(6 D*)-D*5 9?; 4: -8 ($ -8 FEATURES: P % & 0 dots ith cursor

Data *usK Soft are selectable 6- or 0-bit mode NOT CONNECTED NOT CONNECTED

P *uilt-in controller (@S ))$$ or !#uivalent) P V %= po er supply (/lso available for V 1=) P (?($ duty cycle P *?; to be driven by pin (, pin 7 or pin (%, pin ($ or /.@ (;!D) P -.=. optional for V 1= po er supply D%t% c%n (" +#%c"d %t %n) #oc%t on on t," LCD. #oc%t on* %r": For 4GH4 LCD/ t," %ddr"**

F ! :4:: Addr"** #oc%t on* 'or % 464G # n" LCD !ven limited to character based modules, there is still a ide variety of shapes and si:es available. ;ine lengths of 0,($,7),76,17 and 6) characters are all standard, in one, t o and four line versions. Several different ;8 technologies e&ists. Rsupert istD types, for e&ample, offer 2mproved contrast and vie ing angle over the older Rt isted nematicD types. Some modules are available ith bac+ lighting, so that they can be vie ed in dimly-lit conditions. "he bac+ lighting may be either Relectro-luminescentD, re#uiring a high voltage inverter circuit, or simple ;!D illumination.

!lectrical *loc+ Diagrm Po-"r *u++#) 'or LCD dr 7 n!:

F !: 48:+o-"r *u++#) 'or LCD

PIN DESCRIPTION: .ost ;8Ds ith ( controller has (6 Pins and ;8Ds ith 7 controller has ($ Pins (t o pins are e&tra in both for bac+-light ;!D connections).

F ! 49: + n d %!r%& o' 464G # n"* LCD

>ig (5: Pin specifications CONTROL LINES: EN: ;ine is called B!nable.B "his control line is used to tell the ;8D that you are

sending it data. "o send data to the ;8D, your program should ma+e sure this line is lo ()) and then set the other t o control lines and?or put data on the data bus. Ihen the other lines are completely ready, bring !- high (() and it lo ()) again. ait for the minimum amount of time re#uired by the ;8D datasheet (this varies from ;8D to ;8D), and end by bringing

RS: ;ine is the B<egister SelectB line. Ihen <S is lo high ((), the data being sent is te&t data ()), the data is to be treated as

a command or special instruction (such as clear screen, position cursor, etc.). Ihen <S is hich sould be displayed on the screen. >or e&ample, to display the letter B"B on the screen you ould set <S high. RW: ;ine is the B<ead?IriteB control line. Ihen <I is lo ()), the information on the data bus is being ritten to the ;8D. Ihen <I is high ((), the program is effectively #uerying (or reading) the ;8D. Cnly one instruction (BGet ;8D statusB) is a read command. /ll others are rite commands, so <I ill almost al ays be lo . >inally, the data bus consists of 6 or 0 lines (depending on the mode of operation selected by the user). 2n the case of an 0-bit data bus, the lines are referred to as D*), D*(, D*7, D*1, D*6, D*%, D*$, and D*5. Lo! c *t%tu* on contro# # n"*: P ! - ) /ccess to ;8D disabled - ( /ccess to ;8D enabled P <?I - ) Iriting data to ;8D - ( <eading data from ;8D P <S - ) 2nstructions ( 8haracter Wr t n! d%t% to t," LCD: () Set <?I bit to lo 7) Set <S bit to logic ) or ( (instruction or character) 1) Set data to data lines (if it is riting) 6) Set ! line to high %) Set ! line to lo

R"%d d%t% 'ro& d%t% # n"* 0 ' t * r"%d n!2 on LCD: () Set <?I bit to high 7) Set <S bit to logic ) or ( (instruction or character) 1) Set data to data lines (if it is riting) 6) Set ! line to high %) Set ! line to lo Ent"r n! T"6t: >irst, a little tip: it is manually a lot easier to enter characters and commands in he&adecimal rather than binary (although, of course, you ill need to translate commands from binary couple of sub-miniature he&adecimal rotary s itches is a simple matter, although a little bit into he& so that you +no d.i.l. s itch pac+ ith a of re- iring is necessary. SWITCHES: "he s itches must be the type outputs are open circuit. /ll the available characters that are built into the module are sho n in "able 1. Studying the table, you ill see that codes associated ith the characters are #uoted in binary and he&adecimal, most significant bits (Rleft-handD four bits) across the top, and least significant bits (Rright-handD four bits) do n the left. .ost of the characters conform to the /S822 standard, although the Japanese and Gree+ characters (and a fe other things) are obvious e&ceptions. Since these intelligent modules ere designed in the R;and of the <ising Sun,D it seems only fair that their @ata+ana phonetic symbols should also be incorporated. "he more e&tensive @an3i character set, hich the Japanese share characters, is not included_ 4sing the s itches, of hatever type, and referring to "able 1, enter a fe characters onto the display, both letters and numbers. "he <S s itch (S()) must be RupD (logic () hen ith the 8hinese, consisting of several thousand different here Cn N ), so that hen they are turned to the :ero position, all four outputs are shorted to the common pin, and in position R>D, all four hich bits you are setting). <eplacing the

sending the characters, and s itch ! (S,) must be pressed for each of them. "hus the operational order is: set <S high, enter character, trigger !, leave <S high, enter another character, trigger !, and so on. "he first ($ codes in "able 1, )))))))) to ))))((((, (\)) to \)>) refer to the 8G</.. "his is the 8haracter Generator </. (random access memory), hich can be used to hold user-defined graphics characters. "his is here these modules really start to sho their

potential, offering such capabilities as bar graphs, flashing symbols, even animated characters. *efore the user-defined characters are set up, these codes loo+ing symbols. 8odes )))()))) to )))((((( (\() to \(>) are not used and 3ust display blan+ characters. /S822 codes RproperD start at ))())))) (\7)) and end \D>) are the Japanese characters. ith )((((((( (\5>). 8odes ())))))) to ())((((( (\0) to \,>) are not used, and ()())))) to (()((((( (\/) to ill 3ust bring up strange

F ! <;: c,%r%ct"r d"t% #* n LCD

S/FT01R2 23P4151T!/5

%2 ABOUT SOFTWARE Soft are's used are: Y@eil soft are for c programming Y!&press P8* for lay out design Y!&press S89 for schematic design W,%t@* N"- n 1V * on=I E=ision1 adds many ne features to the !ditor li+e "e&t "emplates, Ouic+ ith brace high lighting

>unction -avigation, and Synta& 8oloring

8onfiguration Ii:ard for dialog based startup and debugger setup. E=ision1 is fully compatible to E=ision7 and can be used in parallel ith E=ision7. W,%t * 1V * on=I E=ision1 is an 2D! (2ntegrated Development !nvironment) that helps you rite, compile, and debug embedded programs. 2t encapsulates the follo ing components: / pro3ect manager. / ma+e facility. "ool configuration. !ditor. / po erful debugger. "o help you get started, several e&ample programs (located in the JC:4JE6%&+#"*, JC<:4JE6%&+#"*, JC4GGJE6%&+#"*, and JARMJ...JE6%&+#"*) are provided.

HELLO is a simple program that prints the string B9ello IorldB using the Serial 2nterface. MEASURE is a data ac#uisition system for analog and digital systems. TRAFFIC is a traffic light controller system. SIEVE is the S2!=! *enchmar+. DHRY is the Dhrystone *enchmar+. WHETS is the Single-Precision Ihetstone *enchmar+. /dditional e&ample programs not listed here are provided for each device architecture. Bu #d n! %n A++# c%t on n 1V * on< "o build (compile, assemble, and lin+) an application in E=ision7, you must: (. Select Pro3ect (fore&ample,4GGJE>AMPLESJHELLOJHELLO.UV<). 7. Select Pro3ect - <ebuild all target files or *uild target. E=ision7 compiles, assembles, and lin+s the files in your pro3ect. Cr"%t n! Your O-n A++# c%t on n 1V * on< To cr"%t" % n"- +roK"ct n 1V * on</ )ou &u*t: (. Select Pro3ect - -e Pro3ect. 7. Select a directory and enter the name of the pro3ect file. 1. Select Pro3ect - Select Device and select an 0)%(, 7%(, or 8($&?S"() device from the Device Databasea. 6. 8reate source files to add to the pro3ect. ith the <"A "iny operating

%. Select Pro3ect - "argets, Groups, >iles. /dd?>iles, select Source Group(, and add the source files to the pro3ect. $. Select Pro3ect - Cptions and set the tool options. -ote hen you select the target device from the Device Databasea all special options are set automatically. Qou typically only need to configure the memory map of your target hard are. Default memory model settings are optimal for most applications. 5. Select Pro3ect - <ebuild all target files or *uild target. D"(u!! n! %n A++# c%t on n 1V * on< "o debug an application created using E=ision7, you must: (. Select Debug - Start?Stop Debug Session. 7. 4se the Step toolbar buttons to single-step through your program. Qou may enter G/ &% n in the Cutput Iindo function. 1. Cpen the Serial Iindo using the S"r %# L4 button on the toolbar. Debug your program using standard options li+e Step, Go, *rea+, and so on. St%rt n! 1V * on< %nd Cr"%t n! % ProK"ct E=ision7 is a standard Iindo s application and started by clic+ing on the program icon. "o create a ne pro3ect file select from the E=ision7 menu ProK"ct L -e you for the ne pro3ect file name. Ie suggest that you use a separate folder for each pro3ect. Qou can simply use the icon 8reate -e >older in this dialog to get a ne empty folder. "hen select this folder and enter the file name for the ne pro3ect, i.e. Pro3ect(. Pro3ectb. "his opens a standard Iindo s dialog that as+s to e&ecute to the main 8

E=ision7 creates a ne contains

pro3ect file

ith the name P<CJ!8"(.4=7

hich

a default target and file group name. Qou can see these names in the Pro3ect W ndo- B F #"*. -o use from the menu Pro3ect L Select Device for "arget and select a 8P4 for your pro3ect. "he Select Device dialog bo& sho s the E=ision7 device database. Just select the micro controller you use. Ie are using for our e&amples the Philips 0)8%(<DV 8P4. "his selection sets necessary tool options for the 0)8%(<DV device and simplifies in this 8onfiguration Bu #d n! ProK"ct* %nd Cr"%t n! % HE> F #"* "ypical, the tool settings under Cptions L "arget are all you need to start a ne application. Qou may translate all source files and line the application ith a clic+ on the *uild "arget toolbar icon. Ihen you build an application ith synta& errors, E=ision7 Cutput Iindo file on the correct location in a E=ision7 editor indo . Cnce you have successfully generated your application you can start debugging. /fter you have tested your application, it is re#uired to create an 2ntel 9!A file to do nload the soft are into an !P<C. programmer or simulator. E=ision7 creates 9!A files ith each build process hen 8reate 9!A files under Cptions for "arget L Cutput is enabled. Qou may start your L *uild page. / double clic+ on a message line opens the source ill display errors and arning messages in the ay the tool

P<C. programming utility after the ma+e process program under the option <un 4ser Program c(. CPU S &u#%t on

hen you specify the

E=ision7 simulates up to ($ .bytes of memory from hich areas can be mapped for read, traps and reports illegal memory accesses. 2n addition to memory mapping, the simulator also provides support for the integrated peripherals of the various 0)%( derivatives. "he on-chip peripherals of the 8P4 you have selected are configured from the Device D%t%(%*" *"#"ct on you have made more 2nformation about selecting a device. Qou may select and display the onchip peripheral components using the Debug menu. Qou can also change the aspects of each peripheral using the controls in the dialog bo&es. St%rt D"(u!! n! Qou start the debug mode of E=ision7 ith the Debug L Start?Stop Debug Session command. Depending on the Cptions for "arget L Debug 8onfiguration, E=ision7 startup code E=ision7 saves the editor screen layout and restores the screen layout of the last debug session. 2f the program e&ecution stops, E=ision7 opens an editor indo ith the source te&t or sho s 8P4 instructions in the indo . "he ne&t e&ecutable statement is mar+ed ith a disassembly ill load the application program and run the hen you create your pro3ect target. <efer to page %0 for rite, or code e&ecution access. "he E=ision7 simulator

yello arro . During debugging, most editor features are still available.

>or e&ample, you can use the find command or correct program errors. Program source te&t of your application is sho n in the same indo s. "he E=ision7 debug mode differs from the edit mode in the follo ing aspects: d "he RDebug .enu and Debug 8ommandsD described on page 70 are /vailable. "he additional debug indo s are discussed in the follo ing. d "he pro3ect structure or tool parameters cannot be modified. /ll build 8ommands are disabled. D *%**"&(#) W ndo"he Disassembly indo sho s your target program as mi&ed source and ith Debug L =ie as the active "race <ecords. all program assembly program or 3ust assembly code. / trace history of previously e&ecuted instructions may be displayed 2f you select the Disassembly Iindo step commands "o enable the trace history, set Debug L !nable?Disable "race <ecording. indo or+ on 8P4 instruction level rather than program source

lines. Qou can select a te&t line and set or modify code brea+points using toolbar buttons or the conte&t menu commands. Qou may use the dialog Debug L 2nline /ssemblyb to modify the 8P4 instructions. "hat allo s you to correct mista+es or to ma+e temporary changes to the target program you are debugging. B2K" # So't-%r" 2nstalling the @eil soft are on a Iindo s P8 2nsert the 8D-<C. in your computer's 8D drive Cn most computers, the 8D ill Rauto runD, and you ill see the @eil

installation menu. 2f the menu does not appear, manually double clic+

on the Setup icon, in the root directory: you menu.

ill then see the @eil

Cn the @eil menu, please select R2nstall !valuation Soft areD. (Qou ill not re#uire a license number to install this soft are). >ollo the installation instructions as they appear. Lo%d n! t," ProK"ct* "he e&ample pro3ects for this boo+ are -C" loaded automatically hen you install the @eil compiler. "hese files are stored on the 8D in a directory R?PontD. "he files are arranged by chapter: for e&ample, the pro3ect discussed in 8hapter 1 is in the directory R?Pont?8h)1d))-9elloD. <ather than using the pro3ects on the 8D ( here changes cannot be saved), please copy the files from 8D onto an appropriate directory on your hard dis+. Not": you ill need to change the file properties after copying: file transferred from the 8D ill be Tread only'. 8onfiguring the Simulator Cpen the @eil =ision7 go to Pro3ect L Cpen Pro3ect and bro se for 9ello in 8h)1d)) in Pont and open it.

In t %# M%t on () In*truct on*:

F ! <4: '#o- c,%rt o' #cd 2f the po er conditions for the normal operation of the internal reset circuit are not satisfied, then e&ecuting a series of instructions must initiali:e ;8D unit. "he procedure for this initiali:ation process is as above sho .

FLOWCHART:

8opy Data in to /ccumulator

Iait -o
2s ;8D >ree

Qes

Set <S *it !nable ;8D Send Data Disable ;8D

-o

2s Data 8ount Xero

S"CP

8opy Data in to /ccumulator

Iait -o
2s ;8D >ree

Qes

Set <S *it !nable ;8D Send Data Disable ;8D

-o

2s Data 8ount Xero

S"CP

KEIL SOFTWARE TOOL 0STEPS2

4. <.

8lic+ on the @eil u=ision 2con on Des+"op "he follo ing fig ill appear

=. D.

8lic+ on the Pro3ect menu from the title bar "hen 8lic+ on -e Pro3ect

:.

Save the Pro3ect by typing suitable pro3ect name ith no e&tension in u r o n folder sited in either 8:e or D:e

G. A. 8.

"hen 8lic+ on Save button above. Select the component for u r pro3ect. i.e. /tmelbb 8lic+ on the V Symbol beside of /tmel

9.

Select /"0,8%7 as sho n belo

4;.

"hen 8lic+ on RC@D

44.

"he >ollo ing fig ill appear

4<.

"hen 8lic+ either Q!S or -Cbbbmostly R-CD

4=. 4D.

-o your pro3ect is ready to 4S! -o double clic+ on the "arget(, you ould get another option RSource group (D as sho n in ne&t page.

4:.

8lic+ on the file option from menu bar and select Rne D

4G.

"he ne&t screen

ill be as sho n in ne&t page, and 3ust ma&imi:e

it by double clic+ing on its blue boarder.

4A. 48.

-o start riting program in either in R8D or R/S.D >or a program ritten in /ssembly, then save it ith e&tension R. asmD and for R8D based program save it ith e&tension R .8D

49.

-o

right clic+ on Source group ( and clic+ on R Add ' #"* to

Grou+ Sourc"D

<;.

-o

you

ill get another

indo , on

hich by default R8D files

ill appear.

<4. <<. <=.

-o select as per your file e&tension given hile saving the file 8lic+ only one time on option RADDD -o Press function +ey >5 to compile. /ny error ill appear if so happen.

<D. <:.

2f the file contains no error, then press 8ontrolV>% simultaneously. "he ne indo is as follo s

<G.

"hen 8lic+ RC@D

<A.

-o

8lic+ on the Peripherals from menu bar, and chec+ your

re#uired port as sho n in fig belo

<8.

Drag the port a side and clic+ in the program file.

<9. =;.

-o +eep Pressing function +ey R>((D slo ly and observe. Qou are running your program successfully

BIBLOGRAPHY: "he 0)%( .icro controller and !mbedded Systems o .uhammad /li.a:idi o JaniceGillis pie.a:idi

"he0)%(.icrocontroller/rchitecture,ProgrammingG /pplications o @ennethJ./ yala >undamentals of .icro processors and .icro computers o *. <am !lectronic 8omponents D.=.Prasad

R"'"r"nc"* on t," W"(:


.national.com .atmel.com

---.& cro*o't*"%rc,.co& ---.!"oc t "*.co&

S-ar putea să vă placă și