Sie sind auf Seite 1von 52

A VEHICLE TO VEHICLE COMMUNICATION PROTOCOL FOR CO-OPERATIVE COLLISION WARNING.

A PROJECT REPORT Submitted by

DHINESH NS VELMURUGAN P VEN ATARAMANAN S

[40507105010] [40507105048] [4050710504!]

In partial fulfillment for the award of the degree Of

"ACHELOR OF ENGINEERING
IN

ELECTRICAL AND ELECTRONICS ENGINEERING

DHANALA SHMI COLLEGE OF ENGINEERING

ANNA UNIVERSIT#$ CHENNAI %00 0&5


APRIL - &011

ANNA UNIVERSIT#$ CHENNAI %00 0&5


"ONAFIDE CERTIFICATE
Certified that this project report 'A VEHICLE TO VEHICLE COMMUNICATION PROTOCOL FOR CO-OPERATIVE

COLLISION WARNING( is the bonafide work of DHINESH NS) VELMURUGAN P) VEN ATARAMANAN S( who carried out the project work under my supervision.

SIGNATURE Dr. N.T. Kumar Ph.D., .!.".T.#., $.!.#.

.!.".T.#., $.!.#.

SIGNATURE r. "."hanmu%am

.#.,

HEAD OF THE DEPARTMENT #&ectrica& and #&ectronics #n%ineerin%, Dhana&akshmi Co&&e%e of #n%ineerin%, Dr.'.P.( Na%ar, animan%a&am, Chennai ) *+, -+,

SUPERVISOR ASSOCIATE PROFESSOR #&ectrica& and #&ectronics #n%ineerin%, Dhana&akshmi Co&&e%e of #n%ineerin%, Dr. '.P.( Na%ar, animan%a&am, Chennai ) *+, -+,

"ubmitted for the project viva.voce e/amination he&d at Dhana&akshmi Co&&e%e of #n%ineerin%, Chennai on 0000000000000.

SIGNATURE !NT#(N12 #31 !N#(

SIGNATURE #3T#(N12 #31 !N#(

AC NOWLEDGEMENT 4win% deep&y to supreme, we e/press our sincere thanks to our honorab&e C*+,-.+/ D-.V.P.R+.+.0-1*, P*.D.) Dhana&akshmi Co&&e%e of #n%ineerin%, Chennai, for the faci&ities provided by him for the comp&etion of this project. 5e e/press our who&e hearted thanks to our S23-21+-4 D-.R.J24+3*+/5-+ S,/6* P*.D.) for his inva&uab&e support. 5e are very much revered to our P-,/3,7+8

D-.S.V29+1+3*+8+7+1*4 P*.D.) for his consistent %uidance shown in our academic profi&e. 5e e/tend our heartfe&t %ratitude to our V,32 P-,/3,7+8) H2+5 :; D27+-1.2/1 D-. N.T. 0.+- P*.D.) M.I.S.T.E.) F.I.E) for his consistent encoura%ement shown throu%hout our co&&e%e days. 5e are very much ob&i%ed to our P-:<231 C:-3::-5,/+1:- M-. V."+8+<, M.E.) P*.D.) for his infa&&ib&e support rendered in %uidin% us at every &eve& of work. 5e are very thankfu& to M-. S.S*+/.06+.. M.E.) I/12-/+8 60,52) for providin% us technica& %uidance throu%hout the project. 5e are thankfu& to a&& our teachin% and non.teachin% staffs of our co&&e%e and our be&oved friends who had rendered their he&p in successfu&&y comp&etin% our project.

A"STRACT

4ur Project proposes a vehic&e.to.vehic&e communication protoco& for cooperative co&&ision warnin%. #mer%in% wire&ess techno&o%ies for vehic&e.to.vehic&e 6'7'8 communications are promisin% to dramatica&&y reduce the number of fata& roadway accidents by providin% ear&y warnin%s. 4ne major technica& cha&&en%e addressed in this our project is to achieve &ow.&atency in de&iverin% emer%ency warnin%s in various road situations. 9ased on a carefu& ana&ysis of app&ication re:uirements, we desi%n an effective protoco&, comprisin% con%estion contro& po&icies, service differentiation mechanisms and methods for emer%ency warnin% dissemination. "imu&ation resu&ts demonstrate that the proposed protoco& achieves &ow &atency in de&iverin% emer%ency warnin%s and efficient bandwidth usa%e in stressfu& road scenarios. The wire&ess data communication between two vehic&es is provided by introducin% ;i%bee techno&o%y. !t is desi%ned around &ow.power consumption a&&owin% batteries to essentia&&y &ast forever. The distance measurement is provided by <&trasonic sensors. <&tra sonic sensors are transmittin% and receivin% u&trasonic si%na&s

TA"LE OF CONTENTS CHAPTER NO. TITLE LIST OF TA"LES LIST OF FIGURES LIST OF A""REVIATIONS 1 & INTRODUCTION "LOC DIAGRAM , 7 PAGE

