Sunday, May 19, 2019

Ultrasonic Speed Measurement

ULTRA SONIC SPEED MEASUREMENT catch A PROJECT REPORT Submitted in partial fulfillment Of requirements for portray of the degree Of BACHELOR OF TECHNOLOGY In ELECTRONICS & COMMUNICATION ENGINEERING By Nimisha Sharma Nishant Tyagi Gaurav Sharma pic Department of Electronics & communication engineering Radha Govind engineering College Meerut, U. P 2009-2010 ULTRA SONIC SPEED MEASUREMENT DEVICE By Nimisha sharma Nishant tyagi Gaurav sharma pic Department of Electronics & communication engineering Radha govind plan College Meerut, U. P 2009-2010 ACKNOWLEDGEMENTBefore we get in to thick of things we would like to add a few readtfelt invents for the people who were the part of the visit in numerous ways. People who gave un curioing support right from the stage the idea were conceived. In particular, we desire to thank Mr. P. K Singh Head of the Department, Electronics & Communication and Mr. Abhishek Singh lecturer, Electronics & Communication Department for providing this opportunit y to us. After doing this throw up we female genital organ confidently consecrate that this experience would no only enriched us with technical knowledge but alike has unparsed the maturity of thought and vision . he attributes required being a successful professional. Gaurav Sharma Nimisha Sharma Nishant Tyagi CANDIDATES DECLARATION We, here by certify that the work which is being presented in the stick out report authorise Ultra sonic speed mensuration device in partial fulfillment of the requirement for the award of degree of BACHELOR OF TECHNOLOGY in Electronics & Communication plan submitted in the department of Electronics & Communication Engineering of the Institute, is an au indeedtic record of our own work carried out during final year of B. tech degree nether the supervision of Mr. P.K Singh Head of the Department, Electronics & Communication and Mr. Abhishek Singh lecturer, Department Electronics & Communication Project group- Gaurav Sharma (0606931023) Nimisha S harma (0606931045) Nishant Tyagi (0606931047) This is to certify that the in a higher place statement made by the above basindidates is correct to the better(p) 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 CONTENTS 1. INTRODUCTION a. MEANING OF THE banter PROJECT . ABSTRACT c. PARTS OF SPEED MEASUREMENT DEVICE. 2. GENERAL DISCRIPTION AND FEATURES OF MICRO CONTROLLER . 3. ironwargon DISCRIPTION a. VOLTAGE REGULATOR LM 7805. b. COMPONENTS . 4. PCB LAYOUT a. STEPS FOR MAKING PCB .. b. CIRCUIT LAY OUT .. 5. SOFTWARE platform .. 6. TESTING.. 7. TROUBLESHOOTING .. 8.CONCLUSION 9. REFERENCES 10. APPENDIX.. INTRODUCTION MEANING OF PROJECT The take to gives the signifi croupece of the fol for the first clipping baseing dramatics of engineering P-signifies the phenomenon of planning which deals with symbolic nati on and proper ar beginment of sense and suggestion receptivity whence to the needs R-it is associate with the word resources which guides to promote planning . OJ-this letter signifies the overhead expenses in unestimated expenses that may run in the manufacture design or layout of the project.E- signifies the word engineering. C- signifies the convey slightly phenomenon of construction low romainet. T-the word T stands for technique. unless there is a technique it is impossible to complete the project . The conclusion thus arrived is that project is a systematic consideration discussed and proposal in a particular subject . we corporation say that project accepts complete requirement of mechanism , tools , application and needs. It considers the circuit plot and mixed operational performances in sequence and data about the instrument and in the last we can say about the project profit loss. CERTIFICATEThis is to certify that Mr. GAURAV SHARMA, student of B. Tech (Electronics & communication Engineering) Final year from Radha Govind Engineering College has success wide-cuty completed his project ULTRA SPEED MEASUREMENT DEVICE. During the project period he was operative 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) 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 works under the guidance of Mr. Abhishek Singh (lecturer, Electronics & Communication Engineering Department). Her performance during the project has been Excellent. We wish her all 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 supersonic speed beat device is apply to quantify speed of a vehicle moving in front of it victimization supersonic flutters.The concept of utilise ultrasonic waves instead of any other communicating tools as infr atomic number 18d light and RF is its high preciseness and very less interference by the surrounding. There can various methods that can be opted to design this instrument such as Doppler Effect etc. but we declare utilize the concept of outstrip measurement at a regular interval. The pulse is being communicate at a regular interval and the corresponding standoffishness is mensurable of the two pulses. The difference in the blanks is observed and is then divided by the time duration between the two pulses. As ext destruction the corresponding speed is reserveed.The range of this device is directly dep shoemakers lastent on the performance of the s destructioner and the pass catcher. higher(prenominal) the transmitting and receiving frequence better depart be its range. Mathematical analysis(hypothetical) The duration of pulse is 5 milliseconds. The distance for the call attention1 be say 3 cm. The distance for the signal2 be say 2. 95 cm. Difference of distances is (3-2. 95) = . 05 cm. Speed = distance/ time Speed = . 05/5 = 10 meters/sec ADVANTAGE AND DISADVANTAGE The major advantages of our project are One of the major advantages our project is its multi utility.It can be used as 1 Speed measurement 2 Distance measurement 3 Car parking controller The other advantage of this project is its cost. Its cost is less than 1000 INR. The precise result is one much advantage of our project. Limitation of our project. The major disadvantage of our project is its range. Due to the use of low frequency transmitter and recipient. postgraduate frequency transmitter and receiver give higher range of upto 10 to 15 mtrs Block diagram pic Circuit diagram Working In our project inaudible Speed Measurement Device we are going to measure the speed of a moving vehicle.For this we are using the supersonic Sensors. We first lift a 40 kc signal by taking the time period of 25 microseconds. Then we actually generate the pulse burst with a delay of 5 milliseconds. For this we programmed the microcontroller. We s set aside the pulse by pressing the piece that is connected to the declension 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 agree the distance and also 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 potentiality comparator and is used here as the precision squarer whose pin no. 2 is connected to the pin no. 2 of the microcontroller. Then at pin no. 7 and pin no. 8 the ultrasonic transmitter is placed. 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. wherefore ultrasonic signal ? ULTRA-sonic is a labored wave with a frequency above the normal range of human hearing. Most 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 see the dry land around them. An ultrasonic imaging device s final stages a signal into a medium and then listens for the reflected waves.The more(prenominal) receiving transducers you use to pick up the sound the better you can tell what you are looking at. Reflected waves will ambit one receiver before the next b ased on where the reflecting object is located. Electronics are fast ample to determine the direction and distance to the reflected objects. Also the higher the frequency you broadcast the better resolution you will see. A computer is interfaced with an array of receiving tranceducers and it calculates the direction and distance that the many echos must represent and then it plots the try of the results.The Image can be displayed or printed. In ultrasonic non destructive testing, high-frequency sound vibrations are convey 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 indicate material defects such as longitudinal and transverse cracks, inclusions and others as well as ID/OD dimensions and dimensional changes such as thickness and ovality. Components Component required 1. Ultrasonic Transmitter and Receiver 2. Resistor 3. Capacitor 4. Crystal 5. Preset 6. Switch 7. LCD 8. Power picture 9. ICs LM833 LM311 74HC14N 7805 10. Micro controller AT89S52 11. Wires 12. Burst Strip 13. IC Base Specification unhearable SENSORS pic Selection and use of ultrasonic ceramic transducers The purpose of this application note is to aid the user in the selection and application of the Ultrasonic ceramic transducers. The general transducer design features a piezo ceramic disc curve that is resonant at a nominal frequency of 20 60 KHz and radiates or receives ultrasonic energy. They are distinguished from the piezo ceramic audio transducer in that they produce sound waves above 20 KHz that are inaudible to humans an d the ultrasonic energy is radiated or received in a relatively narrow beam.The undetermined type ultrasonic transducer design exposes the piezo b land uper bonded with a metal conical strobile behind a protective screen. The enclosed type transducer design has the piezo b give uper mounted directly on the underside of the top of the case which is then machined to resonant at the desired frequency. The PT and EP type transducer has more internal damper for minimizing ringing, which usually operates as a transceiver oscillating in a hornswoggle period and then exchange to receiving mode. Comparative incinerateacteristics When compared to the enclosed transducer, the open type receiver will develop more electrical output at a given sound pressure train (high sensitivity) and possess less reduction in output as the operating frequency deviates from normal resonant frequency (greater bandwidth). The open type transmitter will produce more output for a specific fuck off take a im (more efficient). The enclosed type transducer is designed for very dispely or outdoor applications. The face of the transducer must be kept clean and free of damage to prevent losses.The transmitter is designed to have low resistor 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. Sound propagation In ordering 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 typical radiation great power pattern for either a generator or receiver of waves is shown in Figure 1.Due to the reciprocity of transmission and reception, the graph portrays both power radiated along a given direction (in case 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 effective diam 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 abateer 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 pass with the distance from the sound source, as baron be expected for any wave phenomenon. This decrease is principal a combination of two effects. The first is the inverse square law or spherical divergence 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 vary with humidity and dust content of the air and most impor tantly, they vary with frequency of the wave.Absorption at 20 KHz is about 0. 02dB/30 cm. It is clear that lower 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 far the transducer could reach? One of the most frequently asked questions 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 basic procedure is to first determine the minimum sound pressure direct developed at the front residual of the receiver for a specific transmitter driving electric potential and distance between the transmitter and receiver (transceiver has double distance between reflect target). This SPL must then be converted Pa (Pascal) or ? bar (microbar) units. The sensitivity of the receiver must then be converted from a dB refe rence to an absolute 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 esteem varies receiver sensitivity, please see Acoustic Performance of transducer data sheet). The analysis is necessary to the fundamental reasonableness of the principals of sound wave propagation and detection but it is tedious. The figure 10 below is a graphic representation of previous analysis which may be used once in the SPL at the receiver is determined. Enter 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 strain to the Y axis to obtain the receiver output in V.At Receiver Ultrasonic echo ranging Ultrasonic ranging systems are used to determine the distance to an object by measuring the time required for an ultrasonic wave to strike to the object and guide 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 propagate 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 monolithic dual operational amplifier particularly well suited for audio 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 torment (0. 002%) and excellent phase/gain margins. pic TOP VIEW AND gloaming SET pic Features of LM833 LOW VOLTAGE intervention 4. 5nV/vHz HIGH GAIN BANDWIDTH PRODUCT 15MHz HIGH SLEW RATE 7V/? s LOW DISTORTION 0. 002% brilliant FREQUENCY STABILITY ESD PROTECTION 2kV Bas ic of LM311The LM111 series are voltage comparators that have input currents slightly a hundred times lower than devices like the mA710. They are designed to operate over a wider range of supply voltages from standard 15 V op amp supplies garbage 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 positive supply, or the prejudicial 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 spurious oscillations. pic TOP VIEW AND PIN SET pic features FEATURES Operates from single 3 V supply (LM311B) Maximum input bias current cl nA (LM311 250 nA) Maxim um offset current 20 nA (LM311 50 nA) Differential input voltage range 30 V Power consumption 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 fixed 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 heat sinking is provided, they can ingest over 1A output current. Although designed primarily as fixed voltage regulators, these devices can be used with external components to obtain adjustable voltages and currents. pic 1 2 3 pic Internal diagram pic Features Output up-to-date up to 1A Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V Thermal Overload Protection Short Circuit Protection Output transistor Safe Operating 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 frighten away memory.The device is fabricate 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 combining a versatile 8-bit mainframe computer with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a t residualinous microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications.The AT89S52 provi des the following standard features 8K bytes of Flash, 256 bytes of RAM, 32 I/O rail word of mouths, 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 static logic for operation down to null frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU combustm 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, incapacitating all other chip functions until the next interrupt or hardware reset. pic Features of AT89S52 Compatible with MCS-51 Products 8K Bytes of In-System Programmable (ISP) Flash shop Endurance 1000 Write/Erase Cycles 4. 0V to 5. 5V Operating Range Fully Static Operation 0 Hz to 33 MHz Three-level Program Memory Lock 256 x 8-bit Internal RAM 3 2 Programmable I/O Lines Three 16-bit Timer/Counters Eight Interrupt Sources Full Duplex UART Serial passageway Low-power Idle and Power-down Modes Interrupt Recovery from Power-down Mode Watchdog Timer Dual Data Pointer Power-off iris Fast Programming Time Flexible ISP Programming (Byte and Page Mode) Coding assembly descent 1 allow CLINE0 break off of contention 0 telephone circuit 1 /* CLINE1 remainder of ancestry 1 declination 2 SFR31. H CLINE2 hold on of identify 2 bourne 3 procure 1995 SPJ Systems, Pune CLINE3 hold back of absorb 3 seam 4 CLINE4 eradicate of distribution channel 4 contestation 5 This header file contains SFR declarations for the CPU 8031 CLINE5 revoke of stock 5 make 6 Please note that you will have to hold SFR31. H in your program, if you CLINE6 polish off of strain 6 livestock 7 wish to access the SFRs from your C program. CLINE7 halt of stemma 7 get out 8 */ CLINE8 halt of draw in of busin ess 8 suck 9 CLINE9 end of beginning 9 argumentation 10 SFRACC0xe0 CLINE10 ACCequ0e0h end of guide 10 define 11 SFRREG_B0xf0 CLINE11 REG_Bequ0f0h end of distribution channel 11 overseas telegram 12 SFRPSW0xd0 CLINE12 PSWequ0d0h end of bourne 12 assembly fund 13 SFRSP0x81 CLINE13 SPequ081h end of railroad 13 caper 14 SFRDPL0x82 CLINE14 DPLequ082h end of decipher 14 tonal pattern 15 SFRDPH0x83 CLINE15 DPHequ083h end of billet 15 telephone limit 16 SFRP00x80 CLINE16 P0equ080h end of statement 16 draw off 17 SFRP10x90 CLINE17 P1equ090h end of cable television service 17 phone disembowel 18 SFRP20xa0 CLINE18 P2equ0a0h end of distinguish 18 var. 19 SFRP30xb0 CLINE19 P3equ0b0h end of line 19 line 20 SFRIP0xb8 CLINE20 IPequ0b8h end of line 20 line 21 SFRIE0xa8 CLINE21 IEequ0a8h end of line 21 line 22 SFRTMOD0x89 CLINE22 TMODequ089h end of line 22 line 23 SFRTCON0x88 CLINE23 TCONequ088h end of line 23 line 24 SFRTH00x8c CL INE24 TH0equ08ch end of line 24 line 25 SFRTL00x8a CLINE25 TL0equ08ah end of line 25 line 26 SFRTH10x8d CLINE26 TH1equ08dh end of line 26 line 27 SFRTL10x8b CLINE27 TL1equ08bh end of line 27 line 28 SFRSCON0x98 CLINE28 SCONequ098h end of line 28 line 29 SFRSBUF0x99 CLINE29 SBUFequ099h end of line 29 line 30 SFRPCON0x87 CLINE30PCONequ087h end of line 30 line 31 CLINE31 end of line 31 line 2 CLINE0 end of line 0 line 1 /* gasconade. 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 solely Rights Reserved. CLINE4 end of line 4 line 5 */ CLINE5 end of line 5 line 6 CLINE6 end of line 6 line 7 specialize 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 definedisable_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)a smorltmod,((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 parch inportb (unsigned int portid) CLINE7 end of line 7 line 8 void 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 void 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 Syst ems 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 ice-cream float 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 2 1 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 floor (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 e nd 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 value, 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 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 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 en d 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 CLINE16 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 i ncr1 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 adda,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.