Intelligent control of A/D conversion data. This article takes the actual engineering application of PIC microcontroller and ICL7135 as an example to introduce the application of an intelligent temperature control instrument in the temperature transmitter .
1 PIC microcontroller
The PIC series 8-bit CMOS microcontrollers have a unique RISC structure and a Harvard bus structure with separate data bus and instruction bus, which makes the instructions have the characteristics of single word length and allows the number of bits of instruction code to be more than the number of data bits of 8 bits. Compared with the traditional 8-bit microcontrollers with CISC structure, this can achieve 2:1 code compression and increase the speed by 4 times.
PIC has an excellent development environment and complete confidentiality. PIC uses confidential fuses to protect the code. After the user burns the code and blows the fuse, others can no longer read it unless the fuse is restored. It also has a watchdog timer, which can be used to improve the reliability of program operation. In this project, the PIC mid-range microcontroller PIC16F62x was selected, which contains 2K flash, 224 bytes of SRAM, 128 bytes of EEPROM, 16 I/O ports, 1 CCP capture channel, 2 comparator channels, 2 8-bit and 1 16-bit timers, and has UART function.
2 7135 A/D Conversion Principle
7135 uses high impedance differential input, the total offset voltage is less than 10μV, and its A/D converter uses dual integration, which is divided into 4 stages: automatic zeroing, input signal integration, standard signal anti-integration, and integrator zeroing. The conversion process is shown in Figure 1.
As can be seen from Figure 1, when 7135 integrates the input signal, its BUSY signal line jumps from low to high and remains at a high level until the standard signal anti-integration ends and then jumps to a low level. In this process, the integration of the input signal generally maintains 10001 clock pulses, and in the case of full scale, the inverted standard integration value is 20001 (when Vin="2Vref"). For different analog inputs, the number of reverse standard integration pulses of 7135 is different, and the high-level width of the BUSY signal is also different. The number of reverse integration pulses is proportional to the input signal amplitude, and has a one-to-one correspondence with the measurement result. During the conversion process, 7135 provides an input signal polarity judgment pin POL. When the input (Vin+-Vin-) is positive, the POL signal is high, and when (Vin+-Vin-) is negative, the POL signal is low.
3 7135 serial connection with PIC microcontroller
From the conversion principle of 7135, it can be known that the measurement result can be obtained by pulse counting, and only three control lines CLK, BUSY, and POL are required. The PIC series microcontrollers launched by Microchip have the advantages of large driving ability, strong anti-interference ability, and moderate price. The PIC16F6X series launched by it has 2~4K FLASH memory, 1 16-bit timer, 2 CCP comparison/capture modules, and more than 22 I/Os. The only regret is that there is no sampling clock that meets the 7135. Considering that the instrument needs communication and isolated analog transmission output, a 16M crystal oscillator is used, and the 16-bit timer T1 is used as the synchronous counting pulse of 7135. BUSY is connected to the CCP1 pin, working in capture mode, and used to measure the pulse width; and the CLK clock of 7135 is connected to the high-speed inverter using the CPU crystal oscillator, and then taken out by frequency division. Considering the sampling speed and the anti-interference effect on the 50Hz power supply, as well as the large inertia of temperature variables, CLK="250kHz" is selected, and the sampling speed is about 4 times/min. The system hardware connection is shown in Figure 2:
In practical applications, the object of monitoring is the temperature of the glass furnace, and the signal is collected to the transmitter using a thermocouple. As a temperature transmitter, the influence of ambient temperature must also be considered. Secondly, the temperature drift of the device must also be considered. The two interference quantities must be processed with the data obtained later to obtain the true temperature value. Therefore, there are three quantities that need to be collected in the analog input part, which are isolated through a multi-channel analog switch, and then the signal is sent to the operational amplifier for A/D conversion. In the A/D conversion part, since the ICL7135 itself does not have its own reference voltage, an accurate reference voltage source must be used in the design.
The actual application uses the TL431 adjustable voltage reference, which meets the production requirements and has a good effect. The output part of the transmitter needs to be isolated and the output terminal of the MAX485 is connected to the above pull-down resistor.
4 Calculation and processing of A/D conversion results
The clock of timer T1 and the clock of 7135 are not the same input. The clock of T1 is 1:128 of the system clock, while the CLK of 7135 is 125KHz, which is the square wave pulse output by the CPU pin. The BUSY pin of 7135 is connected to the pin with level interrupt function of CPU, so when BUSY is high, the pulse number starts to be counted until one conversion is completed. The data measured by the thermocouple channel is processed according to its voltage-temperature characteristic table to obtain its temperature value. The temperature drift depends on the polarity of POLARITY. If it is positive, it is subtracted from the thermocouple temperature value, otherwise it is added. The ambient temperature is directly added. After the temperature data is processed, wait for the host computer to send instructions to upload.
5 Software Design
The design of the system software contains the following processing modules: initialization and main program module, interrupt processing module, data processing and transmission control output module. The interrupt processing module includes communication interrupt and capture interrupt processing. The data processing and transmission control output module includes data processing of temperature objects and reception and transmission control of serial communication. The following briefly introduces the main program running process and 7135 level interrupt processing. The program flow is as follows:
During the A/D conversion process, the pulse count starts when the BUSY pin rises, and the count ends when the pin falls. The result is stored in the CCP register, which is a 16-bit register divided into two bytes, CCPR1H and CCPR1L, high and low. Shift CCPR1H left by 4 bits, add CCPR1L, and then subtract 10001, which is the count value of the A/D conversion pulse. The converted data is further processed by the software according to the above method. In the process of processing the sampled data, it is possible to perform pulse filtering on every 4 or 8 sampling values, or combine other filtering methods such as the first-order filtering method to process, display, and control the data, which can make the measurement more accurate and the display more stable. This provides a strong guarantee for the continuous and stable production.
6 Conclusion
The working environment of this temperature transmitter is quite harsh, and the electrostatic interference is very large. During the debugging process, the chip was even burned out by electrostatic stimulation. Adding optocoupler isolation at the front end of serial communication and pulling up the MAX485 chip A and B to the power supply and ground respectively played a good protective role. During the long-term use, this transmitter performed well in terms of stability, accuracy, real-time performance and safety, meeting the needs of actual production.
Previous article:Design and production of a single-chip temperature data recorder
Next article:PIC16F84A MCU Tutorial Board Detailed Explanation (PCB Diagram and Schematic Diagram)
Recommended ReadingLatest update time:2024-11-16 16:02
- Popular Resources
- Popular amplifiers
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
- For NPN tubes, the c and e poles of U(br)ceo are both N-type, so where does the reverse statement come from?
- AWR1642: Add I2C driver support to the existing mmWave SDK demo
- 【GD32E503 Review】+ Littlefs Porting
- Solution to TL570x-EVM-A2 development board device node operation not permitted
- National Technology N32 MCU RF Resource Library (official, practical information)
- Raspberry Pi Pico Windows Development Environment - Compile under Visual Studio Code...
- Power circuit problem
- View Circuit-ADC and System (1)
- Teach you to understand the role of resistors in circuits
- EEWORLD University Hall----High-efficiency power architecture for smart door locks, battery-free light switches and wireless sensors