ULTRASONIC SENSORS -., $<NCT!4N -.7 D!"T1NC# #1"<(# #NT

MICROCONTROLLER 8!C51 =., $#1T<(#" =.7 D#"C(!PT!4N =.- 1(C>!T#CT<(# =.= P!N D!1?(1 =.@ P!N D#"C(!PT!4N =.* 19"42<T# 13! < (1T!N?

=IG"EE @., !NT(4D<CT!4N @.7 54(K!N? P(!NC!P2# @.- TAP#" 4$ ;!?9## @.= 1(#1" 4$ 1PP2!C1T!4N

"U==ER *., !NT(4D<CT!4N *.7 54(K!N? P(!NC!P2#

SCHEMATIC DIAGRAMS B., <2T(1"4N!C "#N"4( B.7 ;!?9## B.B.= !C(4C4NT(422#( 13-7-7#P#

B.@ 2D,,,B"-- "4T.7-B.* T!P,77 8 ! PROGRAMMING 8!C51 DATA SHEETS C., <2T(1"4N!C "#N"4( C.7 !C(4C4NT(422#(

C.- ;!?9## C.= 13-7-7#P#

C.@ 2D,,,B"-- "4T.7-C.* T!P,77 ,+ ,, REFERENCE CONCLUSION "I"LOGRAPH#

CHAPTER 1 INTRODUCTION
(oad accidents account for a severe threat to human &ives from both an injury as we&& as a financia& perspective. ?iven that vehic&es are desi%ned to faci&itate a smooth means of transportation, manufacturers have &on% been in the process of desi%nin% vehic&es based on princip&es of re&iabi&ity and safety. >owever, due to reasons such as human.error, circumstantia& error and ne%&i%ence, accidents occur. Today, specia& attention is focused on the techno&o%ies that can reduce traffic accidents. '7' techno&o%ies are simp&e to imp&ement primari&y because of their re&iance on wire&ess communication. The communication protoco& inc&udes ;i%bee to communicate the information between two vehic&es. The distance measurement between two vehic&es is done by <&trasonic sensor. The microcontro&&er contro&s entire process, it is pro%rammed to send a si%na& to buDDer and Di%bee when the distance ran%e is obtained. The main objective of our project is to a&ert the driver when he c&oses to the front vehic&e. Durin% ni%ht times some of the vehic&es such as car, bus may break down at the hi%hways. This vehic&e now appears to be an obstac&e to the vehic&e that is comin% behind of it. This causes a %reater chances of accident, the vehic&e comin% behind may hit hard&y to the back of stationary vehic&e and it may &ead to the %reater dama%e.

CHAPTER & "LOC DIAGRAM

CHAPTER > ULTRASONIC SENSOR >.1 FUNCTION$


They are a&so known as transducers, they both send and receive the si%na&. !t works on the princip&e simi&ar to radar or "onar which eva&uate attributes of a tar%et by interpretin% the echoes from radio or sound waves respective&y. They %enerate hi%h fre:uency sound waves and eva&uate the echo which is received back by the sensor. "ensors ca&cu&ate the time interva& between sendin% the si%na& and receivin% the echo to determine the distance to an object.

5henever a sound wave movin% in air hits a so&id surface it ref&ects . 5e often ca&& this ref&ected sound as an echo. The same app&ies to a sound wave movin% throu%h water and hittin% an obstac&e. !f we know the speed of sound in the air or water we can ca&cu&ate the distance. To perform this we must measure the time taken for a pu&se of sound to trave& to the object and back a%ain. The distance to the object and back is %iven by 6distanceE"peed F Time8. 1s this is the tota& distance that the sound has trave&ed to the object and back, we must divide by 7 to find the one.way distance. This use of echoes is the basis of "4N1(. The pu&se of sound that is used shou&d be short and hi%h fre:uencies are usua&&y used as they trave& further without bein% absorbed. "ounds with a fre:uency above 7+ k>D are ca&&ed u&trasonic6beyond the ran%e of human hearin%8. The speed of sound varies from one materia& to another. Typica& speeds are appro/imate&y --+ mGs in air, ,@++ mGs in water, @+++ mGs in a meta&. >ere the u&trasonic sensor ca&cu&ates the distance between the sensor and the obstac&e and transmits it to the system. 4nce an object is detected, a si%na& is sent to the onboard sense and avoids co&&ision and corrective action is taken by the use of micro.contro&&er.

DISTANCE MEASUREMENT$
Different techni:ues can be used to measure the distance by usin% u&trasonic sensors. 1mon% them , continuous.wave and pu&se.echo techni:ue are wide&y known. !n continuous.wave methods, the transmitter %enerates a continuous output, whose echo is detected by a separate receiver. !n this case, accuracy depends on the measurement of the phase shift between the transmitted and the ref&ected wave. 1&thou%h better performance than with pu&se.echo measurements can be obtained, comp&e/ hardware is re:uired to measure the phase, and in most cases,

different fre:uencies need to be used to determine the number of inte%er wave&en%ths in the phase shift. Pu&se.echo techni:ues are wide&y used in commercia& systems due to &ess comp&e/ity of hardware. !n pu&se.echo techni:ue, a short train of pu&ses is %enerated, enab&in% the same transducer to be used both as a transmitter and as a receiver. !n the measurement methods, based on pu&se.echo, the distance information is retrieved from a time.off&i%ht measurement, i.e., the time an u&trasonic wave needs to trave& from the transmitter to the receiver after bein% ref&ected by an object. The pu&se.echo techni:ue is used in this paper to ca&cu&ate the distance of the obstac&e from the vehic&e. The distance between the transmitter and the object is determined usin% the fo&&owin% e:uationH DE 6t F c8 G 7 5here D. Distance between the source and the obstac&e c. <&trasonic wave ve&ocity in air t. Time interva& between pu&se emission and echo detection.

CHAPTER 4 MICROCONTROLLER AT8!C51 4.1 FEATURES$


,. Compatib&e with C".@,I Products emory) 7. =K 9ytes of !n."ystem (epro%rammab&e $&ash #nduranceH ,,+++ 5riteG#rase Cyc&es -. $u&&y "tatic 4perationH + >D to 7= =. Three.&eve& Pro%ram @. ,7J / J.bit !nterna& (1 *. -7 Pro%rammab&e !G4 2ines B. Two ,*.bit TimerGCounters J. "i/ !nterrupt "ources C. Pro%rammab&e "eria& Channe& ,+.2ow.power !d&e and Power.down odes emory 2ock >D.

4.& DESCRIPTION$
The 1TJCC@, is a &ow.power, hi%h.performance C 4" J.bit microcomputer with =K bytes of $&ash pro%rammab&e and erasab&e read on&y memory 6P#(4 8. The device is manufactured usin% 1tme&Ks hi%h. density nonvo&ati&e memory techno&o%y and is compatib&e with the industry.standard C".@, instruction set and pinout. The on.chip $&ash a&&ows the pro%ram memory to be repro%rammed in.system or by a conventiona& nonvo&ati&e memory pro%rammer.

4.> ARCHITECTURE$

4.4 PIN DIAGRAM$

4.5 PIN DESCRIPTIONS$


VCC."upp&y vo&ta%e. GND.?round. P:-1 0.!t is an J.bit open.drain bi.directiona& !G4 port. 1s an output port, each pin can sink ei%ht TT2 inputs. 5hen ,s are written to port + pins, the pins can be used as hi%h impedance inputs it may a&so be confi%ured to be the mu&tip&e/ed &ow order addressGdata bus durin% accesses to e/terna& pro%ram and data memory. !n this mode P+ has interna& pu&&.ups. Port + a&so receives the code bytes durin% $&ash pro%rammin%, and outputs the code bytes durin% pro%ram verification. #/terna& pu&&.ups are re:uired durin% pro%ram 'erification. P:-1 1.!t is an J.bit bi.directiona& !G4 port with interna& pu&&.ups.The Port , output buffers can sinkGsource four TT2 inputs. 5hen ,s are written to Port , pins they are pu&&ed hi%h by the interna& pu&&.ups and can be used as inputs. 1s inputs, Port , pins that are e/terna&&y bein% pu&&ed &ow wi&& source current 6!!28 because of the interna& pu&&.ups. Port , a&so receives the &ow.order address bytes durin% $&ash pro%rammin% and verification. P:-1 &.!t is an J.bit bi.directiona& !G4 port with interna& pu&&.ups. The Port 7 output buffers can sinkGsource four TT2 inputs. 5hen ,s are written to Port 7 pins they are pu&&ed hi%h by the interna& pu&&.ups and can be used as inputs. 1s inputs, Port 7 pins that are e/terna&&y bein% pu&&ed &ow wi&& source current 6!!28 because of the interna& pu&&.ups. Port 7 emits the hi%h.order address byte durin% fetches from e/terna& pro%ram memory and durin% accesses to e/terna& data memory that uses ,*.bit addresses 6 4'3 LDPT(8. !n this app&ication, it uses stron% interna& pu&&.ups when emittin% ,s. Durin% accesses to e/terna& data memory that uses J.bit addresses 6 4'3 L (!8, Port 7 emits the contents of the P7

"pecia& $unction (e%ister. Port 7 a&so receives the hi%h.order address bits and some contro& si%na&s durin% $&ash pro%rammin% and verification. P:-1 >-!t is an J.bit bi.directiona& !G4 port with interna& pu&&.ups. The Port - output buffers can sinkGsource four TT2 inputs. 5hen ,s are written to Port - pins they are pu&&ed hi%h by the interna& pu&&.ups and can be used as inputs. 1s inputs, Port - pins that are e/terna&&y bein% pu&&ed &ow wi&& source current 6!!28 because of the pu&&.ups. Port - a&so serves the functions of various specia& features of the 1TJCC@, as &isted be&owH

Port - a&so receives some contro& si%na&s for $&ash pro%rammin% and verification. RST-(eset input. 1 hi%h on this pin for two machine cyc&es whi&e the osci&&ator is runnin% resets the device. ALE?PROG-1ddress 2atch #nab&e output pu&se for &atchin% the &ow byte of the address durin% accesses to e/terna& memory. This pin is a&so the pro%ram pu&se input 6P(4?8 durin% $&ash pro%rammin%. !n norma& operation 12# is emitted at a constant rate of ,G* the osci&&ator fre:uency, and may be used for e/terna& timin% or c&ockin% purposes. !f desired, 12# operation can be disab&ed by settin% bit + of "$( &ocation J#>. 5ith the bit set, 12# is active on&y durin% a 4'3 or 4'C

instruction. 4therwise, the pin is weak&y pu&&ed hi%h. "ettin% the 12#. disab&e bit has no effect if the microcontro&&er is in e/terna& e/ecution mode. PSEN.Pro%ram "tore #nab&e is the read strobe to e/terna& pro%ram memory. 5hen the 1TJCC@, is e/ecutin% code from e/terna& pro%ram memory, P"#N is activated twice each machine cyc&e, e/cept that two P"#N activations are skipped durin% each access to e/terna& data memory. EA?VPP- #/terna& 1ccess #nab&e. #1 must be strapped to ?ND in order to enab&e the device to fetch code from e/terna& pro%ram memory &ocations startin% at ++++> up to $$$$>. This pin a&so receives the ,7. vo&t pro%rammin% enab&e vo&ta%e 6'PP8 durin% $&ash pro%rammin%, for parts that re:uire ,7.vo&t 'PP. @TAL1- !nput to the invertin% osci&&ator amp&ifier and input to the interna& c&ock operatin% circuit. @TAL&- 4utput from the invertin% osci&&ator amp&ifier.

4.% AAB:8012 M+C,.0. R+1,/6B$


4peratin% Temperature "tora%e Temperature 'o&ta%e on any Pin with (espect to ?round a/imum 4peratin% 'o&ta%e DC 4utput Current
.@@oC to M,7@oC .*@C to M,@+C .,.+' to MB.+' *.*' ,@.+m1

CHAPTER 5 =IG"EE 5.1 INTRODUCTION


;i%9ee is the name of a specification for a suite of hi%h &eve& communication protoco&s usin% sma&&, &ow.power di%ita& radios based on the !### J+7.,@.=.7++* standard for wire&ess persona& area networks 65P1Ns8, such as wire&ess headphones connectin% with ce&& phones via short ran%e radio. The techno&o%y is intended to be simp&er and &ess e/pensive than other 5P1NKs, such as 9&uetooth. !t is suitab&e for &ow data rate and &ow power consumption app&ication with other wire&ess techno&o%ies such as 9&uetooth and 5i.$i. 1pp&ication inc&udes home and bui&din% automation, industria& contro&, vehic&e mana%ement systems. The ;i%9ee modu&e avai&ab&e in the re%u&ar ,+m ran%e version, and the -+m pro version.

5.& WOR ING PRINCIPLE


;i%9ee hardware typica&&y consist of an ei%ht bit icrocontro&&er combined with a miniature transceiver a sma&& amount 6e/. -7 K98 of f&ash memory and (1 . The 39ee modu&e is interconnected with the ei%ht bit microcontro&&er. The C 4" &o%ic is used between the icrocontro&&es amd 39## modu&e, the fo&&owin% fi%ure e/p&ains how the information is transmitted and received usin% ;i%9ee.

5.> T#PES OF =IG"EE


=,6"22 C::-5,/+1:- D=CE The most capab&e device, the coordinator forms the root of the network tree and mi%ht brid%e to other networks. There is e/act&y one ;i%bee coordinator in each network since it is the device that started the network ori%ina&&y. !t is ab&e to store information about the network, actin% as the Trust Centre. =,6"22 R:012- D=RE !t can act as an intermediate router, passin% data from other devices. =,6"22 E/5 D2F,32B D=EDE Contains just enou%h functiona&ity to ta&k to the parent node, it cannot re&ay data from other devices. This re&ationship a&&ows the node to be as&eep a si%nificant amount of the time thereby %ivin% &on% battery &ife. 1 ;#D re:uires the &east amount of memory, and can be &ess e/pensive to manufacture than a ;( or ;C.

5.4 AREAS OF APPLICATION


>4 # 151(#N#""H 5ater sensors, power sensors, smoke and fire detectors, smart app&iances and access sensors. 49!2# "#('!C#"H m.payement, m.monitorin% and contro&, m. security and access contro&. !ND<"T(!12 P21NTH Process contro&, asset mana%ement, environmenta& mana%ement, industria& device contro&.

CHAPTER % "U==ER %.1 INTRODUCTION


1 buDDer is a si%na&in% device, used in automobi&es, househo&d app&iances such as microwave oven. The pieDoe&ectric sound components operate on an princip&e uti&iDin% natura& osci&&ation of pieDoe&ectric ceramics. Today, pieDoe&ectric sound components are used in many ways such as home app&iances, audio e:uipment te&ephones. They are app&ied wide&y in a&arms, speakers, te&ephone rin%ers, receivers, transmitters, beep sounds, etc.

%.& WOR ING PRINCIPLE


9asica&&y, the sound source of a pieDoe&ectric sound component is a pieDoe&ectric diaphra%m. !t consists of a pieDoe&ectric ceramic p&ate which has e&ectrodes on both sides and a meta& p&ate. Ceramic p&ate is attached to a meta& p&ate with adhesives. 1pp&yin% D.C. vo&ta%e between e&ectrodes of a pieDoe&ectric diaphra%m causes mechanica& distortion due to the pieDoe&ectric effect.

Diaphra%m operation

$or a misshaped pieDoe&ectric e&ement, the distortion of the pieDoe&ectric e&ement e/pands in a radia& direction. The meta& p&ate bonded to the pieDoe&ectric e&ement does not e/pand. Converse&y , when the pieDoe&ectric e&ement shrinks, thus, when 1.C. vo&ta%e is app&ied across e&ectrodes, producin% sound waves in the air.

CHAPTER 7 SCHEMATIC DIAGRAMS B., <2T(1"4N!C "#N"4(

B.7 ;!?9##

B.-

!C(4C4NT(422#(

B.=

13-7-7#P#

B.= 2D,,,B"-- "4T.7--

B.= T!P,77

CHAPTER 8 PROGRAMMING OF AT89C51


$MOD52 ORG 0000H LJMP MAIN ORG 0100H ; DEFINITIONS SPDAT A!'R SPSR T2MOD SP)TL SPA)E ;-IT MAS.S -IT0 -IT1 -IT2 -IT0 -IT/ -IT5 -IT# -IT1 E E E E E ! ! ! ! ! 0"#H ;SPI Da$a Re%i&$er 0"EH 0AAH ;SPI S$a$(& Re%i&$er 0)*H 0D5H ;SPI )+,$r+l Re%i&$er 020H ; library file

E !

E E E E E E E E

! ! ! ! ! ! ! !

001H 002H 00/H 00"H 010H 020H 0/0H 0"0H

;SPI )+,$r+l Re%i&$er -i$ Ma&2& SPIE E ! -IT1 SPE E ! -IT# DORD E ! -IT5 MSTR E ! -IT/ )POL E ! -IT0 )PHA E ! -IT2 SPR1 E ! -IT1 SPR0 E ! -IT0 ;SPI S$a$(& Re%i&$er -i$ Ma&2& SPIF E ! -IT1 SP3)OL E ! -IT# ;A&&(45$i+,6 N+r4ally DA)7)S i& l+89 8:i;: 8ill 5er4i$ $+ 8ri$e ;<a$a i,$+ DA)7LO3 a,< DA)7HIGH la$;:e& 8i$:+($ affe;$i,% DA) +($5($= ;T:e,9 DA)7)S i& 5(lle< :i%: a,< $:e, <+8, $+ %i>e $:e <i%i$al i,5($ ;a,< DA) a,< all+8 f(r$:er <a$a $+ be 8ri$$e, i,$+ DA)7LO3 a,< DA)7HIGH ;la$;:e& DA)7)S E ! -IT1

-!??ER1 IR7T'1 IR7T'2 -!??ER2

E E E E

! ! ! !

-IT0 -IT1 -IT2 -IT0 E ! 0FEH E ! E ! E ! E ! E ! E ! E ! 0F1H -IT2 -IT0 -IT0 -IT1 0FDH -IT2 0F-H 00#H 0F*H -IT0

-!??ER17ON7MAS. -!??ER17OFF7MAS. E ! IR7T'17ON7MAS. IR7T'17OFF7MAS. IR7T'27ON7MAS. IR7T'27OFF7MAS. IR7T'17T'27ON7MAS. IR7T'17T'27OFF7MAS. -!??ER27ON7MAS. -!??ER27OFF7MAS. E ! IR7R'17MAS. IR7R'27MAS. E ! E !

; !&er <efi,e< re%i&$er& i, i,$er,al 4e4+ry STAT!S )MD7R)@D E ! SE)OND7)NT E ! DA)7LO37DATA DA)7HIGH7DATA LED7REFRESH7)NT TEMP E ! TEST7FLAG E ! E ! 005H 00#H E ! E ! E ! 00AH 00-H 001H 001H 00"H 00*H

; Me4+ry 4a55e< IAO Re%i&$er a<<re&&e& ;La$;:e& DA)7LO37LE E ! DA)7HIGH7LE L)D17LE O!TP!T717LE O!TP!T727LE STEPPER17LE ;-(ffer& INP!T717OE E ! MAIN6 MO@ TMOD9 B20H MO@ TH19 B0FDH ;ry&$al MO@ S)ON9 B50H MO@ P)ON9 B"0H MHC ;ry&$al MO@ T2)ON9 B00H (&e $i4er1 MO@ T)ON9 B/0H ; -a(< ra$e &e$ $+ *#00 f+r 11=05*2 MHC ; D+(ble ba(< ra$e 1*200 f+r 11=05*2 ;)lear T)L. a,< R)L. i, +r<er $+ "000H E ! "001H E ! "000H E ! "100H E ! "200H E ! "000H /000H

