Application of single chip microcomputer in medical signal detector

Publisher:快乐兔子Latest update time:2011-10-26 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
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 taken out at the same time. Its FLASH and powerful peripheral interface capabilities make it one of the most popular microcontrollers at present.
The high-performance microprocessor chip Atmega163 used in this paper uses the idea of ​​structured and modular program design to sample 8 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. This AVR microcontroller structure 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 uses 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 links 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 within 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 on the periphery. In addition, it has two pre-dividable 8-bit timers/counters with comparison mode, and one pre-dividable 16-bit timer/counter with comparison and capture functions.
The Atmega163 microcontroller provides a good 10-bit analog-to-digital converter. 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 sending signal line of the PC, 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 the 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, which usually makes the circuit stability worse, the cost is higher, and the circuit becomes more complicated. The above-mentioned defects can be overcome by using digital signal isolation technology.


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 the medical instrument, preventing the risk of electric shock, reducing the patient's 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 a modular and structured programming method 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 according to 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-bit data, and the high bit of the low byte stores the lowest two-bit 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 host PC, the host computer can promptly and accurately determine which channel the data comes from, so as to facilitate the corresponding processing of each channel of data. Finally, the converted data is stored in the internal RAM in order.


3.3 Data transmission
Using R0 indirect addressing, the data in 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, realize the acquisition, conversion and error-free data transmission of multiple signals, and 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 (chief editor). Principles and applications of AVR high-speed embedded single-chip microcomputers. 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. Application of Electronic Technology, 1997 (6)
4 Yang Fusheng. On the discipline development strategy of biomedical signal processing research - Today and tomorrow of biomedical engineering. 1st edition. Tianjin: Tianjin Science and Technology Translation and Publishing Company, 1998: 465-483
Reference address:Application of single chip microcomputer in medical signal detector

Previous article:Application of 2704 controller in industrial control
Next article:Multi-channel temperature and humidity measurement and control system based on ADμC812 single chip microcomputer

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号