Application of single chip microcomputer in medical signal detector

Publisher:HappyExplorerLatest update time:2020-03-06 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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

Reference address:Application of single chip microcomputer in medical signal detector

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

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号