MO@ A!'R9B01H ;)leari,% E'TRAMDbi$1E all+8& $:e eF5a,<e< RAM +f 1#"- D00H $+ 2FFHE $+ be ;i,<ire;$ly a;;e&&ible by MO@'= Se$$i,% A0Dbi$0E all+8& ALE i& a;$i>e ;+,ly <(ri,% MO@' a,< MO@) MO@ MO@ MO@ TF2 LED7REFRESH7)NT9B00H TEST7FLAG9B00H A9B00H ;S8i$;: +ff -(CCer1 G 29 IR TF19 a,< IR

MO@ DA)7HIGH7DATA9A MO@ DA)7LO37DATA9B00H MO@ SP)TL9B050H ;Di&able SPI i,$err(5$9 E,able SPI9 MS- Fir&$9 Ma&$er M+<e9 S). a;$i>e HIGH9 &:if$ $ri%%ere< ;+, lea<i,% e<%e9 S).Hf+&;A12" MO@ SPSR9B000H ;)lear SPIF9 SP3)OL bi$& i, $:e SPI S$a$(& Re%i&$er MO@ P09B0FFH ;3ri$e 1& i,$+ all 5+r$ bi$& i, +r<er $+ 4a2e 5+r$0 a& i,5($ SET- P0=2 ;3ri$e 1 i,$+ 5+r$0 5i,2DIR re;ei>er 1E i, +r<er $+ 4a2e i$ a& i,5($ 5+r$ SET- P0=0 ;3ri$e 1 i,$+ 5+r$0 5i,0DIR re;ei>er 2E i, +r<er $+ 4a2e i$ a& i,5($ 5+r$ L)ALL STEP/ ;-y <efa(l$9 Ga$e i& +5e, MO@ STAT!S9B000H LJMP $ ;S$e55er M+$+r ;)l+;2 3i&e D)3E R+$a$i+, ;S$e5 19 29 09 / ;)37ROTATION6 ; L)ALL )37)I)LE ; LJMP )37ROTATION ; RET ;)+(,$er )l+;2 3i&e D))3E R+$a$i+, ;S$e5 09 29 19 / ;))37ROTATION6 ; L)ALL ))37)I)LE ; LJMP ))37ROTATION ; RET ;Ge,era$e IR &i%,al 8i$: ;+,$i,+(& 1J& ;P(l&e Ra$e6 0" .HCD10 4i;r+&e;+,< +,9 10 4i;r+&e;+,< +ffE9 -(r&$ Le,%$: H 20 ;y;le&9 Ga5 Le,%$: H /0 ;y;le& ;GENERATE7)ONTINO!S7IR7-IT716 ; L)ALL GENERATE7IR7-IT71 ; MO@ A9P0 ; ANL A9BIR7R'17MAS. ; )JNE A9BIR7R'17MAS.9IR7R'17LO3 ;IR7R'17HIGH6 ; MO@ A9DA)7HIGH7DATA ; ORL A9B-!??ER17ON7MAS.

