1 Introduction
Single-chip computer application systems have broad application prospects in the acquisition and processing of biomedical micro-signals. This paper introduces a single-chip computer application system for six-channel data acquisition and processing that we developed based on actual needs. A total of two prototypes were produced and both were put into practical application. The system amplifies six weak electrical signals from sensors, converts them into digital signals through A/D converters, and performs preliminary processing on these data with a single-chip computer under the control of a PC, and then transmits these data to the PC. By selecting different sensors, the system can be used for the acquisition and processing of various biomedical micro-signals, and has a certain degree of versatility.
2 System Hardware Circuit Design
Figure 1 System block diagram
As shown in Figure 1, the system consists of sensors, micro-signal amplifiers, A/D converters, single-chip computer interfaces, and serial communications. The weak electrical signal from the sensor is amplified by the signal amplifier circuit and then sent to the A/D converter. This electrical signal is converted into a digital signal by the A/D converter and then sent to the single-chip computer for preliminary digital processing and transmitted to the PC via the serial communication interface. At the same time, the PC's instructions can also be transmitted to the single-chip computer through the serial communication interface.
The various parts of the system are introduced as follows:
2.1 Micro-signal amplifier circuit
The micro-signal amplifier circuit uses the precision data amplifier INA118 produced by Burr-Brown, USA. The operational amplifier has the characteristics of high precision and low temperature drift. Its internal structure is shown in Figure 2 [1].
INA118 has eight pins. An external amplification control resistor Rg is connected between pins 1 and 8. Pins 3 and 2 are the positive and reverse input terminals, respectively. Pins 7 and 4 are +5V and -5V power input terminals, pin 6 is the output terminal, and pin 5 is the reference voltage terminal, which is generally connected to the ground.
Figure 2 INA118 internal structure diagram
A1, A2, Ra, Rb and Rg form the first stage amplifier circuit. According to the "virtual short" characteristic of the operational amplifier, VA=VIN-, VB=VIN+. Therefore, the current flowing through Rg is
A3, Rc, Rd, Re and Rf form the second stage amplifier circuit. This stage is a differential amplifier circuit. Since Rc=Rd, Re=Rf, its voltage gain is [2].
It can be seen from the above formula that to change the gain of INA118, just change the size of Rg. In the actual circuit, Rg uses a 1KΩ precision potentiometer to form an amplifier circuit with adjustable gain, as shown in Figure 3.
Figure 3 Micro signal amplifier circuit [page]
Since the system needs to amplify the signals from six sensors separately, six INA118s (U1~U6) are used to form a six-channel signal amplification circuit. The reverse input terminals VIN- of the six INA118s are connected to the signal output terminals of the six sensors through the 1st to 6th pins of the J1 connection port; the forward input terminals are connected together and connected to the other end of the six sensors through the 8th to 10th pins of the J1 port, and are grounded through a 1KΩ resistor to reduce the common-mode input component and improve the amplifier's amplification accuracy.
Potentiometers W1~W6 are voltage amplification adjustment potentiometers, which can adjust the amplification of U1~U6 as needed. In this system, the amplification of the six channels is preset to -200 times. The output terminals Vo1~Vo6 of U1~U6 are connected to the six input terminals AIN0~AIN5 of the A/D converter U7 respectively, so as to convert the amplified voltage signal into a digital signal.
2.2 A/D conversion circuit
The analog-to-digital conversion circuit uses the serial A/D converter TLC2543 developed by Texas Instruments. It is an 11-channel, 12-bit, high-precision (maximum linear error of ±1/4096), fast (conversion time within the operating temperature range is 10μs) analog-to-digital converter [3]. Its internal structure is shown in Figure 4.
The TLC2543 is composed of seven parts: channel selector, input address register, sample-and-hold circuit, 12-bit analog-to-digital converter, output register, parallel-to-serial converter, and control logic circuit. The channel selector selects the input channel according to the address stored in the input address register, and sends the signal in the input channel to the sample-and-hold circuit. Then, the sampled analog quantity is converted into a digital quantity in the 12-bit digital-to-analog converter and stored in the output register. These data are converted into serial data through the parallel-to-serial converter and output to the microprocessor from the DOUT terminal.
Figure 4 TLC2543 internal structure block diagram
The analog-to-digital conversion circuit is shown in Figure 5. The analog signal input terminals AIN0~AIN5 of TLC2543 are respectively connected to six voltage signals Vo1~Vo6 from INA118, and the selection of each signal is set by programming; AIN6~AIN10 and the negative reference voltage terminal REF- are grounded.
It is the chip select signal input terminal. The chip select signal comes from the P1.7 pin of the single-chip computer AT892051 (the signal is generated by software programming). When
is low level, TLC2543 is allowed to input and output data. When
is high level, it is prohibited to input and output data; DOUT is the conversion data output terminal. The conversion result is output to the P1.6 terminal of the single-chip computer AT892051. The output mode can be output bit by bit from high to low, or from low to high. The specific mode is determined by programming; DIN is the serial data input terminal. The command word (including channel selection, output data length, output order, polarity selection and other information) from the P1.5 pin of the single-chip computer is input from this terminal. The input mode is high first and low later. SCLK is the input and output synchronous clock terminal. The clock signal comes from the P1.4 pin of AT892051 (the signal is generated by software programming); when data transmission starts, at each rising edge of the SCLK signal, the microcontroller inputs a command word to TLC2543 (the first 8 rising edges), and at the same time, TLC2543 outputs a conversion result to the microcontroller (the first 8, 12 or 16 rising edges). The positive reference voltage terminal REF+ of TLC2543 is connected to the +3.0V standard voltage.
The standard voltage +3.0V is generated by the power supply integrated circuit TL431. Since the voltage difference between the 1st and 2nd pins of TL431 is the standard voltage of 2.5V, and the operating current of the 1st pin can be ignored, the standard voltage output by the 3rd pin of TL431 is:
In this system, the conversion result is output in 12 bits: When the analog voltage (voltage to ground) at the input of TLC2543 is equal to (or slightly lower than) 0V, the output result of TLC2543 is 000H; when the analog voltage is equal to (or slightly greater than) 3V, the output result is FFFH (In order not to damage TLC2543, the sensor connection method should be properly selected and the amplification factor of the amplifier circuit should be adjusted so that the input voltage of TLC2543 is in the range of -0.3V to +3.3V).
Figure 5 Analog-to-digital conversion circuit
2.3 Single-chip computer interface circuit The
single-chip computer uses AT89C2051 produced by ATMEL. It is a low-power, high-performance 8-bit CMOS microcontroller chip that is compatible with the MCS-51 instruction system. The on-chip 2KB flash read-write program memory can meet the needs of this system, and there is no need to expand the external program memory.
Figure 6 Interface circuit [page]
The interface circuit is shown in Figure 6. Among them, C0 and R4 constitute the power-on automatic reset circuit; K, R5 and R4 constitute the manual reset circuit, and X, C1, and C2 constitute the oscillation circuit of the microcontroller. In order to generate an accurate serial communication baud rate, the oscillation frequency of the crystal oscillator X is selected to be 11.0592MHz (it can make the initial value of the baud rate generator T1 an integer, thereby eliminating the initial value error).
The P3.0 pin of AT89C2051 is the serial data receiving end, which receives the serial data from the R1OUT end of MAX232; the P3.1 pin is the serial data output end, and the serial data sent by the microcontroller to the PC is transmitted to the T1IN end of MAX232; the P1.4 pin outputs the synchronous clock signal, which is input to the SCLK end of TLC2543; the P1.5 pin is connected to the DIN end of TLC2543, and the microcontroller inputs the command word to TLC2543 from this end; the P1.6 pin is the A/D conversion result input end, which receives the conversion result from the DOUT end of TLC2543; the P1.7 pin outputs the chip select signal of TLC2543 and is connected to the end of TLC2543.
2.4 Serial communication circuit
The serial communication circuit is shown in Figure 7. MAX232 is a bidirectional level conversion chip that completes the conversion between TTL level (0~5V) and EIA level (-10V~+10V): when sending data, the TTL level signal is transmitted from the TXD terminal of the microcontroller to the T1IN terminal of the MAX232, and after being converted into an EIA level signal by the MAX232, it is sent out from the T1OUT terminal and reaches the PC through the TXD terminal of the RS-232C socket; when receiving data, the EIA level signal from the PC is input to the R1IN terminal of the MAX232 through the RXD terminal of the RS-232C socket, and after being converted into a TTL level signal by the MAX232, it is sent from the R1OUT terminal to the RXD terminal of the microcontroller.
Figure 7 Serial communication circuit
3 System software design
The main program block diagram of the system is shown in Figure 8.
The main program of the system is designed as a loop program, which completes the following tasks in one loop: ① Send command words to the A/D converter, read the conversion results of the A/D converter, and perform preliminary processing on the read conversion results according to the instructions from the PC; ② Send data to the PC; ③ Receive commands from the PC and respond to the commands.
In this system, the output result of TLC2543 is set to a 12-bit unsigned integer, and the output order is high bit first. In order to make the sampling results more accurate, the following sampling method is adopted: in each main program cycle, the single-chip computer reads the sampling data of the six channels AIN0~AIN5 in turn, and stores the data of each channel in the RAM of the single-chip computer in turn. After the six channels are read once, the sampling data of the six channels AIN0~AIN5 are read in turn, and the newly read data of each channel are added to the previously read results. In this way, the reading is carried out 8 times in a row to obtain the sum of the 8 sampling results of each channel, and then these results are divided by 8 to obtain the average value of the 8 sampling results of each channel, and they are transmitted to the PC as the sampling results of each channel. Since the output results of the A/D converter do not directly represent the voltage size (000H represents 0V, FFFH represents 3.0V), the single-chip computer can convert these results into voltage values (such as converting FFFH into 003H) according to the command from the PC, and the conversion of the results is completed by calling the subroutine.
Figure 8 System main program block diagram
Each time the system main program loops once, the microcontroller sends a set of data to the PC. This set of data contains three parts: ① three synchronization bytes #55H, #0AAH, #01H (for the PC to identify the content of the transmission); ② the sampling results of the six channels AIN0~AIN5; ③ the cumulative sum of the sampling results (for the PC to verify the correctness of the transmitted data). The data transmission is realized by calling the transmission subroutine. There is a delay program in the loop program. The PC controls the time required for the microcontroller to complete a cycle by transmitting the delay parameter, thereby controlling the frequency of the microcontroller sending data to the PC. The command from the PC is read in through the interrupt mode. Whenever a signal is received from the PC, the serial port of the microcontroller is interrupted. The microcontroller reads the command in the interrupt service program and executes the received command.
The working mode of the microcontroller serial port is set to mode 1, and the baud rate of serial communication is designed to be 4800. Assume that the initial value of the baud rate generator T1 is x, then [4]
that is, x=250 (+)=#0FAH (+16)
so TL1=#0FAH, TH1=#0FAH.
The data receiving program of the PC is written in Visual C++ 6.0 [5] and is made into an installable application software named "Gao Zeli-Serial Communication" using the installation program making software InstallShield Professional. Its running interface is shown in Figure 9.
Figure 9 "Gao Zeli-Serial Communication" application window
The main functions of "Gao Zeli-Serial Communication" are: ① Setting of communication parameters - click the "Set Parameters" button with the mouse, a parameter setting dialog box pops up, in which you can set the serial port number of the PC used, the frame format of asynchronous communication data, the time interval for automatically sending data to the single-chip microcomputer and other parameters; ② The PC sends control instructions to the single-chip microcomputer - the instructions to be sent can be sent to the single-chip microcomputer manually or automatically (the content to be sent can be sent by entering it into the "Send Content" edit box through the keyboard); ③ Receive data from the single-chip microcomputer - click the "Start Receiving/Stop Receiving" button with the mouse to switch between receiving and stopping, and the received data is displayed in the "Receive Echo" edit box; ④ Clear the received echo data - click the "Clear" button with the mouse to clear the data in the receive echo edit box, so that the newly received data is displayed in a directly visible position in the edit box.
4 Applications
The two prototypes were used to measure the action potential of nerve trunks in the "Nerve Trunk Action Potential" experiment for undergraduate students of clinical medicine. The experiment showed that the system has stable performance and high measurement accuracy, and has achieved initial success in the detection and processing of medical signals.
References:
[1] http://www.burr-brown.com.
[2] Wang Chenghua, Wang Youren, Hu Zhizhong (eds.), Basic Electronic Circuits Tutorial [M]. Beijing: Science Press, 2000. 133-134.
[3] Li Qunfang, Huang Jian (eds.), Single-Chip Microcomputer and Interface Technology [M]. Beijing: Publishing House of Electronics Industry, 2001. 168-172.
[4] Yang Huixian, Huang Huixian et al., Principles and Applications of Single-Chip Microcomputers [M]. Changsha: National University of Defense Technology Press, 2003. 136-137.
[5] Qiushi Technology, Tan Siliang, Zou Chaoqun et al., Viual C++ Serial Communication Engineering Development Example Navigation [M]. Beijing: People's Posts and Telecommunications Press, 2003. 73-130.
Previous article:Data Acquisition System Based on MSP430 and USB
Next article:Serial communication between PC and single chip microcomputer realized by VB in temperature control system
Recommended ReadingLatest update time:2024-11-16 20:50
- Popular Resources
- Popular amplifiers
- Operational Amplifier Practical Reference Handbook (Edited by Liu Changsheng, Zhao Mingying, Liu Xu, etc.)
- A Complete Illustrated Guide to Operational Amplifier Applications (Written by Wang Zhenhong)
- Design of isolated error amplifier chip for switching power supply_Zhang Rui
- DAM medium wave transmitter high frequency power amplifier module test platform_Tian Tian
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
- [ATmega4809 Curiosity Nano Review] Unboxing
- [CY8CKIT-149 PSoC 4100S Review] + Use of Timer/Counter
- The register value returned by the lis25ba operation is incorrect
- About the frequency signal source
- MSP430 G2553 Timer/Counter Timer_A
- AWR1843BOOST mmw demo operation guide (Part 2)
- DHT11 temperature and humidity sensor, error File "dht.py", line 23, in measure
- Wafer Foundry
- RVB2601 drives MPU6050 gyroscope module
- Compile Linux firmware for Xunwei 3399 development board