As people's pace of life accelerates and the population gradually ages, heart disease has become one of the major diseases that endanger human health and life. The ECG monitoring system provides an effective means for the diagnosis and treatment of heart disease patients, and is of great significance to the prevention, treatment and diagnosis of heart diseases. This article introduces an ECG monitoring system based on Linux and MiniGUI, which can satisfy patients anytime and anywhere. Electricity can be monitored conveniently and quickly, abnormal situations can be discovered in a timely manner and effective measures can be taken to better protect people's health.
1 Hardware system design
This system uses S3C2440 processor as the control center. S3C2440 is a 16/32-bit RISC embedded processor based on the ARM920T core. The maximum frequency can reach 532MHz. It provides 64MSDRAM, 64M Nand Flash and 2M Nor Flash storage devices, independent 16kB Instruction cache and 16kB data cache, LCD controller, 3-channel asynchronous serial port, SPI synchronous serial port, 117-bit general-purpose I/O port, 1 internal clock, 8-channel 10-bit ADC, touch screen interface, Ethernet controller, PCMCIA interface, USB interface, etc., have the characteristics of high performance, low power consumption, and high cost performance. They are mainly used for video conferencing, network monitoring, GPS positioning/navigation, etc., especially medical electronic equipment. The overall hardware structure of the system is shown in Figure 1, which can realize functions such as ECG signal collection, processing, display, and storage.
Figure 1 Overall hardware structure of the system
2 Software system design
2.1 Building embedded Linux
The development of the ECG interface is based on the MiniGUI embedded Linux system. Among various embedded operating systems, Linux is characterized by its clear structure
It is clear, open source code, powerful, easy to transplant and is widely used. The kernel of this system adopts 2. 6 version of the kernel, Linux 2. 6 kernel has been greatly improved in terms of performance, module support, usability, scalability, etc. A complete embedded Linux system mainly includes three aspects: BootLoader (boot program), kernel and root file system. In this system, the bootloader uses ViVi and the file system uses Yaffs. According to the actual needs of the target platform, the boot program, kernel and file system are cut and configured. Finally, the compiled ViVi and the generated image files of the Linux kernel and file system are burned into the platform and run. The embedded Linux is built. .
2.2 Graphical user interface MiniGUI
MiniGUI is a lightweight graphical user interface support system based on Linux. It was developed under the leadership of Wei Yongming, a former Tsinghua University teacher, and follows the GPL convention. The supported operating systems are not limited to Linux, it can also run on systems such as uClinux, uC/OS-Ⅱ, eCos and Vx-Works. Verified hardware platforms include Intelx86, ARM (ARM/AMR9/StrongARM/xScale), Power-PC, MIPS, M68K (DragonBall/ColdFire), etc. To transplant MiniGUI, first download the source code of MiniGUI libminigui-1. 6. 10. tar. gz (MiniGUI function library source code) and minigui-minigui-res-1. 6. 10. tar. gz (resources used by MiniGUI, including basic fonts, icons, bitmaps and mouse cursors), then compile and install and copy MiniGUI resources to the target platform, and finally modify /etc/MiniGUI of the target platform. cfg file to configure the running environment of the target platform MiniGUI.
2.3 ECG collection interface design
2.3. 1 Main interface
There are three window types in MiniGUI: main window, dialog box and control window. The ECG acquisition interface is designed using dialog boxes. Dialog programming is a technology for quickly building user interfaces. MiniGUI provides a template-based mechanism. , represented by two structures, DLGTEMPLATE and CTRLDATA. DLGTEMPLATE is used to define the dialog box itself, and the structure CTRLDATA is used to define the control. Using these two structure templates, users can define their own dialog boxes and controls in the program as needed. The dialog box of the main interface is defined as follows:
staTIc DLGTEMPLATE DlgInitProgress =
{
WS_BORDER WS_CAPTION,
WS_EX_NONE,
0,0
, 240, 320,
"Welcome to use the ECG signal acquisition system",
0,0
,
10, NULL,
0
} ;
Use CTRLDATA to define all controls in the dialog box and use arrays to represent them. Dialog boxes often use controls to implement functions such as prompts or settings. The control array model is defined as follows:
staTIc CTRLDATA CtrlInitProgess[]=
{
{CTRL_STATIC,
WS_CHILD|WS_VISIBLE| SS_NOTIF
|WS_BORDER,
0,0
, 240, 30
IDC_STATIC1,
"Welcome to use the ECG signal collection system",
0
} ;
{
…
} ;
…
} ;
The main interface of the ECG monitor generated by the above method is shown in Figure 2. The ECG collection interface mainly has functions such as ECG data collection and display, storage, and analysis. It uses multi-thread programming to establish a dedicated thread for collection, display, storage, and analysis. Multi-threading of data collection can effectively speed up the response speed of the program and increase the efficiency of execution.
In MiniGUI, message driver is used as the application creation framework. In message-driven applications, events occurring in computer peripherals are collected by the support system and translated into specific messages in a pre-agreed format. Applications generally include their own message queues, and the system sends messages to the application's message queue. These messages are read from the message queue and processed by the window procedure function. The interface of this system translates the mouse button into a specific message. If a control message is received, the ID is determined and the corresponding message is processed according to the application program.
2.3.2 ECG collection and display
ECG data collection uses a timer for collection and display. The timer is created using the SetTimer function. When creating, you need to specify the timer identification number and timing time. When the timing time arrives, the timer will generate a MSG _ TIMER message. This system The ECG collection frequency is 200Hz.
Read the three-channel data from the A/D register and store it in the array, and draw the data in the array on the LCD. Real-time drawing in MiniGUI uses GDI. An important part of the GUI system is GDI, that is, Graphics Device Interface. Through GDI, GUI programs can perform graphical output, including basic drawing and text output, on the computer screen or other display devices. All drawing-related functions require a device context. In order to improve drawing efficiency, a private device context is established here. The established device context is valid throughout the window lifetime, thus eliminating the acquisition and release process. Use hdc =GetPrivateClientDC(hDlg) to obtain the private device context. Then call MoveTo (HDC hdc, int x, int y) and LineTo (HDC hdc, int x, int y) to draw lines on the data in the array. Since the collected ECG data is small, it is drawn after All data are appropriately amplified according to the display area before the line is drawn, so that the ECG waveform can be displayed intuitively on the LCD monitor.
2.3.3 ECG data analysis
In the ECG data display and analysis thread, since the ECG signal is easily affected by various interferences, in order to filter out the interference components in the ECG signal, digital filtering must be performed first, using FFT filtering and sliding average filtering methods to make the image It is smoothed and the differential method is used for R-wave detection. When 5 seconds of data are collected, the program starts the ECG data analysis thread to analyze the ECG data stored in the array, mainly detecting R waves and displaying them on the LCD.
2.3.4 Compilation of ECG interface program
The ECG interface program is first written on the PC. In order to run on the target platform, it must be cross-compiled and compiled.
as follows:
#arm-linux-gcc -I /home /include -L/home /lib-O2 -oxindian xindian. c -lminigui -lmgext -lm -ljpeg-lpthread-lpng
At this time, the executable file of the ECG interface program is generated and downloaded to the target platform to run.
3 Conclusion
The ECG monitor developed in this article uses a high-performance ARM9 microprocessor as the core, transplants the Linux operating system on it, and uses MiniGUI for ECG interface development. It can collect, waveform display and process ECG signals to realize ECG The purpose of real-time monitoring of signals. This ECG monitor combines the advantages of existing ECG monitors. It is small in size and light in weight. It also has the advantages of simple operation interface and strong scalability. It has a high effect on various arrhythmias and various heart diseases. diagnostic value.
Previous article:Design of video surveillance system based on 3G mobile phones
Next article:Embedded system VGA interface design based on ADV7125
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- 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
- Analysis of the phenomenon after nmos is broken down
- Optimizing DSP Power Budget
- I have a question about digital signal processing. I don't need to deal with hardware yet.
- Discussion: Internet of Vehicles: Who will dominate the world?
- [Tool Tutorial] CH340 USB to Serial Chip Driver Installation Instructions
- LPC1768 dynamically displays QR code
- Read the good book "Operational Amplifier Parameter Analysis and LTspice Application Simulation" 03 Bias Current Case Analysis
- 90% new, Xintang NuTiny-SDK-Nano130 development board 50 yuan, free shipping
- Keysight Technology Service Day Seminar|Wuhan Station——Invitation Letter
- GaN technology for wireless charging - high-power automotive scenarios first!