; MO@ DA)7HIGH7DATA9A ; L)ALL 3RITE7DA)7DATA ; LJMP TO7GENERATE7IR7GAP1 ;IR7R'17LO36 ; MO@ A9DA)7HIGH7DATA ; ANL A9B-!??ER17OFF7MAS. ; MO@ DA)7HIGH7DATA9A ; L)ALL 3RITE7DA)7DATA ;TO7GENERATE7IR7GAP16 ; L)ALL GENERATE7IR7GAP ; LJMP GENERATE7)ONTINO!S7IR7-IT71 MO@ MO@ MO@ STAT!S9B000H SE)OND7)NT9B000H )MD7R)@D9B000H

)HE).7SE)OND7)NT6 MO@ A9SE)OND7)NT )JNE A9B000H9R)@7)MD LJMP SEND7STAT!S R)@7)MD6 JN- RI9)HE).7LOOP MO@ A9S-!F MO@ )MD7R)@D9A )LR RI L)ALL DELAI LJMP $ TO7)HE).7LOOP6 LJMP )HE).7LOOP IN@ALID7)MD7R)@D6 L)ALL SEND7 !OTE L)ALL SEND7I L)ALL SEND7N L)ALL SEND7@ L)ALL SEND7A L)ALL SEND7L L)ALL SEND7I L)ALL SEND7D L)ALL SEND7SPA)E L)ALL SEND7) L)ALL SEND7O L)ALL SEND7M L)ALL SEND7M L)ALL SEND7A L)ALL SEND7N L)ALL SEND7D L)ALL SEND7SPA)E L)ALL SEND7R L)ALL SEND7E L)ALL SEND7) L)ALL SEND7E L)ALL SEND7I L)ALL SEND7@

