Introduction: A circuit with Atmega163 as the core is designed to collect multiple physiological parameters of the human body in real time and transmit high-speed data. This circuit constitutes a human physiological parameter detector to provide a basis for doctors to diagnose diseases.
1 Introduction
Traditional testing instruments are mostly completed by hardware circuits, which not only have single functions, but also have long development cycles and are difficult to maintain. With the rapid development of microelectronics technology and information technology, medical testing instruments are developing in the direction of modularization, multi-function, intelligence and miniaturization. The rapid development of modern digital components has provided strong support for medical testing instruments. Medical testing instruments have all adopted microprocessors to enhance their functions without exception. The extensive application of microprocessor chips can enhance the intelligence of instruments, improve their stability and the accuracy of data processing, integrate the collection, processing and communication of medical signals, and have a series of advantages such as self-diagnosis and self-checking.
The AT90 series AVR microcontroller newly launched by ATMEL is a very eye-catching microprocessor. This chip is based on the new RISC (Reduced Instruction Set Computer) structure and adopts a pipeline structure in design. When executing the previous instruction, the next instruction is fetched at the same time. Its FLASH and powerful peripheral interface capabilities make it one of the most popular microcontrollers at present.
This paper adopts the high-performance microprocessor chip Atmega163, and uses the idea of structured and modular program design to sample 8 channels of human physiological signals in real time, compress and optimize the data, and transmit serial data with the host PC at a rate of 115 200 bps.
2 Hardware Composition
2.1 Microprocessor and its characteristics
Atmega163 is a high-end series product launched by ATMEL. It is a low-power CMOS 8-bit microcontroller based on AVRRISC. When the external crystal oscillator is 8MHz, the execution time of an instruction is only 125ns. The structure of this AVR microcontroller is conducive to programming in C language, so that the target product can be developed efficiently. In order to optimize the target code size, the AVR microcontroller adopts a large fast access register file and fast single-cycle instructions. By executing an instruction in one clock cycle, Atmega163 can achieve a performance close to 1MIPS/MHz. It connects 32 working registers and a rich instruction set together, so that all working registers are directly connected to the ALU (Arithmetic Logic Unit, the arithmetic logic unit in the computer CPU), allowing a single instruction executed in one clock cycle to access two independent registers at the same time.
Atmega163 has 16K bytes of Flash memory, 512 bytes of online programmable E2PROM, 1024 bytes of SRAM, and a full-duplex UART serial communication interface. In addition, it has two pre-scalable 8-bit timers/counters with compare mode, and one pre-scalable 16-bit timer/counter with compare and capture functions.
Atmega163 microcontroller provides a 10-bit analog-to-digital converter with good performance. As shown in Figure 1, port A is an 8-channel analog signal input terminal. If the AD function is disabled, port A is an 8-bit bidirectional I/O port. 8-channel human physiological signals such as electrocardiogram, heart sound, carotid artery, pulse, body temperature, etc. are connected to the 8 pins of port A after amplification, filtering, and denoising. When the microprocessor collects data, it selects the channel number by controlling the ADMUX register, and the read data is further processed by the CPU.
2.2 Serial communication interface circuit based on RS-232
As shown in Figure 2, J1 connected to the host PC uses 5 signal lines of RS-232, among which TX is the PC's sending signal line, RX is the receiving signal line, and CGND is the ground line. RTS and DTR do not generate signals, but only generate high and low levels during initialization. RTS is set to +12V and DTR is set to -12V. The function of transistor Q1 is to invert the signal and output RS-232 level.
Electrical safety is an issue that must be considered in medical measuring instruments. Traditional medical measuring instruments generally use isolation amplifiers to isolate analog signals. The shortcomings of this isolation technology are: (1) Different isolation technologies must be used for different analog signals; (2) The use of this isolation measure will cause problems in signal linearity, common-mode rejection, and frequency response, usually making the circuit less stable, more expensive, and more complex. The use of digital signal isolation technology can overcome the above shortcomings.
The photoelectric isolator 6N137 is a device that combines a light-emitting diode and a photosensitive tube and packages them together (see the box in Figure 2). Since the two parts are electrically isolated, the photoelectric isolation device can satisfactorily solve the problem of signal isolation and level matching. Through this isolation circuit, the power supply of the PC system and the power supply of the measuring instrument can be completely isolated, thereby ensuring the safety of medical instruments, preventing the risk of electric shock, reducing patient leakage current, and also reducing the interference of the computer on the detection circuit.
3. Software Design
The software flow chart is shown in Figure 3. The software part adopts modular and structured programming methods and is written in assembly language. The functions of the relevant modules are as follows.
3.1 Initialization
Set the initial value of SP, clear the internal RAM area used by the program to 0, assign an initial value (8) to the data acquisition channel counter, and set the baud rate (115 200).
3.2 Data Acquisition and A/D Conversion
Sample each signal in a predetermined sampling order. Since A/D conversion requires a certain amount of time, the delay waiting time should be slightly longer than the conversion completion time. After the previous conversion is completed, the next conversion should be started immediately. Since the analog signal becomes a 10-bit digital signal after A/D conversion, we use 2 bytes to store the data. The high byte stores the high 8 bits of data, the high bit of the low byte stores the lowest two bits of data, and the last 6 bits are filled with 0. At the same time, the sampling channel number is added to the lowest 3 bytes, so that when communicating with the upper PC, the upper computer can promptly and accurately determine which channel the data comes from, so as to facilitate the corresponding processing of each data. Finally, the converted data is stored in the internal RAM in order.
3.3 Data transmission
Using the R0 indirect addressing method, the data in the RAM is taken out and sent to the PC byte by byte at a baud rate of 115 200 bps. After sending 8 channels with a total of 16 bytes, the next round of sampling is carried out.
3.4 Host PC receiving data program
The host computer communication program consists of two parts: initialization subroutine and interrupt data receiving subroutine.
4 Conclusion
The serial communication interface circuit made of the hardware circuit and software provided above can work reliably and stably to realize the acquisition, conversion and error-free transmission of multi-channel signals. At the same time, it can meet the safety requirements of medical instruments and provide assistance for clinical human physiological signal measurement and pathological diagnosis.
references
1 Ye Yongjian, ed. Principles and Applications of AVR High-Speed Embedded Microcontrollers. Beijing: Beijing University of Aeronautics and Astronautics Press, 2000
2 Wu Xiaoming, Li Bin, Cui Wensheng, et al. Research on software system for multi-channel physiological parameter detection and analysis. Journal of Jinan University, 2000, 21 (1)
3 Sun Hongjun, Sun Xiuyun, Zhou Xuetie. Design of high-speed three-wire serial communication program using C language. Electronic Technology Application, 1997 (6)
4 Yang Fusheng. On the discipline development strategy of biomedical signal processing research - biomedical engineering today and tomorrow. 1st edition. Tianjin: Tianjin Science and Technology Translation and Publishing Company, 1998: 465-483
Previous article:Application of ATmega16 in Switched Reluctance Motor Speed Control System
Next article:Design of wireless temperature and humidity sensor based on personal area network and its application in medical laboratory
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
- The ESP32-C3 module of Anxinke failed to run after burning MicroPython 1.1.17
- How to choose MOSFET indicators? System design of ACDC and DCDC? PCB layout and heat dissipation? Have you watched these useful videos?
- McBSP Serial Interface Technology and Program Design of TMS320VC5410
- Is this the intention of the forum?
- 4G DTU
- 400 V DC-BUS solution for UPS based on TI C2000
- CST Antenna Simulation and Engineering Design
- Build a car and drive to the distant land! Learn TI automotive reference designs and take a skills test to win prizes!
- EEWORLD University Hall----Rigol National Tour Seminar: Heartbeat, Infinite Possibilities
- How to use single chip microcomputer to read and write USB disk