Digital voltmeters have been designed and developed in many types and styles. Traditional digital voltmeters have their own characteristics. They are suitable for manual measurement on site. To complete remote measurements and further analyze and process the measurement data, traditional digital voltmeters cannot complete it. However, a digital voltmeter based on PC communication can not only complete the transmission of measurement data, but also use the PC to process the measurement data. Therefore, this type of digital voltmeter has characteristics that traditional digital voltmeters cannot match in terms of function and practical application, which makes its development and application have good prospects.
Overall design of new digital voltmeter
The measurement voltage type of this new digital voltmeter is DC, and the measurement range is -5~+5V. The whole machine circuit includes: MCU minimization design of data acquisition circuit, MCU and PC interface circuit, MCU clock circuit, reset circuit, etc. The lower computer uses AT89S51 chip, and the A/D conversion uses AD678 chip. Communicates with the PC through the RS232 serial port and transmits the measured DC voltage data. The whole system circuit is shown in Figure 1.
The principle of data acquisition circuit
In the design of the microcontroller data acquisition circuit, the circuit design was minimized, that is, no additional logic devices were used as interface circuits, and the microcontroller's operation of the AD678 conversion chip was realized.
AD678 is a high-end, multi-functional 12-bit ADC. Since it has built-in sample and hold, high-precision reference power supply, internal clock and three-state buffered data output, it only requires a few external components. It constitutes a complete data acquisition system, and an A/D conversion only takes 5ms.
In the circuit application, AD678 adopts synchronous working mode, and the 12-bit digital output adopts 8-bit operation mode, that is, the 12-bit converted digital quantity is read twice, first reading the high 8 bits, and then reading the low 4 bits. Bit. According to the timing relationship, when the chip selects /CS=0, the conversion terminal /SC changes from high to low once, and the A/D conversion can be started once. Then query the conversion end end /EOC to see if the conversion has ended. If it ends, the output enable /OE will become low and the output will be valid. The reading of 12-bit digital quantity requires controlling the high byte valid end/HBE, reading the high byte first, and then reading the low byte. The entire A/D operation is roughly the same, and it is adjusted in actual development and application.
Since the bipolar input mode of AD678 is used in the circuit, the input voltage range is -5~+5V. According to the formula Vx=10 (V)/4096*Dx, the measured voltage Vx value can be calculated. In the formula, Dx is the 12-bit digital value after conversion of the measured DC voltage.
Design of RS232 interface circuit
The interface circuit between AT89S51 and PC uses chip Max232. Max232 is a chip launched by Texas Instruments (TI) that is compatible with the RS232 standard. The device contains 2 drivers, 2 receivers and a voltage generator circuit providing TIA/EIA-232-F levels. The Max232 chip has a level conversion function to match the TTL level of the microcontroller with the RS232 level of the PC.
The RS232 interface for serial communication uses a 9-pin serial port DB9. Serial port data transmission can be realized as long as there are receiving data pins and sending pins: the receiving pins and sending pins of the same serial port are directly connected with wires, two serial ports are connected or one serial port and multiple serial port connection. In the experiment, timer T1 is used as the baud rate generator, and its initial counting value X is calculated according to the following formula:
The serial communication baud rate is set to 1200b/s, while SMOD=1, fosc=6MHz, and the initial counting value X=0f3H is calculated. Just load it into TL1 and TH1 during programming.
In order to facilitate observation, when each time the voltage is measured and data is collected, when the microcontroller has a port output, it is indicated by a light-emitting diode (LED).
software programming
The software programs mainly include: data acquisition program of the lower computer, visual interface program of the upper computer, and serial communication program between the microcontroller and PC. The single-chip microcomputer is programmed with C51 language, and the operation display interface of the host computer is visually programmed with VC++6.0. During the serial communication debugging process, with the help of the "Serial Port Debugging Assistant" tool, this tool can be effectively used to improve the efficiency of the entire system.
Microcontroller programming
The data collection communication main program flow of the lower computer microcontroller is shown in Figure 2, the interrupt subroutine is shown in Figure 3, and the collection subroutine is shown in Figure 4. With the help of WAVE2000 emulator for programming simulation and debugging of microcontroller, this system has an integrated ISP simulation and debugging environment.
In the acquisition program, the programming operation of the microcontroller must fully comply with the timing specification requirements of AD678. In actual development, it must be continuously debugged. Finally, the .bin file generated by the successful debugging of the lower computer is solidified into the Flash unit of AT89S51.
Human-computer interface programming
Open VC++6.0 and create a dialog-based MFC application. Serial communication is implemented using the MSComm control. Other operations will not be described here. Programming implements a good human-machine interface. The operation interface of the digital DC voltmeter is shown in Figure 5. By running the Windows program programmed with VC++6.0, the entire prototype function can be realized.
Functional results
According to the working principle and implementation plan mentioned above, the functions of the entire prototype have been well realized in practice, and all indicators have met the pre-design requirements. The circuit works stably, each measurement is accompanied by LED lighting instructions, and the visual interface display is also normal.
AD678 conversion accuracy is 12 bits, and its resolution is 1/4096. This provides a guarantee for the high accuracy of the entire machine system. In order to improve the measurement accuracy, the AD678's own calibration circuit is used, which makes its A/D conversion accuracy higher. In the actual measurement, the measurement accuracy of the whole machine reached 0.8%.
Previous article:Implement software and hardware design of integrated chip test system
Next article:Design of multi-band spectroradiometer acquisition system based on C8051F020 microcontroller
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Detailed explanation of the two methods of noise figure measurement, do you get it?
- P&SM99@%S34 VR8H6-RONJ.pdf
- The moon rises over the sea, and the world is sharing this moment
- Renesas prizes have arrived^_^
- [Project source code] Cymometer, an equal-precision frequency meter based on FPGA
- Last 4 days to apply for free: Mil based on NXP high-speed, high-performance LS1028A development board
- EEWORLD University - Efficiency of switching power supply
- Treatment of cross-partition area and slot in EMC design of power board
- [National Technology N32G457 Review] UART-DMA indefinite length packet loss test
- msp430g2553 adc sampling accuracy problem