L)ALL SEND7E L)ALL SEND7D L)ALL SEND7 !OTE L)ALL SEND7NE37LINE L)ALL SEND7)ARRIAGE7RET!RN LJMP IN)REMENT7SE)OND7)NT )HE).7LOOP6 LJMP IN)REMENT7SE)OND7)NT SEND7STAT!S6 L)ALL SEND7 !OTE L)ALL SEND7STAT!S L)ALL SEND7 !OTE L)ALL SEND7NE37LINE L)ALL SEND7)ARRIAGE7RET!RN IN)REMENT7SE)OND7)NT6 MO@ A9SE)OND7)NT ADD A9B001H MO@ SE)OND7)NT9A )JNE A9B0*H9END7IN)REMENT7SE)OND7)NT MO@ SE)OND7)NT9B000H END7IN)REMENT7SE)OND7)NT6 L)ALL ONE7SE)OND7DELAI LJMP )HE).7SE)OND7)NT GENERATE7IR7-IT716 ;Ge,era$e 20 IR P(l&e& MO@ P09B0FFH MO@ DPTR9BDA)7HIGH7LE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE L)ALL GENERATE7IR7P!LSE RET GENERATE7IR7P!LSE6 MO@ A9DA)7HIGH7DATA

ORL A9BIR7T'17ON7MAS. MO@ DA)7HIGH7DATA9A MO@' KDPTR9A L)ALL THIRTEEN7MI)ROSE)OND7DELAI MO@ A9DA)7HIGH7DATA ANL A9BIR7T'17OFF7MAS. MO@ DA)7HIGH7DATA9A MO@' KDPTR9A L)ALL THIRTEEN7MI)ROSE)OND7DELAI RET GENERATE7IR7GAP6 ;Ge,era$e /0 IR P(l&e Delay& L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI L)ALL IR7P!LSE7DELAI RET ;A55r+Fi4a$ely %i>e& 10 4& <elay f+r 11=05*# MHC ;ry&$al

