Design of a data acquisition instrument based on ADuC824
2026-04-06 02:55:41··#1
[Abstract] This paper introduces the internal structure and function of the ADuC824, and describes the construction of a portable data acquisition instrument by combining it with the K9S2808V0A flash memory chip. The paper also presents the software and hardware design methods. [Keywords] ADuC824; data acquisition; portable 1 Introduction Data acquisition instruments can be widely used in various fields such as industry, agriculture, military, and daily life. The requirements for data acquisition instruments are usually high acquisition speed, high accuracy, large storage capacity, strong anti-interference ability, real-time recording of data acquisition time, simple operation, portability, and flexible selection of data output methods. However, data acquisition systems composed of ordinary microcontrollers are difficult to meet these requirements. This paper introduces a software and hardware design method for a data acquisition instrument based on the ADuC824 data acquisition system chip and combined with the large-capacity flash memory K9S2808V0A chip. This acquisition instrument is particularly suitable for field and harsh environment workplaces. 2 Hardware System Composition of the Portable Data Acquisition Instrument The hardware system composition of the portable data acquisition instrument is shown in Figure 2-1. The data acquisition instrument uses the high-performance data acquisition system chip ADuC824 from Analog Devices, Inc. (ADI). It can simultaneously receive multiple analog signals and select the input mode of the analog signal (direct input or differential input). It uses time-division multiplexing for acquisition and can record the data acquisition time in real time. The external analog signal is multiplexed, buffered, amplified by programmable gain, low-pass filtered and converted from analog to digital within the ADuC824. According to the characteristics of the analog signal, the acquisition personnel can select different sampling rates and digital filters through the keyboard to sample data and perform anti-interference processing. The processed data and time information are directly stored in the external large-capacity flash memory K9S2808V0A and displayed on the LED display. If the user needs to further analyze and process the data, he/she can directly print it out through the printer interface connected to an external micro printer, or transmit it to the host computer through the communication interface, and then use special software to classify or synthesize the data. 2.1 Introduction to ADuC824 chip [1] ADuC824 is a high-performance micro-converter produced by Analog Devices, Inc. (ADI). It is a truly complete data acquisition system chip. It integrates dual high-precision Σ-Δ ADC, temperature sensor, programmable gain amplifier PGA, 8-bit MCU, Flash Memory, RAM and timer/counter functions in a single chip. It has 52 pins and adopts PQFP (plastic square flat) package. Figure 2-2 is the internal functional block diagram of ADuC824. Its composition and characteristics are as follows: (1) Based on the 8051 core, the instruction set is compatible with 8051; it can operate with a 32kHz crystal oscillator, and uses the on-chip PLL (phase-locked loop) to generate the internal working frequency required. The MCU core working frequency and data output rate are programmable, and the output accuracy changes with the programmable gain and output data rate; 3 16-bit timer/counters; 26 programmable I/O lines; 12 interrupt sources with two priorities. (2) 8KB on-chip flash/electrically erased program memory; 640B on-chip flash/electrically erased data memory; on-chip charge pump (no external VPP required); 256B on-chip data RAM; expandable 64KB program memory space and 16MB data memory space. (3) Two independent ∑-Δ ADC channels, with resolutions of 24 and 16 bits for the main and auxiliary channels respectively, and programmable self-calibration function; 12-bit voltage output digital-to-analog converter (DAC); on-chip temperature sensor; two excitation current sources; reference detection circuit; time interval counter (TIC). (4) Operates on 3V and 5V voltages; has three working modes: normal, idle and power-down. (5) One general-purpose UART serial I/O; one I2C-compatible two-wire serial port and SPI serial port; one watchdog timer (WDT); one power monitor (PSM). 2.2 Interface circuit of the data acquisition instrument [2] The interface circuit of the data acquisition instrument includes several parts such as data memory expansion circuit, calendar clock circuit, keyboard/display circuit and printing and communication circuit. (1) Calendar Clock Interface Circuit To record the data acquisition time in real time, a calendar clock interface circuit was designed for the data acquisition instrument. The calendar clock chip selected is the Dallas DS12C887. This chip uses CMOS technology and integrates the crystal oscillator and lithium battery circuits required for chip operation. It can automatically generate time information such as century, year, month, day, hour, minute, and second, and has the advantages of low power consumption, high accuracy, stable and reliable operation, and simple peripheral interface. The interface circuit between DS12C887 and ADuC824 is shown in Figure 2-3. Among them, MOT: mode selection, grounded here, selects Intel mode; AD0~AD7: time-division multiplexed address/data bus; AS: address strobe; /DS: data read enable; R/W: data write enable; /CS: chip select; /RESET: reset. They are respectively connected to the P0 port, ALE, /RD, /WR, P3.5 and +5V of ADuC824. (2) Communication and Printing Interface Circuit To achieve communication with the host computer (PC), the MAX232 chip is selected to form the communication interface circuit. The MAX232 is a dual RS-232 data transceiver that only requires a +5V power supply. Figure 2-3 shows the interface circuit between it and the ADuC824. The TxD and RxD of the ADuC824 are connected to the T21N and R20UT of the MAX232, respectively, while the T20UT and R2IN of the MAX232 are connected to the PC. The printing interface circuit can be implemented by expanding the ADuC824 with a programmable parallel I/O interface chip (such as 8255) to complete the direct printing output of the data acquisition instrument. (3) Data Memory Expansion Circuit Although the ADuC824 contains 640B of flash/electrically erased data memory and 256B of RAM, its capacity is relatively limited and cannot meet the requirements of the data acquisition instrument. Therefore, the system expands the external data memory by 16MB. The memory chip selected is Samsung's new high-capacity flash memory K9S2808V0A. The K9S2808V0A is a 22-pin surface-mount package device with a single-chip capacity of 16MB (16M×8). Its outstanding advantages are: command, address, and data information are all transmitted through 8 I/O lines; the address lines for addressing memory cells are not used as chip pins; the 24-bit address is written to the address register in three parts, decoded, and then the corresponding cell is found. The circuit connection is simple and highly reliable. Figure 2-4 shows its interface circuit with the ADuC824. Specifically, CLE: command latch enable, ALE: address latch enable, CE: chip select, RE, WE: read/write enable, R/B: operation status indicator, and I/O ports: tri-state, used for inputting commands, addresses, and data, and outputting data during read operations. These are connected to the ADuC824's P1.1, ALE, P1.0, /RD, /WR, P1.2, and P0 ports, respectively. The various operations of K9S2808V0A have a common feature: the operation command is first sent to the command register on the I/O port, and then the address of the unit to be operated is sent in the next three consecutive cycles. (4) Display and keyboard interface circuit In order to improve the anti-interference performance of the data acquisition instrument and save the resources of A-DuC824, the interface circuit is composed of the keyboard and display dedicated interface chip MAX7219. MAX7219 is a multi-functional serial LED display driver launched by MAXIM Corporation of the United States. It uses a 3-wire serial interface to transmit data and can be directly interfaced with ADuC824. It contains hardware dynamic scanning display control. Each chip can drive 8 LED digital tubes. When multiple MAX7219 chips are cascaded, more LEDs can be controlled. The MAX7219 is a common-cathode display driver. Its SEGA-G and SEGH are the segment and decimal point driver pins for the seven-segment LED display, outputting segment control signals. DIG0-7 are 8-bit digital drive lines, outputting bit selection signals. DIN is the serial data input, CLK is the serial clock input, and DOUT is the serial data output, which is transmitted to the DIN pin of the next MAX7219 in cascading. LOAD is the load data control pin, and ISET is connected to the power supply through a resistor to provide the peak current to the LED segments. Figure 2-4 shows its interface circuit with the ADuC824. The data acquisition instrument can determine the number of LEDs needed based on actual requirements before deciding whether to cascade multiple MAX7219s. In the figure, P3.2, P3.3, and P3.4 of the ADuC824 serve as the signal input pins for DIN, CLK, and LOAD of the MAX7219, respectively. The keyboard interface circuit also uses the MAX7219 chip; the specific circuit diagram is not shown here. The keyboard has six keys: A, B, C, and D keys for sampling signals, and print and communication keys. Depending on the type of signal being acquired, different sampling rates and digital filters are selected using the A, B, C, and D keys to improve the accuracy and correctness of the data. The print key allows for direct data printing. The communication key enables communication with the host computer. 3. Software Design of the Portable Data Acquisition Instrument The software of the acquisition instrument includes a main program, subroutines, and various functional programs, employing a modular programming approach. The main components are as follows: (1) System initialization module: completes the initialization of programmable chips such as ADuC824, DS12C887, K9S2808V0A, and MAX7219; (2) System self-test and error handling module: realizes the self-test function of the data acquisition instrument and prompts system error information; (3) Display and key test module: realizes the display of calendar clock and acquired data, and determines whether a key is pressed and which key is pressed; (4) Calendar clock data transmission module: completes the calling and storage of calendar clock data; (5) Digital filter module: compiles corresponding digital filtering programs according to the different characteristics of analog signals and interference signals to realize software anti-interference; (6) Flash/electrically erasable data memory data input and output module: completes the data storage and output functions; (7) Printing module: realizes the direct printing output of data; (8) Communication module: realizes the data transmission between the data acquisition instrument and the host computer. The main program flowchart is shown in Figure 3-1. 4 Conclusion The ADuC824 has abundant on-chip resources and can be widely used in intelligent instruments, intelligent sensors/transmitters, weighing instruments, pressure measurement, portable instruments, and other fields. At the same time, the ADuC824 also represents the current development trend of microcontrollers. Portable data acquisition instruments based on the ADuC824 not only have advantages such as compact hardware structure, low power consumption, good anti-interference performance, and easy portability, but also have high stability and reliability. [References] [1] Li Gang. Principles and Application Technology of ADuC8XX Series Microcontrollers [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2002. [2] He Limin. MCS-51 Series Microcontroller Application System Design [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 1999.