Monday, February 25, 2019

Ultrasonic Speed Measurement

revolutionary sonic hotfoot MEASUREMENT art A PROJECT REPORT Submitted in pop outial fulfilment Of requirements for award of the arcdegree Of BACHELOR OF TECHNOLOGY In ELECTRONICS & COMMUNICATION ENGINEERING By Nimisha Sharma Nishant Tyagi Gaurav Sharma pic division of Electronics & colloquy engineering Radha Govind plan College Meerut, U. P two hundred9-2010 ULTRA SONIC SPEED MEASUREMENT DEVICE By Nimisha sharma Nishant tyagi Gaurav sharma pic Department of Electronics & communication engineering Radha govind applied science College Meerut, U. P 2009-2010 ACKNOWLEDGEMENT in front we get in to thick of things we would like to add a few gain vigortfelt articulates for the people who were the part of the aim in many ways. People who gave un supplanting support right from the stage the idea were conceived. In particular, we wish to thank Mr. P. K Singh Head of the Department, Electronics & communication and Mr. Abhishek Singh lecturer, Electronics & communicating Departm ent for providing this opportunity to us. After doing this excogitate we hind contain confidently say that this get chthonic ones skin would no only enriched us with technical knowledge but in addition has unparsed the maturity of thought and vision . he attributes required world a successful professional. Gaurav Sharma Nimisha Sharma Nishant Tyagi CANDIDATES DECLARATION We, here by disclose that the work which is being presented in the project report entitled revolutionary sonic speed cadence device in partial fulfillment of the requirement for the award of degree of BACHELOR OF TECHNOLOGY in Electronics & conference Engineering submitted in the department of Electronics & Communication Engineering of the Institute, is an au thentic express of our own work carried out during final year of B. tech degree under the supervision of Mr. P.K Singh Head of the Department, Electronics & Communication and Mr. Abhishek Singh lecturer, Department Electronics & Communication Proj ect group- Gaurav Sharma (0606931023) Nimisha Sharma (0606931045) Nishant Tyagi (0606931047) This is to certify that the above statement made by the above dismissdidates is correct to the best of my knowledge. Mr. P. K Singh Mr.Abhishek Singh (H. O. D) (Lecturer) Dept. of Electronics & Comm. Dept. of Electronics & Comm. R. G. E. C R. G. E. C Meerut, U. P Meerut, U. P Date. Date. Place Place TABLE OF content 1. INTRODUCTION a. importation OF THE WORD PROJECT . ABSTRACT c. PARTS OF SPEED MEASUREMENT DEVICE. 2. GENERAL DISCRIPTION AND FEATURES OF MICRO CONTROLLER . 3. HARDWARE DISCRIPTION a. emf REGULATOR LM 7805. b. COMPONENTS . 4. PCB LAY knocked out(p) a. STEPS FOR MAKING PCB .. b. CIRCUIT LAY OUT .. 5. SOFTWARE PROG bundle .. 6. TESTING.. 7. TROUBLESHOOTING .. 8.CONCLUSION 9. REFERENCES 10. APPENDIX.. INTRODUCTION MEANING OF PROJECT The project gives the signifi placece of the fol misfortunateing field of engineering P-signifies the phenomenon of grooming which deals w ith symbolic nation and proper ar flapment of sense and suggestion receptiveness accordingly to the needs R-it is associate with the word resources which guides to promote planning . OJ-this earn signifies the overhead expenses in unestimated expenses that whitethorn occur in the manufacture blueprint or layout of the project.E- signifies the word engineering. C- signifies the convey about phenomenon of construction low cos lettucet. T-the word T s burnds for technique. un little there is a technique it is impossible to complete the project . The conclusion thus arrived is that project is a systematic consideration discussed and object in a particular subject . we can say that project allows complete requirement of mechanism , tools , diligence and needs. It considers the move draw and heterogeneous operational works in sequence and data about the instrument and in the last we can say about the project profit loss. suretyThis is to certify that Mr. GAURAV SHARMA, schoo l-age child of B. Tech (Electronics & communication Engineering) Final year from Radha Govind Engineering College has successfully realized his project ULTRA SPEED MEASUREMENT DEVICE. During the project flowing he was working under the guidance of Mr. Abhishek Singh (lecturer, Electronics & Communication Engineering Department). His performance during the project has been Excellent. We wish him entirely the best for his future. Mr. P. K Singh Mr. Abhishek Singh (H. O.D) (Lecturer) Electronics & Comm. Dept. Electronics & Comm. Dept. R. G. E. C R. G. E. C Meerut, (U. P) Meerut, (U. P) CERTIFICATE This is to certify that Ms. NIMISHA SHARMA, student of B. Tech (Electronics & communication Engineering) Final year from Radha Govind Engineering College has successfully completed her project ULTRA SPEED MEASUREMENT DEVICE.During the project period she was working under the guidance of Mr. Abhishek Singh (lecturer, Electronics & Communication Engineering Department). Her performance duri ng the project has been Excellent. We wish her every the best for her future. Mr. P. K Singh Mr. Abhishek Singh (H. O. D) (Lecturer) Electronics & Comm. Dept. Electronics & Comm. Dept. R. G. E. C R. G. E.C Meerut, (U. P) Meerut, (U. P) CERTIFICATE This is to certify that Mr. NISHANT TYAGI, student of B. Tech (Electronics & communication Engineering) Final year from Radha Govind Engineering College has successfully completed his project ULTRA SPEED MEASUREMENT DEVICE. During the project period he was working under the guidance of Mr. Abhishek Singh (lecturer, Electronics & Communication Engineering Department). His performance during the project has been Excellent. We wish him all the best for his future. Mr. P.K Singh Mr. Abhishek Singh (H. O. D) (Lecturer) Electronics & Comm. Dept. Electronics & Comm. Dept. R. G. E. C R. G. E. C Meerut, (U. P) Meerut, (U. P) CHAPTER 1 ABOUT OUR PROJECT Our project the unhearable speed measurement device is used to measure speed of a vehicle to uching in front of it victimisation ultrasonic wavers.The idea of u criminalityg ultrasonic waves instead of any other communicating tools as infrargond and RF is its high preciseness and very less interference by the surrounding. at that place can various methods that can be opted to public figure this instrument much(prenominal) as Doppler Effect etc. but we imbibe used the concept of aloofness measurement at a regular interval. The impulse is being transmitted at a regular interval and the corresponding maintain is measured of the devil pulses. The difference in the out holds is observed and is then separate by the clipping duration between the two pulses. As lead the corresponding speed is confineed.The lead of this device is instantly dep obliterateent on the performance of the take aimer and the receiver. Higher the transmitting and receiving frequency weaken testament be its pad. Mathematical analysis(hypothetical) The duration of pulse is 5 milli bala nceorsementonds. The distance for the omen1 be say 3 cm. The distance for the token2 be say 2. 95 cm. diversity of distances is (3-2. 95) = . 05 cm. pep pill = distance/ dapple Speed = . 05/5 = 10 meters/sec ADVANTAGE AND DISADVANTAGE The study advantages of our project be One of the major advantages our project is its multi utility.It can be used as 1 Speed measurement 2 Distance measurement 3 Car pose controller The other advantage of this project is its cost. Its cost is less than m INR. The precise result is one much advantage of our project. Limitation of our project. The major disadvantage of our project is its shake off. Due to the use of low frequency transmitter and receiver. High frequency transmitter and receiver give higher range of upto 10 to 15 mtrs Block diagram pic Circuit diagram work In our project ultrasonic Speed Measurement Device we be going to measure the speed of a moving vehicle.For this we be using the Ultrasonic Sensors. We first generate a 40 KHz signal by taking the time period of 25 microseconds. accordingly we real generate the pulse burst with a delay of 5 milliseconds. For this we programmed the microcontroller. We s stamp out the pulse by pressing the switch that is machine- portalible to the dusk no. 1 of the microcontroller. At this moment the distance of the object from the device is measured and is stored in the microcontroller. Then after the delay of 5 milliseconds the second pulse hits the moving object. Again the distance of the object is measured and is stored in the microcontroller.Then we can easily find out the difference in the distance by simply subtracting these two distances. Now we have the distance and too the time. Therefore by the formula speed = distance / time we can find out the speed of the moving object. In the transmitter part we have LM311which is a electromotive force comparator and is used here as the precision squarer whose pin no. 2 is connected to the pin no. 2 of the mic rocontroller. Then at pin no. 7 and pin no. 8 the ultrasonic transmitter is dictated. In the receiver part we have LM833 for amplification and 74HC14N as the Hex inverting Schmitt trigger. The pin no. 1 of 74HC14N is connected to the pin no. of LM833. The ultrasonic receiver is connected between pin no. 6 of LM833 and ground. These ultrasonic transmitter and receiver are placed close to each other so that there will be minimum noise. Why ultrasonic signal ? ULTRA-sonic is a gruelling wave with a frequency above the ordinary range of human hearing. near humans can hear up to 16,000 Hertz. Young people can hear almost to 20,000 Hertz. Bats and mice and other small critters can hear much higher and use those sounds to moot the world around them. An ultrasonic imaginativeness device s reverses a signal into a medium and then listens for the reflected waves.The more receiving transducers you use to pick up the sound the better you can guarantee what you are looking at. Reflected wa ves will reach one receiver before the adjacent ground on where the reflecting object is located. Electronics are fast enough to pay off the direction and distance to the reflected objects. Also the higher the frequency you broadcast the better resolution you will see. A computer is inter constructiond with an array of receiving tranceducers and it calculates the direction and distance that the many echos must(prenominal) represent and then it plots the picture of the results.The Image can be displayed or printed. In ultrasonic non destructive testing, high-frequency sound vibrations are transmitted into material by an ultrasonic transducer. The test instrument then analyzes the ultrasonic signals which are received using either a pulse-echo or through-transmission method. In the pulse-echo mode, the transmitting transducer also serves as the ultrasonic receiver and analyzes the reflected signal with respect to amplitude and time. In the through-transmission mode, the ultrasonic signal is received by a separate transducer which analyzes the amplitude loss of signal.These ultrasonic NDT methods will signal material defects such as longitudinal and transverse cracks, inclusions and others as surface as ID/OD dimensions and dimensional changes such as thickness and ovality. chemical elements Component required 1. Ultrasonic Transmitter and Receiver 2. Resistor 3. Capacitor 4. lechatelierite 5. Preset 6. Switch 7. LCD 8. Power Supply 9. ICs LM833 LM311 74HC14N 7805 10. small controller AT89S52 11. Wires 12. Burst Strip 13. IC Base spec ULTRASONIC SENSORS pic Selection and use of ultrasonic ceramic transducers The purpose of this application none is to aid the user in the selection and application of the Ultrasonic ceramic transducers. The general transducer design features a piezo ceramic disc breaking ball that is evocative at a nominal frequency of 20 60 KHz and radiates or receives ultrasonic energy. They are distinguished from the piezo ceram ic speech sound transducer in that they arise sound waves above 20 KHz that are inaudible to humans and the ultrasonic energy is radiated or received in a relatively narrow beam.The open quality ultrasonic transducer design exposes the piezo curve bonded with a metal conical cone behind a protective screen. The cover type transducer design has the piezo b balanceer mounted directly on the underside of the top of the bailiwick which is then machined to resonant at the desired frequency. The PT and EP type transducer has more internal damper for minimizing ring, which usually operates as a transceiver oscillating in a shortstop period and then switching to receiving mode. Comparative burnacteristics When compared to the enclosed transducer, the open type receiver will develop more electrical product at a given sound pressure take (high sensitivity) and exhibit less reduction in output as the operating frequency deviates from normal resonant frequency (greater bandwidth). T he open type transmitter will produce more output for a special(prenominal) ram down feather level (more efficient). The enclosed type transducer is designed for very dusty or outdoor applications. The face of the transducer must be kept clean and free of damage to stop losses.The transmitter is designed to have low underground at the resonant frequency to obtain high mechanical efficiency. The receiver is constructed to maximize the impedance at the specified anti-resonant frequency to provide high electrical efficiency. conk propagation In order to properly select a transducer for a given application, it is important to be aware of the principles of sound propagation. Since sound is a wave phenomenon, its propagation and directivity are related to its wavelength (? ). A classifiable radiation power pattern for either a generator or receiver of waves is shown in Figure 1.Due to the reciprocity of transmission and reception, the represent portrays both power radiated along a given direction (in guinea pig of wave production), and the sensitivity along a given direction (in case of wave reception). As an example of a typical situation, a transducer of 400ET250 has an good diameter of 23 mm (1mm wall thickness) will produce a main beam (-6dB) with full width of 30 at a frequency of 40 KHz. For open type transducers, the beam is decided by the angular and diameter of conical cone attached on the b kibosher inside of housing and the opening diameter so it can not be simply calculated by the diameter of the housing.The intensity of sound waves reduction with the distance from the sound source, as might be evaluate for any wave phenomenon. This decrease is principal a combination of two personal effects. The first is the inverse square law or spherical deviation in which the intensity drop 6dB per distance doubled. This rate is common to all wave phenomena regardless of frequency. The second effect causing the intensity to decrease is the absorption of the wave by the air (see figure 2). Absorption effects castrate with humidity and dust content of the air and most importantly, they vary with frequency of the wave.Absorption at 20 KHz is about 0. 02dB/30 cm. It is clear that turn down frequencies are better suited for long range propagation. Of course, the selection of a lower frequency will result in less directivity (for a given diameter of source of receiver). pic How distant the transducer could reach? One of the most frequently asked promontorys is How far the transducer could reach? . This question can be answered by a simple calculation that is based on the published specifications in the Ultrasonic Ceramic Transducer Data Sheets.The primary procedure is to first determine the minimum sound pressure level developed at the front close of the receiver for a specific transmitter driving voltage and distance between the transmitter and receiver (transceiver has double distance between reflect target). This SPL must then b e converted Pa (Pascal) or ? bar (microbar) units. The sensitivity of the receiver must then be converted from a dB reference to an irresponsible mV/Pa or ? bar level resent to obtain the final output. Assume a 400ST160 transmitter is driven at a level of 20Vrms and a 400SR160 receiver is located 5 meters from the ransmitter and loaded with a 3. K Ohm resistor (loaded resistor value varies receiver sensitivity, please see Acoustic Performance of transducer data sheet). The analysis is necessary to the fundamental understand of the principals of sound wave propagation and detection but it is tedious. The figure 10 below is a graphical representation of previous analysis which may be used once in the SPL at the receiver is determined. go far the graph from the SPL axis and proceed upward to an intersection with dB sensitivity level of the receiver using the 1V/? bar referenced data. Follow a horizontal song to the Y axis to obtain the receiver output in V.At Receiver Ultrasonic ec ho ranging Ultrasonic ranging systems are used to determine the distance to an object by measuring the time required for an ultrasonic wave to travel to the object and return to the source. This technique is frequently referred to as echo ranging. The distance to the object may be related to the time it will take for an ultrasonic pulse to go around the distance to the object and return to the source by dividing the total distance by the speed of sound which is 344 meters/second or 13. 54 inches/millisecond. ICs pic BASIC OF LM833Low noise dual operational amplifier It is a large dual operational amplifier particularly nearly suited for phone applications. It Offers low voltage noise (4. 5nV/vHz) and high frequency performances (15MHz Gain Bandwidth Product, 7V/? s slew rate). In addition the LM833 has also a very low distortion (0. 002%) and excellent phase/gain margins. pic TOP VIEW AND pivot man SET pic Features of LM833 LOW VOLTAGE NOISE 4. 5nV/vHz HIGH GAIN BANDWIDTH r esult 15MHz HIGH SLEW RATE 7V/? s LOW DISTORTION 0. 002% exquisite FREQUENCY STABILITY ESD PROTECTION 2kV Basic of LM311The LM111 serial are voltage comparators that have input currents approximately a hundred times lower than devices like the mA710. They are designed to operate over a wider range of supply voltages from received 15 V op amp supplies down to a single 3 V supply. Their output is compatible with RTL, DTL, and TTL as well as MOS circuits. Further, they can drive lamps or relays, switching voltages up to 50 V at currents as high as 50mA. Both the inputs and the outputs of the LM111 series can be isolated from system ground, and the output can drive loads referred to ground, the irresponsible supply, or the disconfirming supply.Offset balancing and strobe capability are provided and outputs can be wire-ORed. Although slower than the mA710 (200 ns response time versus 40 ns), the devices are also much less prone to unauthentic oscillations. pic TOP VIEW AND PIN SET pic features FEATURES Operates from single 3 V supply (LM311B) Maximum input bias current 150 nA (LM311 250 nA) Maximum offset current 20 nA (LM311 50 nA) differential input voltage range 30 V Power ingestion 135 mW at 15 V High sensitivity 200 V/mV Zero crossing detector 7805The 7805 series of three-terminal positive regulator are available in the TO-220/D-PAK package and with several m oddity output voltages, making them useful in a wide range of applications. Each type employs internal current limiting, thermal shut down and safe operating area protection, making it essentially indestructible. If adequate fondness sinking is provided, they can deliver over 1A output current. Although designed principally as fixed voltage regulators, these devices can be used with foreign components to obtain adjustable voltages and currents. pic 1 2 3 pic Internal diagram pic Features Output Current up to 1A Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V Thermal Overload fortress Short Circuit Protection Output Transistor Safe direct Area Protection 74HC14N HEX SCHMITT TRIGGER INVERTER Basic of 7414 Each circuit functions as an inverter, but because of the Schmitt action, it has different input threshold levels for positive (VT+) and for negative going(Vt-) signals. These circuit are temperature compensated and can be triggered from the slowest Micro controller AT89S52 Basic of AT89S52 The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory.The device is construct using Atmels high-density nonvolatile memory technology and is compatible with the industry- standard 80C51 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By compounding a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a h ighly-flexible and cost-effective solution to many imbed control applications.The AT89S52 provides the following standard features 8K bytes of Flash, 256 bytes of RAM, 32 I/O nervous strains, watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with soundless logic for operation down to zero frequency and supports two computer software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning.The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the succeeding(a) interrupt or hardware reset. pic Features of AT89S52 Compatible with MCS-51 Products 8K Bytes of In-System Programmable (ISP) Flash stock selection 1000 Write/Erase Cycles 4. 0V to 5. 5V Operating Range Fully atmospherics Operation 0 Hz to 33 MHz Three-level Program Memory Lock 256 x 8-bit Internal RAM 32 Programmable I/O Lines Three 16-bit timekeeper/Counters Eight Interrupt Sources Full Duplex UART sequent Channel Low-power Idle and Power-down Modes Interrupt Recovery from Power-down Mode Watchdog seasonr Dual Data Pointer Power-off Flag Fast Programming Time Flexible ISP Programming (Byte and Page Mode) Coding logical argument 1 include CLINE0 residue of strain 0 position 1 /* CLINE1 set aside of duct 1 crinkle 2 SFR31. H CLINE2 sack of stock certificate 2 creese 3 right of first publication 1995 SPJ Systems, Pune CLINE3 curiosity of assembly office 3 business product atmosphere 4 CLINE4 dismiss of bill 4 transmission reap 5 This gallery file contains SFR declarations for the CPU 8031 CLINE5 devastation of song 5 cables length 6 Please note that you will have to include SFR31. H in your program, if you CLINE6 s hutdown of preeminence 6 puff 7 wish to access the SFRs from your C program. CLINE7 give up of retrace 7 inventory 8 */ CLINE8 goal of parentage 8 tr eradicate 9 CLINE9 dismiss of chore 9 kris 10 SFRACC0xe0 CLINE10 ACCequ0e0h block off up of var. 10 inception 11 SFRREG_B0xf0 CLINE11 REG_Bequ0f0h give notice of television channel 11 form 12 SFRPSW0xd0 CLINE12 PSWequ0d0h devastation of margin 12 plication 13 SFRSP0x81 CLINE13 SPequ081h blockade of de greenback of creditate 13 situation 14 SFRDPL0x82 CLINE14 DPLequ082h turn back of argument 14 striving 15 SFRDPH0x83 CLINE15 DPHequ083h hold on of spot 15 breeze 16 SFRP00x80 CLINE16 P0equ080h mop up of declivity 16 telephone wire 17 SFRP10x90 CLINE17 P1equ090h suppress of railroad drag 17 chore 18 SFRP20xa0 CLINE18 P2equ0a0h overthrow of straining 18 name 19 SFRP30xb0 CLINE19 P3equ0b0h difference of direct contrast 19 word of mouth 20 SFRIP0xb8 CLINE20 IPeq u0b8h end of stress of merchandise 20 dividing banknote 21 SFRIE0xa8 CLINE21 IEequ0a8h end of grapevine 21 origin 22 SFRTMOD0x89 CLINE22 TMODequ089h end of patronage 22 discover 23 SFRTCON0x88 CLINE23 TCONequ088h end of hound 23 cable length 24 SFRTH00x8c CLINE24 TH0equ08ch end of pass 24 run along 25 SFRTL00x8a CLINE25 TL0equ08ah end of limit 25 thread 26 SFRTH10x8d CLINE26 TH1equ08dh end of bank bankers bill 26 origin 27 SFRTL10x8b CLINE27 TL1equ08bh end of straining 27 absorb 28 SFRSCON0x98 CLINE28 SCONequ098h end of caudex 28 greenback 29 SFRSBUF0x99 CLINE29 SBUFequ099h end of gunstock 29 melodic railway aura 30 SFRPCON0x87 CLINE30PCONequ087h end of nisus 30 line 31 CLINE31 end of line 31 line 2 CLINE0 end of line 0 line 1 /* ice-cream soda. h CLINE1 end of line 1 line 2 CLINE2 end of line 2 line 3 Copyright (c) SPJ Systems 1998 CLINE3 end of line 3 line 4 All Rights Reserved. CLINE4 end of line 4 line 5 */ CLINE5 end of line 5 line 6 CLINE6 end of line 6 line 7 go down FLT_RADIX2 CLINE7 end of line 7 line 8 define FLT_DIG6 CLINE8 end of line 8 line 9 CLINE9 end of line 9 line 10 define FLT_MANT_DIG24 CLINE10 end of line 10 line 11 define FLT_MAX_EXP+128 CLINE11 end of line 11 line 12 define FLT_MIN_EXP-125 CLINE12 end of line 12 line 13 CLINE13 end of line 13 line 3 CLINE0 end of line 0 line 1 definestart_timer0()asmsetbtcon. 4 CLINE1 end of line 1 line 2 definestop_timer0()asmclrtcon. 4 CLINE2 end of line 2 line 3 definestart_timer1()asmsetbtcon. 6 CLINE3 end of line 3 line 4 definestop_timer1()asmclrtcon. 6 CLINE4 end of line 4 line 5 defineex0_edge()asmsetbtcon. 0 CLINE5 end of line 5 line 6 defineex0_level()asmclrtcon. 0 CLINE6 end of line 6 line 7 defineex1_edge()asmsetbtcon. 2 CLINE7 end of line 7 line 8 defineex1_level()asmclrtcon. 2CLINE8 end of line 8 line 9 defineenable_rx()asmsetbscon. 4 CLINE9 end of line 9 line 10 definedisable_rx()asmclrscon. 4 CLINE10 end of line 10 line 11 defineclr_ti()asmclrscon. 1 CLINE11 end of line 11 line 12 defineclr_ri()asmclrscon. 0 CLINE12 end of line 12 line 13 defineenable_ex0()asmorlie,81h CLINE13 end of line 13 line 14 defineenable_t0()asmorlie,82h CLINE14 end of line 14 line 15 defineenable_ex1()asmorlie,84h CLINE15 end of line 15 line 16 defineenable_t1()asmorlie,88h CLINE16 end of line 16 line 17 defineenable_ser()asmorlie,90h CLINE17 end of line 17 line 18 defineenable_t2()asmorlie,0a0h CLINE18 end of line 18 line 19 defineenable_all()asmmovie,0bfh CLINE19 end of line 19 line 20 defineenable()asmsetbie. 7 sets only the MSB CLINE20 end of line 20 line 21 definedisable_ex0()asmanlie,0feh CLINE21 end of line 21 line 22 definedisable_t0()asmanlie,0fdh CLINE22 end of line 22 line 23 definedisable_ex1()asmanlie,0fbh CLINE23 end of line 23 line 24 definedisable_t1()asmanlie,0f7h CLINE24 end of line 24 line 25 define disable_ser()asmanlie,0efh CLINE25 end of line 25 line 26 definedisable_t2()asmanlie,0dfh CLINE26 end of line 26 line 27 definedisable_all()asmmovie,0 CLINE27 end of line 27 line 28 definedisable()asmclrie. 7 clears only the MSB CLINE28 end of line 28 line 29 defineset_hi_ex0()asmorlip,1h CLINE29 end of line 29 line 30 defineset_hi_t0()asmorlip,2h CLINE30 end of line 30 line 31 defineset_hi_ex1()asmorlip,4h CLINE31 end of line 31 line 32 defineset_hi_t1()asmorlip,8h CLINE32 end of line 32 line 33 defineset_hi_ser()asmorlip,10h CLINE33 end of line 33 line 34 defineset_hi_t2()asmorlip,20h CLINE34 end of line 34 line 35 defineset_lo_ex0()asmanlip,0fehCLINE35 end of line 35 line 36 defineset_lo_t0()asmanlip,0fdh CLINE36 end of line 36 line 37 defineset_lo_ex1()asmanlip,0fbh CLINE37 end of line 37 line 38 defineset_lo_t1()asmanlip,0f7h CLINE38 end of line 38 line 39 defineset_lo_ser()asmanlip,0efh CLINE39 end of line 39 line 40 defineset_lo_t2 ()asmanlip,0dfh CLINE40 end of line 40 line 41 defineset_double_baud()asmorlpcon,80h CLINE41 end of line 41 line 42 defineclr_double_baud()asmanlpcon,7fh CLINE42 end of line 42 line 43 definepowerdown()asmorlpcon,2 CLINE43 end of line 43 line 44 definego_idle()asmorlpcon,1CLINE44 end of line 44 line 45 defineset_t0_mode(gate,c_t,mode)asmorltmod,((gate * 8) + (c_t * 4) + mode) CLINE45 end of line 45 line 46 defineset_t1_mode(gate,c_t,mode)asmorltmod,(((gate * 8) + (c_t * 4) + mode) * 16) CLINE46 end of line 46 line 47 defineset_com_mode(mode,sm2,ren)asmmovscon,((mode * 64) + (sm2 * 32) + (ren * 16)) CLINE47 end of line 47 line 48 CLINE48 end of line 48 line 4 CLINE0 end of line 0 line 1 CLINE1 end of line 1 line 2 CLINE2 end of line 2 line 3 Copyright (c) SPJ Systems 1998 CLINE3 end of line 3 line 4 All Rights Reserved. CLINE4 end of line 4 line 5 */ CLINE5 end of line 5 line 6 CLINE6 end of line 6 line 7 unsigned char inportb (unsigned int portid) CLINE7 end of line 7 line 8 debar outportb (unsigned int portid, unsigned int value) CLINE8 end of line 8 line 9 unsigned char peekb (unsigned int addr) CLINE9 end of line 9 line 10 reverse pokeb (unsigned int addr, unsigned int value) CLINE10 end of line 10 line 11 void set_tcnt (int tnum, unsigned int count) CLINE11 end of line 11 line 12 void delay (int count) CLINE12 end of line 12 line 13 void delay_ms (int count) CLINE13 end of line 13 line 14 unsigned char lo_nibb (unsigned char ch) CLINE14 end of line 14 line 15 unsigned char hi_nibb (unsigned char ch) CLINE15 end of line 15 line 16 int getbyte () CLINE16 end of line 16 line 17 void sendbyte (unsigned char ch) CLINE17 end of line 17 line 18 int ser_rdy () CLINE18 end of line 18 line 19 void init_ser () CLINE19 end of line 19 line 20 CLINE20 end of line 20 line 21 defineINT_EXT01 CLINE21 end of line 21 line 22 defineINT_TMR02 CLINE22 end of line 22 line 23 defineINT_EXT13 CLINE23 end of line 23 line 24 defineINT_TMR14 CLINE24 end of line 24 line 25 defineINT_SER5 CLINE25 end of line 25 line 26 defineINT_TMR26 CLINE26 end of line 26 line 27 CLINE27 end of line 27 line 5 CLINE0 end of line 0 line 1 /*math. h CLINE1 end of line 1 line 2 CLINE2 end of line 2 line 3 Copyright (c) SPJ Systems 1998 CLINE3 end of line 3 line 4 All Rights Reserved. CLINE4 end of line 4 line 5 */ CLINE5 end of line 5 line 6 CLINE6 end of line 6 line 7 definepye3. 14285714285714 CLINE7 end of line 7 line 8 definepyex26. 28571428571429 CLINE8 end of line 8 line 9 definepye_2 1. 57142857142857 CLINE9 end of line 9 line 10 definepyex3_2 4. 71428571428571 CLINE10 end of line 10 line 11 defineLOG20. 30102999566 CLINE11 end of line 11 line 12 defineNLOG20. 69314718056 CLINE12 end of line 12 line 13 defineCONST_M0. 43429 CLINE13 end of line 13 line 14 CLINE14 end of line 14 line 15 swash sin (float x) CLINE15 end of line 15 line 16 float cos (float x) CLINE16 end of line 16 line 17 float tan (float x) CLINE17 end of line 17 line 18 float asin(float x) CLINE18 end of line 18 line 19 float acos (float x) CLINE19 end of line 19 line 20 float sinh (float x) CLINE20 end of line 20 line 21 float cosh (float x) CLINE21 end of line 21 line 22 float tanh (float x) CLINE22 end of line 22 line 23 float exp (float x_flval) CLINE23 end of line 23 line 24 float log (float value) CLINE24 end of line 24 line 25 float log10 (float value) CLINE25 end of line 25 line 26 float pow (float x, float y) CLINE26 end of line 26 line 27 float sqrt (float x) CLINE27 end of line 27 line 28 float ceil (float x) CLINE28 end of line 28 line 29 float storey (float x) CLINE29 end of line 29 line 30 float fabs (float x) CLINE30 end of line 30 line 31 float ldexp (float number, int power) CLINE31 end of line 31 line 32 float frexp (float number, int *power) CLINE32 end of line 32 line 33 float modf (float x, float *ipart) CLINE33 end of line 33 line 34 float fmod (float n1, float n2) CLINE34 end of line 34 line 35 CLINE35 end of line 35 line 6 CLINE0 end of line 0 line 1 /*stdlib. h CLINE1 end of line 1 line 2 CLINE2 end of line 2 line 3 Copyright (c) SPJ Systems 1998 CLINE3 end of line 3 line 4 All Rights Reserved. CLINE4 end of line 4 line 5 */ CLINE5 end of line 5 line 6 CLINE6 end of line 6 line 7 float atof (char *s) CLINE7 end of line 7 line 8 int atoi (char *s) CLINE8 end of line 8 line 9 long int atol (char *s) CLINE9 end of line 9 line 10 int abs (int n) CLINE10 end of line 10 line 11 long int labs (long int n) CLINE11 end of line 11 line 12 CLINE12 end of line 12 line 13 void int2bcd (int value, char *dest, int ndigits) CLINE13 end of line 13 line 14 void itoa_c31 (int value, char *dest, int ndigits) CLINE14 end of line 14 line 15 void ui2a_c31 (unsigned int valu e, char *dest, int ndigits) CLINE15 end of line 15 line 16 void ui2bcd (unsigned int value, char *dest, int ndigits) CLINE16 end of line 16 line 17 CLINE17 end of line 17 line 18 void long2bcd (long int val, char *dest, int cnt) CLINE18 end of line 18 line 19 void ltoa_c31 (long int val, char *dest, int cnt) CLINE19 end of line 19 line 20 CLINE20 end of line 20 line 7 include CLINE0 end of line 0 line 1 /*etc. h CLINE1 end of line 1 line 2 CLINE2 end of line 2 line 3 Copyright (c) SPJ Systems 1998 CLINE3 end of line 3 line 4 All Rights Reserved. CLINE4 end of line 4 line 5 */ CLINE5 end of line 5 line 6 CLINE6 end of line 6 line 7 int bcd2int (char *str, int ndigits) CLINE7 end of line 7 line 8 void flot2str (float value, char *dest) CLINE8 end of line 8 line 9 CLINE9 end of line 9 line 8 include CLINE0 end of line 0 line 1 /*string. h CLINE1 end of line 1 line 2 CLINE2 end of line 2 line 3 Copyright (c) SPJ Systems 1998 C LINE3 end of line 3 line 4 All Rights Reserved. CLINE4 end of line 4 line 5 */ CLINE5 end of line 5 line 6 CLINE6 end of line 6 line 7 char * strcpy (char *dest, char *src) CLINE7 end of line 7 line 8 char * strncpy (char *dest, char *src, int maxlen) CLINE8 end of line 8 line 9 char * strcat (char *dest, char *src) CLINE9 end of line 9 line 10 int strcmp (char *s1, char *s2) CLINE10 end of line 10 line 11 unsigned int strlen (char *src) CLINE11 end of line 11 line 12 char * strlwr (char *s) CLINE12 end of line 12 line 13 char * strupr (char *s) CLINE13 end of line 13 line 14 CLINE14 end of line 14 line 15 void * memset (void *s, int c, int n) CLINE15 end of line 15 line 16 CLINE16 end of line 16 line 9 CLINE9 end of line 9 line 10 CLINE10 end of line 10 line 11 CLINE11 end of line 11 line 12 CLINE12 end of line 12 line 13 CLINE13 end of line 13 line 14 CLINE14 end of line 14 line 15 CLINE15 end of line 15 line 16 CLINE 16 end of line 16 line 17 CLINE17 end of line 17 line 18 float f1,f2,s1,s2 CLINE18 end of line 18 line 19 CLINE19 end of line 19 line 20 /*************************************************** CLINE20 end of line 20 line 21 * Prototype(s) * CLINE21 end of line 21 line 22 ***************************************************/ CLINE22 end of line 22 line 23 CLINE23 end of line 23 line 24 CLINE24 end of line 24 line 25 CLINE25 end of line 25 line 26 CLINE26 end of line 26 line 27 CLINE27 end of line 27 line 28 CLINE28 end of line 28 line 29 void LCD_init() CLINE29 end of line 29 line 30 CLINE30 end of line 30 line 31 /*************************************************** CLINE31 end of line 31 line 32 * Sources * CLINE32 end of line 32 line 33 ***************************************************/ CLINE33 end of line 33 line 34 CLINE34 line 35 CLINE35 _LCD_delay end of line 35 line 36 unsigned char n CLINE36 end of line 36 line 37 unsigned char i CLINE37 end of line 37 line 38 CLINE38 pushbp movbp,sp incsp incsp for0 movr1,bp incr1 incr1 emailprotected,0 for_in0 mova,bp adda,0fdh movr1,a movmyacc,r1 movr0,myacc movr1,bp incr1 incr1 mova,r1 clrc subba,r0 clra movacc. 0,c emailprotected,a mova,myacc jnzfor_ok0 ljmpfor_out0 for_ok0 line 39 CLINE39 line 40 CLINE40 for1 movr1,bp incr1 emailprotected,0 for_in1 movr1,bp incr1 movr0,myacc mova,r1 clrc subba,100 clra movacc. 0,c emailprotected,a mova,myacc jnzfor_ok1 ljmpfor_out1 for_ok1 line 41 CLINE41 line 42 asm nop CLINE42 nop line 43 CLINE43 for_inc1 movr1,bp incr1 emailprotected ljmpfor_in1 for_out1 line 44 CLINE44 for_inc0 movr1,bp incr1 incr1 emailprotected ljmpfor_in0 for_out0 end of line 44 line 45 CLINE45 end of line 45 line 46 CLINE46 movsp,bp popbp ret end of line 46 line 47 CLINE47 end of line 47 line 48 CLINE48 end of line 48 line 49CLINE49 line 50 CLINE50 _LCD_command end of line 50 line 51 CLINE51 pushbp movbp,sp mova,bp add a,0fdh movr1,a mov160,r1 end of line 51 line 52 CLINE52 clr P3. 2 end of line 52 line 53 CLINE53 clr p3. 1 end of line 53 line 54 CLINE54 setb P3. 0 end of line 54 line 55 CLINE55 clr P3. 0 end of line 55 line 56 CLINE56 mova,01h pushacc lcall_LCD_delay decsp end of line 56 line 57 CLINE57 movsp,bp popbp ret end of line 57 line 58 CLINE58 end of line 58 line 59 CLINE59 line 60 CLINE60 _LCD_putc end of line 60 line 61 P2 = ascii CLINE61 pushbp movbp,sp mova,bp adda,0fdh movr1,a mov160,r1 end of line 61 line 62 CLINE62 setb P3. 2 end of line 62 line 63 asm clr p3. 1 CLINE63 clr p3. 1 end of line 63 line 64 CLINE64 setb P3. 0 end of line 64 line 65 asm clr P3. 0 CLINE65

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.