DELAI6 MO@ R19 B10 DELAI16 MO@ R29 B255 DELAI26 NOP NOP DJN? R29 DELAI2 DJN? R19 DELAI1 RET ;A55r+Fi4a$ely %i>e& 10 4i;r+&e;+,< <elay f+r 11=05*# MHC ;ry&$al ;TOTAL N!M-ER OF INSTR!)TION )I)LE RE !IRED FOR 10 MI)ROSE)OND ;DELAI IS 10 L 10M# A D12 L 10M# A 11=05*#E H 10 L 11=05*# A 12 H 12 ;2 )I)LES FOR L)ALL9 " )I)LES FOR NOP9 ONE )I)LE FOR RET ;Re<(;e fO!R NOP& $+ ;+45e,&a$e f+r fO!R i,&$r(;$i+,& bef+re ;alli,% $:ir$ee, 4i;r+&e;+,< <elay THIRTEEN7MI)ROSE)OND7DELAI6 ; NOP ; NOP ; NOP ; NOP NOP NOP NOP NOP RET IR7P!LSE7DELAI6 ;A<<e< fO!R NOP& $+ ;+45e,&a$e f+r $:e re4+>al +f fO!R NOP& i, $:ir$ee, 4i;r+&e;+,< <elay ; NOP ; NOP NOP NOP L)ALL THIRTEEN7MI)ROSE)OND7DELAI ;A<<e< fO!R NOP& $+ ;+45e,&a$e f+r $:e re4+>al +f fO!R NOP& i, $:ir$ee, 4i;r+&e;+,< <elay ; NOP ; NOP NOP NOP L)ALL THIRTEEN7MI)ROSE)OND7DELAI RET ONE7TENTH7SE)OND7DELAI6 L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI

RET !ARTER7SE)OND7DELAI6 L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL RET HALF7SE)OND7DELAI6 L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI

