1 Design Idea
Traditional frequency measuring instruments are large in size, consume a lot of energy, and are mainly operated manually. The biggest disadvantage is that they are not programmable. Their range conversion, data measurement, sampling control and processing cannot be controlled by program instructions, and they cannot be used as a micro-intelligent subsystem to interface with a large automatic control or test system. In view of these shortcomings, this frequency meter has made improvements in design. First, the square wave pulse after signal amplification and shaping is used as the control gate signal, and then the counter and latch are used to directly count the signals in different frequency ranges to complete the frequency division function. The divided signal is sent to the single-chip microcomputer by the interface circuit, and the single-chip microcomputer counts it. Finally, the counting result is converted into the original frequency value through calculation, and finally the value is displayed through the dynamic display circuit. The advantages are: the frequency meter fully realizes the software interface between the single-chip frequency meter, frequency sampling, and single-chip microcomputer, so that the selection of frequency measurement range, the measurement of frequency data, sampling, and the boundary conversion of coding and the conversion and storage of data can be automatically performed through the software programming of the single-chip microcomputer, thereby realizing the complete intelligence of frequency measurement and sampling, so that the system can independently constitute the core circuit of a micro-intelligent frequency measuring instrument, and can also be used as an intelligent subsystem in a large automatic control or test system. This system uses AT89S52 single-chip microcomputer as the control core, and sends the processed measured signal (the self-test signal output by CD4013 frequency division at the 30th pin of the single-chip microcomputer) to the single-chip microcomputer (P3.4 terminal), which is then processed by the single-chip microcomputer and the measured frequency value is displayed through the LCD display module. All systems are powered by AC220V-DC5V low ripple power supply module. The overall design idea can be represented by block diagram 1. The design includes 4 major modules: 1) system control module; 2) low ripple power supply module; 3) frequency division self-test module (external signal acquisition module); 4) LCD display module.
2 Hardware design
2.1 System control module
The system control adopts an 8-bit CMOS microcontroller AT89S52 manufactured by a high-performance and low-power process. It provides the following standard features: 4K bytes of program memory, 128 bytes of RAM, 32 I/O lines, 2 16-bit timers/counters, a 5-interrupt source and two-priority interrupt structure, a duplex serial port, on-chip oscillator and clock circuit, and the single-chip system circuit is shown in Figure 2. 2.2 Low ripple power supply module The power supply of this system is completely 220 V AC, which is rectified by diode bridge and filtered by capacitor, and then coordinated by 9014 and TOP46 to ensure a large and stable current. R2, D2, Q4, etc. ensure 5 V voltage, and the system has overcurrent protection inside to ensure that the output current does not exceed the maximum allowable value. When the output current reaches the maximum allowable value, it will automatically reduce the output current. It has an internal working area limit to prevent the voltage regulator from entering the unsafe area (the output tube voltage drop and output current are less than the specified value). The final output ripple is less than 4 MV 5 V voltage, ensuring that it is not affected by the power supply when testing the frequency. The power supply circuit is shown in Figure 3. 2.3 Frequency division self-test module In order to facilitate detection, this system uses the ALE (pin 30) of 89S52 to complete the self-test function. This function also requires the assistance of CD4060 (to complete 14 frequency division). CD4060 represents a 14-bit binary serial counter, and the pins and functions are omitted; CD4060 consists of an oscillator and 14-level binary counter bits. The structure of the oscillator can be RC or crystal oscillator circuit. When CR is high, the counter is cleared and the oscillator is invalid. All counter bits are master-slave triggers CP1 (and CP0) falling edge counters count in binary. The use of Schmitt triggers on the clock pulse line has no restrictions on the clock rise and fall time. Its circuit structure in the system is described in the overall simulation diagram below. According to the introduction of the system block diagram, the method of receiving sine waves, square waves, and triangle waves from the outside world and measuring the cycle is generally adopted. If you want to receive sine waves, square waves, and triangle waves from the outside world and measure them, you must go through the two processes of amplification (attenuator, amplifier) and shaping (Schmitt trigger, follower) to convert them into standard measurement square waves and send them to the gate for counting. The amplification and shaping process is required because the input signal amplitude is uncertain, which may be large or small, so it is inconvenient to measure the input signal. If it is too large, the device may be burned, and if it is too small, the device may not be detected. Therefore, in the design, the input waveform should be considered to be amplified, limited, shaped, and impedance transformed (the impedance transformation of the emitter follower composed of the operational amplifier increases the input impedance). [page] 2.4 LCD display module 1602A LCD has the characteristics of low power consumption, long life, and large amount of displayed information, so it is widely used. In order to realize the display information required by the design, this article uses the 1602LCD liquid crystal module to realize the simple display of display information. For example, the score information is displayed in the form of code. Of course, a 128*64 LCD would provide better display effects, but for practicality and price considerations, this article uses a 1602A-LCD to meet the design requirements.
3 Software Design Flowchart
According to the design principle, its working process is a measurement method that directly displays the measured signal frequency with decimal numbers. In order to facilitate testing and reading, this design allows it to automatically shift gears, that is, a standard frequency (such as 100Hz) is designed at each gear (Hz, kHz). When measuring the signal, the single-chip microcomputer directly samples and compares it with the standard frequency, divides the gear interval, and displays it on the output. The main program flow in this design is shown in Figure 4. Some main programs: 4 Kell simulation results This design uses Proteus software to build a simulation circuit, and uses Kell software for software and hardware joint debugging. After debugging with Kell software, a HEX file is generated without error. At this time, the source program and the HEX file should be saved in the same directory, otherwise the simulation will go wrong. Then add the source program to the Source directory of the schematic diagram, double-click the AT89C52 chip, and add the HEX file to the directory. At this time, the generated file has been burned into the chip. If the program is correct and the hardware circuit is connected correctly, set the pulse frequency and input it into the simulation software. Click the simulation run button at the bottom left of the schematic design interface to get the final simulation result as shown in Figure 5. 5 Conclusion The digital frequency meter is a basic measuring instrument that uses digital display to display the frequency of the measured signal. Due to its high measurement speed, high accuracy and intuitive display, it can test a variety of physical quantities if equipped with appropriate sensors. Therefore, it is widely used in aerospace, electronics, measurement and control and other fields. With the rapid development of electronic technology, it will be more widely used in various fields. This paper successfully realized the design of the digital frequency meter by using the single-chip microcomputer AT89S52, Proteus simulation software and Kell simulation software. The comprehensive debugging results show that the design proposed in this paper has the advantages of small size, low cost, low power consumption and high accuracy compared with the traditional frequency measurement system, and is suitable for various measurement circuits.
Previous article:Design of Multifunctional Digital Control Current Source Based on AT89S52
Next article:Design and implementation of thyristor trigger circuit based on AT89C2051 single chip microcomputer
Recommended ReadingLatest update time:2024-11-16 15:34
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [Repost] 5 ways to reduce the total failure rate of UPS power supply
- EEWORLD University Hall----Live Replay: CAN SIC signal improvement function
- TMS570 learning 2-bootload jump experiment
- Playing with Zynq Serial 2——GPIO peripherals of Zynq PS
- Ask the big guy, about the problem of DS1302
- EEWORLD University Hall----Application of IoT sensing technology
- [micropython] STM32 branch improves support for wiznet5k
- MSP430 MCU Development Record (18)
- Oscilloscope probe compensation principle - explain the fundamental reason for oscilloscope probe compensation calibration
- About c0_init_calib_complete of ddr4