L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL L)ALL RET

DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI DELAI

ONE7SE)OND7DELAI6 L)ALL HALF7SE)OND7DELAI L)ALL HALF7SE)OND7DELAI RET THREE7SE)OND7DELAI6 L)ALL ONE7SE)OND7DELAI L)ALL ONE7SE)OND7DELAI L)ALL ONE7SE)OND7DELAI RET SE@EN7SE)OND7DELAI6 L)ALL ONE7SE)OND7DELAI L)ALL ONE7SE)OND7DELAI L)ALL ONE7SE)OND7DELAI L)ALL ONE7SE)OND7DELAI L)ALL ONE7SE)OND7DELAI L)ALL ONE7SE)OND7DELAI L)ALL ONE7SE)OND7DELAI

RET TEN7SE)OND7DELAI6 L)ALL THREE7SE)OND7DELAI L)ALL SE@EN7SE)OND7DELAI RET THIRTI7SE)OND7DELAI6 L)ALL THREE7SE)OND7DELAI L)ALL SE@EN7SE)OND7DELAI L)ALL THREE7SE)OND7DELAI L)ALL SE@EN7SE)OND7DELAI L)ALL THREE7SE)OND7DELAI L)ALL SE@EN7SE)OND7DELAI RET FORTI7SE)OND7DELAI6 L)ALL THREE7SE)OND7DELAI L)ALL SE@EN7SE)OND7DELAI L)ALL THREE7SE)OND7DELAI L)ALL SE@EN7SE)OND7DELAI L)ALL THREE7SE)OND7DELAI L)ALL SE@EN7SE)OND7DELAI L)ALL THREE7SE)OND7DELAI L)ALL SE@EN7SE)OND7DELAI RET 3RITE7DA)7DATA6 MO@ P09B0FFH MO@ DPTR9BDA)7HIGH7LE MO@ A9DA)7HIGH7DATA DA)7)SH0 MO@' KDPTR9A MO@ MO@ MO@ MO@' MO@ MO@ MO@ ORL MO@' P09B0FFH DPTR9BDA)7LO37LE A9DA)7LO37DATA KDPTR9A

;!PPER / -ITS OF DA) DATA9

;LO3ER " -ITS OF DA) DATA

P09B0FFH DPTR9BDA)7HIGH7LE A9DA)7HIGH7DATA ;!PPER / -ITS OF DA) DATA A9BDA)7)S ;DA)7)SH1 KDPTR9A

MO@ MO@ MO@ DA)7)SH0 MO@' RET

P09B0FFH DPTR9BDA)7HIGH7LE A9DA)7HIGH7DATA KDPTR9A

;!PPER / -ITS OF DA) DATA9

SEND7A6 MO@ A9BJAJ MO@ S-!F9A SND7A6 JN- TI9SND7A )LR TI L)ALL DELAI RET SEND7-6 MO@ A9BJ-J MO@ S-!F9A SND7-6 JN- TI9SND7)LR TI L)ALL DELAI RET SEND7)6 MO@ A9BJ)J MO@ S-!F9A SND7)6 JN- TI9SND7) )LR TI L)ALL DELAI RET SEND7D6 MO@ A9BJDJ MO@ S-!F9A SND7D6 JN- TI9SND7D )LR TI L)ALL DELAI RET SEND7E6 MO@ A9BJEJ MO@ S-!F9A SND7E6 JN- TI9SND7E )LR TI L)ALL DELAI RET SEND7F6 MO@ A9BJFJ MO@ S-!F9A SND7F6 JN- TI9SND7F )LR TI L)ALL DELAI

RET SEND7G6 MO@ A9BJGJ MO@ S-!F9A SND7G6 JN- TI9SND7G )LR TI L)ALL DELAI RET SEND7H6 MO@ A9BJHJ MO@ S-!F9A SND7H6 JN- TI9SND7H )LR TI L)ALL DELAI RET SEND7I6 MO@ A9BJIJ MO@ S-!F9A SND7I6 JN- TI9SND7I )LR TI L)ALL DELAI RET SEND7J6 MO@ A9BJJJ MO@ S-!F9A SND7J6 JN- TI9SND7J )LR TI L)ALL DELAI RET SEND7.6 MO@ A9BJ.J MO@ S-!F9A SND7.6 JN- TI9SND7. )LR TI L)ALL DELAI RET SEND7L6 MO@ A9BJLJ MO@ S-!F9A SND7L6 JN- TI9SND7L )LR TI L)ALL DELAI RET SEND7M6 MO@ A9BJMJ MO@ S-!F9A SND7M6 JN- TI9SND7M )LR TI L)ALL DELAI

RET SEND7N6 MO@ A9BJNJ MO@ S-!F9A SND7N6 JN- TI9SND7N )LR TI L)ALL DELAI RET SEND7O6 MO@ A9BJOJ MO@ S-!F9A SND7O6 JN- TI9SND7O )LR TI L)ALL DELAI RET SEND7P6 MO@ A9BJPJ MO@ S-!F9A SND7P6 JN- TI9SND7P )LR TI L)ALL DELAI RET SEND7 6 MO@ A9BJ J MO@ S-!F9A SND7 6 JN- TI9SND7 )LR TI L)ALL DELAI RET SEND7R6 MO@ A9BJRJ MO@ S-!F9A SND7R6 JN- TI9SND7R )LR TI L)ALL DELAI RET SEND7S6 MO@ A9BJSJ MO@ S-!F9A SND7S6 JN- TI9SND7S )LR TI L)ALL DELAI RET SEND7T6 MO@ A9BJTJ MO@ S-!F9A SND7T6 JN- TI9SND7T )LR TI L)ALL DELAI

RET SEND7!6 MO@ A9BJ!J MO@ S-!F9A SND7!6 JN- TI9SND7! )LR TI L)ALL DELAI RET SEND7@6 MO@ A9BJ@J MO@ S-!F9A SND7@6 JN- TI9SND7@ )LR TI L)ALL DELAI RET SEND736 MO@ A9BJ3J MO@ S-!F9A SND736 JN- TI9SND73 )LR TI L)ALL DELAI RET SEND7'6 MO@ A9BJ'J MO@ S-!F9A SND7'6 JN- TI9SND7' )LR TI L)ALL DELAI RET SEND7I6 MO@ A9BJIJ MO@ S-!F9A SND7I6 JN- TI9SND7I )LR TI L)ALL DELAI RET SEND7?6 MO@ A9BJ?J MO@ S-!F9A SND7?6 JN- TI9SND7? )LR TI L)ALL DELAI RET SEND706 MO@ A9BJ0J MO@ S-!F9A SND706 JN- TI9SND70 )LR TI L)ALL DELAI

RET SEND716 MO@ A9BJ1J MO@ S-!F9A SND716 JN- TI9SND71 )LR TI L)ALL DELAI RET SEND726 MO@ A9BJ2J MO@ S-!F9A SND726 JN- TI9SND72 )LR TI L)ALL DELAI RET SEND706 MO@ A9BJ0J MO@ S-!F9A SND706 JN- TI9SND70 )LR TI L)ALL DELAI RET SEND7/6 MO@ A9BJ/J MO@ S-!F9A SND7/6 JN- TI9SND7/ )LR TI L)ALL DELAI RET SEND756 MO@ A9BJ5J MO@ S-!F9A SND756 JN- TI9SND75 )LR TI L)ALL DELAI RET SEND7#6 MO@ A9BJ#J MO@ S-!F9A SND7#6 JN- TI9SND7# )LR TI L)ALL DELAI RET SEND716 MO@ A9BJ1J MO@ S-!F9A SND716 JN- TI9SND71 )LR TI L)ALL DELAI

RET SEND7"6 MO@ A9BJ"J MO@ S-!F9A SND7"6 JN- TI9SND7" )LR TI L)ALL DELAI RET SEND7*6 MO@ A9BJ*J MO@ S-!F9A SND7*6 JN- TI9SND7* )LR TI L)ALL DELAI RET SEND7 !OTE6 MO@ A9BJNJ MO@ S-!F9A SND7 !OTE6 JN- TI9SND7 !OTE )LR TI L)ALL DELAI RET SEND7)OMMA6 MO@ A9BJ9J MO@ S-!F9A SND7)OMMA6 JN- TI9SND7)OMMA )LR TI L)ALL DELAI RET SEND7)OLLON6 MO@ A9BJ6J MO@ S-!F9A SND7)OLLON6 JN)LR TI L)ALL DELAI RET

TI9SND7)OLLON

SEND7SPA)E6 MO@ A9BJ J MO@ S-!F9A SND7SPA)E6 JN- TI9SND7SPA)E )LR TI L)ALL DELAI RET SEND7NE37LINE6 MO@ A9B00-H MO@ S-!F9A SND7NE37LINE6 JN)LR TI L)ALL DELAI

TI9SND7NE37LINE

RET SEND7)ARRIAGE7RET!RN6 MO@ A9B00DH MO@ S-!F9A SND7)ARRIAGE7RET!RN6 JN)LR TI L)ALL DELAI RET

TI9SND7)ARRIAGE7RET!RN

)37)I)LE6 L)ALL ONE7TENTH7SE)OND7DELAI L)ALL STEP1 L)ALL ONE7TENTH7SE)OND7DELAI L)ALL STEP2 L)ALL ONE7TENTH7SE)OND7DELAI L)ALL STEP0 L)ALL ONE7TENTH7SE)OND7DELAI L)ALL STEP/ RET ))37)I)LE6 L)ALL ONE7TENTH7SE)OND7DELAI L)ALL STEP0 L)ALL ONE7TENTH7SE)OND7DELAI L)ALL STEP2 L)ALL ONE7TENTH7SE)OND7DELAI L)ALL STEP1 L)ALL ONE7TENTH7SE)OND7DELAI L)ALL STEP/ RET ;Se$ S$e51 STEP16 MO@ A9B01EH MO@ DA)7LO37DATA9A L)ALL 3RITE7DA)7DATA RET ;Se$ S$e52 STEP26 MO@ A9B0#H MO@ DA)7LO37DATA9A L)ALL 3RITE7DA)7DATA RET ;Se$ S$e50 STEP06 MO@ A9B00H MO@ DA)7LO37DATA9A L)ALL 3RITE7DA)7DATA RET ;Se$ S$e5/ STEP/6 MO@ A9B1-H

MO@ DA)7LO37DATA9A L)ALL 3RITE7DA)7DATA RET END

C>1PT#( C D1T1 ">##T" C., <2T(1"4N!C "#N"4(

C.7

!C(4C4NT(422#(

C.- ;!?9##

CHAPTER 10 REFERENCES
,. uhammad (ashid.>, Power #&ectronics circuits, Devices and 1pp&icationN , #astern #conomy #dition Prentice >a&& of !ndia Private 2imited. 7. Charu&atha Pub&ication, icroprocessor 1nd icrocontro&&erN

4N2!N# "4<(C#"
,. httpHGGwww.eaton.com

7. httpHGGwww.senscomp.com

Das könnte Ihnen auch gefallen