Miniature home ECG machine based on MSP430 design

I. Overview

Cardiovascular disease is a relatively common disease. With the accelerated pace of life, the improvement of living standards and health awareness, people need to have health monitoring of the heart at any time and can conduct timely diagnosis and treatment in a more critical situation. Long-term living in the hospital for monitoring and treatment, which is costly and also brings a lot of outpatient pressure to the hospital. The electrocardiograph is one of the important instruments for diagnosing heart disease. There are many electrocardiographs on the market, but these electrocardiographs are not suitable for use in the home. To this end, a design scheme for a low-power household electric drawing machine that can be applied in a home, is simple to operate, and is inexpensive, has emerged.

As we all know, with the advancement of science and technology and the development and progress of human society, the development of medical instruments around the world is changing with each passing day. The 21st century medical industry mainly presents the following two characteristics: First, the future medical world, the main representative products are nano-mechanical components, portable wear-type chemical sensors, home health care medical equipment. Second, information and medical technology are closely integrated. The design of the home ECG machine is in line with these two major trends. In addition, from the outbreak of the SARS virus, it can be expected that it will promote the development of medical equipment for home health care applications. Therefore, the home electrocardiograph is a new type of product at home and abroad, which has great potential for market development.

Second, function and basic principles

(1) Overall design

In order to achieve "health monitoring" and "family clinic" of the heart, the home electrocardiograph has the following basic functions:

* Real-time display of ECG waveforms and work menus using a liquid crystal display system;

* Use the external memory to save the ECG information that needs to be stored for future reference.

* Use the printer to print the ECG print;

* Can organize and save the user's record information;

* Multiple operating modes, automatic, manual operation can be arbitrarily selected;

* It is convenient to transmit ECG signals collected from the human body to relevant medical institutions.

Taking into account the needs of the user's actual use, the home ECG machine must also meet the following characteristics:

* Strong anti-interference ability;

* Small size, light weight and easy to carry;

* easy to use;

* Low power consumption;

* In order to be widely used, the production cost is low, and there must be a better performance price ratio.

The home ECG machine uses dry battery power supply, and a basic contradiction that needs to be solved for dry battery power supply is that low power consumption requires the system to use a relatively low clock frequency while at the same time requiring the system to quickly react and start up for some basic operations. The system is required to have at least two different frequencies, and the two frequencies can be switched if necessary. Because the MSP430 F135 has a rich and flexible clock module, the system selects it as the control core, and at the same time selects the low-power external memory AT29LV1024 and the liquid crystal display module LMS0192A.

The MSP430 from Texas Instruments is a highly integrated, high-precision single-chip system that is the industry's lowest power flash 16-bits RISC microcontroller. The MSP430 F135 has powerful processing functions and a wealth of peripheral modules for easy collection, processing, storage, printing and transmission of ECG signals. In addition, as the control core of the system, it can greatly simplify the entire hardware circuit and improve the cost performance of the system.

The ECG signal is collected from the human body by electrodes or lead wires. After amplification and filtering, it enters the MCU for A/D conversion and sends the LCD display. If you need to store, the ECG data will be stored in the external memory after pressing the store button, and you can call it directly from the external memory when you need to play back, print, and transfer, and then implement various functions. The data monitored by the home electrocardiograph can be directly transmitted to the relevant medical institution by using the network or the telephone, and after being diagnosed and processed, the medical institution can feedback back, thereby conveniently and efficiently implementing the “family clinic” and the “health monitoring”. Saving user expenses and relatively reducing the outpatient pressure of the hospital. This system uses the circuit structure shown in Figure 1.

(2) Detection and collection of ECG signals

The ECG signal required for home ECG is between 0.05 and 4 mV and the frequency is between 0.05 and 72 Hz. The main interference signals in the detection include the polarization voltage between the electrode plate and the human body, the 50 Hz power frequency interference, the internal noise of the instrument and the electromagnetic field electromagnetic field around the instrument. The 50Hz power frequency interference in the ECG signal can be eliminated by the adaptive template method, and the analog part of the electrocardiograph can adopt the hardware structure as shown in FIG. 2. After the ECG signal is collected through the electrode or lead wire, voltage amplification is required first. The voltage amplifier is generally composed of two stages, and the front stage uses a negative feedback differential amplifying circuit. In the system, TI's micro-power instrumentation amplifier INA321 chip based on dual op amp circuit is used as the preamplifier of ECG signal, and the magnification is 10 times. Since the interference signal above 72 Hz is strong and the interference signal below 0.05 Hz is relatively weak, in the filter circuit, the low-pass filter is used to take out the signal below 72 Hz, and then connected to the high-pass mode, so that the polarization voltage can be filtered out. The signal gets an ECG signal. Since the RC high-pass filter circuit is used in the previous filter circuit, the circuit has a high output impedance, so the post-stage amplification uses a non-inverting amplifier circuit with a magnification of 20 times.

The highest amplitude of the ECG signal is 4mV, and the amplification is 0.8V after 200 times, and the input range of A/DC is 0~2.5V. The intermediate value is 1.25V as the reference during design, so the amplified ECG signal is superimposed. The reference voltage is 1.25V and the size is (1.25±0.8)V, which falls within the analog input signal range of A/DC. At the same time, the frequency of the ECG signal is between 0.05 and 72 Hz. In order to ensure the requirements of the sampling theorem and ensure the conversion rate, the sampling rate fs = 200 Hz can be selected. The MSP430 F135 comes with a high-speed 12-bit successive approximation ADC12 with internal reference voltage, sample-and-hold and auto-scan functions. It has 8 external channels, 4 internal channels, up to 200KHz sampling rate, and multiple sampling modes. fulfil requirements.

(three) single chip system - MSP430 F135

Based on the functions, price, power consumption and the actual needs of home ECG design, this system selects the ultra-low-power microprocessor MSP430 F135 with 12-bit ADC as the control core of the system. It is TI 2000. The ultra-low-power Flash 16-bit RISC instruction set microcontroller introduced at the end of the year. It has a rich on-chip periphery and is a very cost-effective microcontroller. Using it for the collection and processing of ECG signals not only greatly simplifies the system hardware circuit, but also greatly improves the cost performance of the system. The structural principle of MSP430 F135 is shown in Figure 3.

According to the structure schematic, the MSP430 F135 includes 16KB Flash and 512B RAM, and also has the following peripherals: basic clock system (on-chip DCO and two crystal oscillators), watchdog timer / general purpose timer 16-bit timer TImer_A with 3 capture/compare registers 3 and PWM outputs, 16-bit timer TImer_B3 with 3 capture/compare registers and PWM outputs, I/O ports 1 to 6 (each with 8 I /O, where ports 1 and 2 have interrupt functions), comparator_A, 12-bit A/D converter ADC12, universal serial synchronous/asynchronous interface USART0.

The MSP430 F135 includes a 12-bit high-performance A/D converter with eight external channels, a 16-word programmable buffer with auto-scan capability, on-chip reference voltage, a temperature sensor, and battery low-voltage The detection circuit, the speed of the A / D converter can be as high as 200KHz. Using the on-chip auto-scan feature, the A/D converter can work independently without the assistance of a central processor and automatically store the converted data in a buffer. In this way, the workload of the central processing unit is greatly reduced. In other words, the processor can be executed to perform other digital signal operations or enter a power saving mode of operation. In addition, the built-in reference voltage and temperature sensor can reduce the number of external components and reduce the overall cost of the system. After the ECG signal is amplified by 200 times, it enters the A/D converter via port 6 for analog-to-digital conversion. The result of the conversion is automatically stored in the register of the corresponding channel and then sent to the external ECG signal memory.

With built-in fast flash memory with very low power consumption, the MSP430 F135 consumes less power in standby mode than the natural loss when the battery is not in use. In addition, it can be immediately switched from standby mode to full operation mode within 6ms, because the device does not waste any time during startup, thus extending battery life. Under normal operating conditions, if the operating voltage is 2.2V, the current consumed by each MIP of the device is only 250μA.

The MSP430 F135 has an on-chip Flash ROM, which brings great convenience to the user's development and debugging. Most of the current development environments use IAR's WINDOWS WORKBENCH software, which is accompanied by the development kit MSP-FET430P140 provided by TI. The functions that can be realized are program download, update, operation and debugging. FLASH programming is realized by JTAG control in the PC environment, and three breakpoints can be set for full-speed debugging controlled by on-chip emulation logic. The user can download and debug the program by taking the JTAG lead to the debug device on his target board.

The MSP430F135's basic clocking system includes an on-chip DCO and two crystal oscillators that can generate three system-compatible clock signals: ACLK, MCLK, and SMCLK. Among them, the main system clock MCLK is used for the CPU and the system, and the auxiliary clock ACLK and the subsystem clock SMCLK are used for the peripheral modules. Through the intelligent management of different module operation modes and CPU states, the MSP430 F135 can work in a variety of ultra-low voltage and ultra-low power requirements, even during interrupt processing. An interrupt event can be used to Wake up from various low-power modes and return to the previous working state of the interrupt by the RETI instruction. Here are six ways to work with the MSP430 F135 chip:

1) Active mode (AM): The CPU and different combinations of peripheral modules are activated and active;

2) Low power mode 0 (LPM0): The CPU stops working, the peripheral module continues to work, ACLK and SMCLK are valid, and the loop control of MCLK is valid;

3) Low power mode 1 (LPM1): The CPU stops working, the peripheral module continues to work, ACLK and SMCLK are valid, and the loop control of MCLK is invalid;

4) Low power mode 2 (LPM2): The CPU stops working, the peripheral module continues to work, ACLK is valid, and SMCLK and MCLK loop control are invalid;

5) Low power mode 3 (LPM3): The CPU stops working, the peripheral module continues to work, ACLK is valid, SMCLK and MCLK loop control are invalid, and the DC generator of the digitally controlled oscillator DCO is turned off;

6) Low Power Mode 4 (LPM4): The CPU stops working, the peripheral module continues to operate (if an external clock is provided), the ACLK signal is disabled, the crystal oscillator stops operating, the SMCLK and MCLK loop control are disabled and the digitally controlled oscillator DCO The DC generator is turned off.

As can be seen from the above, the implementation of the ultra-low power performance of the MSP430 F135 is mainly related to its generation and control of the clock. In an ultra-low power design, the CPU is dormant most of the time. The MSP430 F135 has five low-power modes that allow the CPU to enter the appropriate low-power mode after the CPU has completed the appropriate setup or task in the main program. Most of the work that the CPU needs to complete is completed in the interrupt service routine. The CPU is used to wake up the interrupt service by the corresponding interrupt, and then enter the low power mode after the execution is completed. Thus, the chip can be controlled by software to different settings of the internal clock system, so that it is in different working modes. The entire clock system provides a rich combination of hardware and software to achieve the lowest power consumption and optimize system performance.

(4) External ECG Data Memory - 1 megabit 3V powered flash programmable electrically erasable 16-bit memory AT29LV1024

The AT29LV1024 is a 3V system powered flash programmable electrically erasable 16-bit memory (PEROM) with 1M bit of memory. The 1M bit of memory is divided into 512 partitions, each with 128 words. The chip is fabricated using ATMEL's advanced non-volatile COMS process with an access time of 150ns over the operating temperature range, at which point the power consumption is only 54mW. When the AT29LV1024 is in the sleep state, the CMOS holding current does not exceed 50μA. Each partition of the AT29LV1024 can be erased more than 10,000 times.

The AT29LV1024 has a power-down protection function. The convenient online programming capability does not require a high input voltage. The command system can control the AT29LV1024 at 3V. Reading data from the AT29LV1024 is similar to the operation of the EPROM. The reprogramming capability is in units of each partition, and 128 words of data are loaded into the AT29LV1024 while programming is completed. In a reprogramming cycle, the addressing of the memory cells and the 128-word data are freed by the internal latch to release the address and data bus, which provides an address and data bus for other operations. The AT29LV1024 automatically erases the contents of the partition at the beginning of the programming cycle, and then programs the latched data under the effect of the timer. The end of the programming cycle is accomplished by polling I/O7 or I/O15 is active. Once the programming cycle is complete, a new read or program operation can begin.

The working principle of AT29LV1024 is shown in Figure 4.

AT29LV1024 is a new type of memory with the following features: (1) 3V ~ 3.6V power supply range; (2) single 3V read and write operations; (3) hardware and software data protection; (4) fast read time: 150ns; (5) Low power consumption: 15mA effective current, 50μA CMOS sustain current; (6) Partition program operation: Erase, program one-way loop mode, 512 partitions (128 words/partition), internal address and 128-word data latch (7) Fast partition programming cycle: 20ms; (8) Internal program and timer control; (9) Query program end; (10) Typical erase, programming can exceed 10,000 times; (11) CMOS and TTL compatible input and output; (12) Available in commercial and industrial temperature range.

In the home single-conducting electrocardiograph, the AT29LV1024 is used as a data memory extended by the MCU to store ECG data. These stored data can be used in real time online or read from the memory when needed. The AT29LV1024's power-down protection feature saves data in the event of an accidental power loss or power down, which not only ensures data availability but also saves power. Since the AT29LV1024 can be used as a program memory as a data memory, the ECG data collected from the human body is stored here. These data are the digital quantities of the ECG signals obtained by the A/D conversion of the MCU. These digital quantities are first stored in the MCU. In the internal RAM, when the internal RAM is full of 128 words, the data is sequentially stored in the external data memory AT29LV1024. When the data needs to be used in the future, it can be read from the AT29LV1024. The AT29LV1024 can store or modify several segments of ECG waveforms at different times, such as the user's daily case for future reference. When the data needs to be updated, the stored data can be updated by electrical erasure to re-storage the new ECG data.

Since the reprogramming capability from the AT29LV1024 is in units of each partition, 128 words of data are loaded into the AT29LV1024 while programming is completed. It is 128 words per operation, 128 words per storage and update. And each time you need to perform an initial operation before sending 128 words of data, the program is as follows:

MOV A, #AAAAH

MOV DPTR, #5555H

MOVX @DPTR, A

MOV A, #55H

MOV DPTR, #2AAAH

MOVX @DPTR, A

MOV A, #A0A0H

MOV DPTR, #5555H

MOVX @DPTR, A

The application of AT29LV1024 in the system enables users not only to quickly realize the required functions, but also the way of electric erasing provides convenience for the storage and update of programs and data, especially the function of power-down protection can be accidentally powered down or turned off. In the case of power supply, data is saved, ensuring the reliability of storage and reducing power consumption. It is a function not used in RAM in the past, and it is very convenient for storing ECG data, such as A/sampled from human body. The D value can be stored in the AT29LV1024 at any time for recall during playback, printing, and transmission.

(5) Liquid crystal display system--LMS0912A liquid crystal display module

The LMS0192A liquid crystal module is a small liquid crystal system with an external dimensions of 79 x 42 mm and 44 pins. The 160×64 dot matrix display has a dot size of 0.30×0.34 (mm) and a dot pitch of 0.34 × 0.38 (mm). The internal large-scale integration with driver and controller, directly controlled by the microcontroller, can display data while receiving 8-bit serial or parallel display data, and store the data in on-chip data memory (DDRAM) . The data display unit in the DDRAM has a one-to-one correspondence with the dot matrix unit of the liquid crystal screen, and the read and write operations of the LMS0192A liquid crystal module data are not controlled by the external clock, so the display of the LMS0192A has high flexibility. The LMS0192A liquid crystal module has a power supply driver circuit necessary for the liquid crystal, so that the function of the module can be realized with a minimum of components and minimum power consumption.

The LMS-0192A liquid crystal display module is used as a display for menus and electrocardiogram waveforms in a miniature home electrocardiograph. It uses MSP430 as the microprocessor of liquid crystal, collects and processes ECG data through MCU, and outputs it to liquid crystal display.

1. Display of Chinese character menu: The menu is mainly composed of Chinese characters. Each Chinese character can be converted into a 16×16 dot matrix and a total of 32 hexadecimal data is sent to the liquid crystal display through the Chinese character font. The data of each Chinese character corresponds to a data table, and the program can display Chinese characters by means of table lookup.

2. ECG waveform display: ECG waveform is a series of curves. To display these curves on the LCD, you need to display the corresponding dot matrix. For an ECG curve, the initial display data point only shows a little in the starting column. The second data point begins with the next column showing the line segment from the previous data point to the current data point. The specific method can obtain the quotient and the remainder by dividing the hexadecimal data by the total number of pages 8. The obtained quotient is the page where the data point is located, and the obtained number of rows of the page where the data point is located. Note that each data point should be in the corresponding column, because the column address is automatically incremented by one for each data sent, so each time you read data from DDRAM, you must ensure that the column position is correct, otherwise the curve will be confused. In this way, the LMS-0192A liquid crystal module is used to print the ECG waveform or read the information directly from the LCD to provide a basis for diagnosis.

3. The procedure for LCD initialization is as follows (before the module is used, the /RES signal must be sent to the pin/RES. After the /RES signal is sent, the module can automatically set the default value.):

MOV DBUS, #0ABH ; internal crystal oscillator is on

MOV DBUS, #02FH ; Provisioning circuit control, this module is typically 02FH

MOV DBUS, #024H ;V5 voltage regulation internal resistance ratio, can be adjusted according to the user

MOV DBUS, #081H ; Electronic control setting, use with two statements

MOV DBUS, #018H ;Preset contrast adjust this value to adjust LCD contrast

MOV DBUS, #0A2H ; set LCD bias ratio, 1/7 bias

MOV DBUS, #0A0H ; ADC selection, set column forward output

MOV DBUS, #0C0H ;COMMON output status selection, set the scan direction is normal

; if ADC=1, please select the reverse

MOV DBUS, #0AFH ;display on

(6) Telephone transmission of ECG signals--Pulse width modulation method

In the home electrocardiograph, a pulse width modulation telephone transmission function is provided. The basic principle of pulse width modulation is adopted here, and an improved pulse width modulation method is proposed according to actual needs, which makes the hardware and software methods of pulse width modulation and demodulation simple, and the distortion after signal demodulation is small, which can realize fast Telephone transmission. The main principle is shown in Figure 6. The user can transmit the ECG signal-driven speaker stored in the home ECG machine to the hospital via the telephone network after being at home or at any place with a telephone. The receiving system of the hospital is amplified and filtered, and the pulse waveform is generated by the comparator. After the waveform enters the single-chip microcomputer, the sampling value represented by each pulse is calculated by the program, and then the sampling value obtained by the single-chip microcomputer is sent to the computer by serial communication, the computer The ECG waveform is reproduced by the VC++ program.

Send part

The MSP430 F135 stores the ECG's 12-bit A/D sample value in an external data memory, fetches it from the external RAM when a telephone call is required, and takes the lower 10 bits to control the timer to produce a pulse whose width varies with the sample value. This pulse can be regarded as a pulsed signal that has been sampled and modulated (Fig. 7, where τ1 is the pulse width corresponding to the first sampled value, and T1 is the pulse period of the first sampled value. Similarly, τ2 is the second one. The pulse width corresponding to the sampled value, T2 is the pulse period of the second sample value), such a pulse-driven speaker is sent to the hospital over the telephone network. The frequency range of the telephone transmission signal is 300-1300 Hz, and the sampling time corresponding to 300 Hz should be 1.667 ms=1667 μs, corresponding to the timer timing value τ'=0682H, the timer TH0TL0=F97DH (timer 0 counting), 1300 Hz Then, the timing value τ'=0180H of the corresponding timer, and the timer TH0TL0=FE7FH (timer 0 counts up). Therefore, the timing value of all sampled values ​​is 0180H "τ' "0682H. Since the sampled value may be zero, the base value of 0200H ("0I80H) is added to the sampled value, so that the 10-bit sample value is used, and the maximum is 03FFH. The minimum is 0000H, and 0200h ≤ τ' ≤ 05FFH after the base value is within the allowable range of τ', so that accurate and distortion-free transmission is possible.

2. Receiving part

The miniature home electrocardiograph is equipped with a receiving system. After receiving the signal, the speaker BEEP is composed of a dual-op TL062 to form a low-pass filter with a cutoff frequency of f=1/2ΠC1R2=1300Hz and a magnification of 3.3×106/100×103=33. The second stage of the TL062 constitutes a comparator, so that the input signal passes through the comparator and becomes a pulse square wave of varying width. Each changed pulse width represents a sampled value of the received electrocardiogram signal, and the pulse wave passes through the single chip microcomputer and passes through the microcontroller. The calculation restores the ECG sample value.

(7) Menu interface and keyboard interface

In the home electrocardiograph, four buttons are provided for the user to operate, corresponding to the relevant menus on the liquid crystal display. The menu includes: welcome menu, main menu, secondary menu and other three levels, all provided by the liquid crystal display. Each level of menu provides a simple prompt for the user to use, so the user can press the button (there are four keys A, B, C, D) at the prompt of the menu to complete the required operation. For example: the main menu is shown in Figure 9:

This machine adopts a separate button, which directly forms a single button circuit with I/O port lines. Each button occupies an I/O line separately, and its working status does not affect the working status of other I/O lines. Since the ports 1 and 2 of the MSP430 F135 both have an interrupt function, a separate button circuit of the interrupt mode can be used, and the circuit connection is as shown in FIG. 10:

Since each button is connected to the LCD menu during use, so that different functions must be implemented on a single button, a simple stand-alone button circuit cannot meet the design requirements. Here, soft button polling must be used. technology. Softkey polling is a new user interface technology for combining menus and buttons. This technology allows the user to make multiple choices on a single function key. That is to say, each button can be associated with a command menu or a parameter menu, and the user can select the desired command by pressing a suitable button (such as a cursor button), that is, using the button nesting method to make the same button Implement different functions.

Third, the summary

The electrocardiograph is one of the important instruments for diagnosing heart disease. There are many electrocardiographs on the market, but these electrocardiographs are not suitable for use in the home. The miniature home ECG machine is designed for the majority of users. It is small in size and easy to carry, making it easy to use outside the door. The operation is simple, the function is complete, the price is low, the power consumption is low, the cost performance is high, and the utility model is suitable for popularization and application in the majority of households, and thus will bring convenience for people's timely and local cardiac monitoring and health care.

The outstanding feature of the miniature home single-lead ECG is low power consumption and good performance. The difference from other ECG machines is that the system uses the new low-power 16-bit microcontroller-MSP430 F135 as the control core of the whole system. Due to the powerful MSP430 microcontroller, the hardware circuit designed by this system is quite different from the previous one. The MSP430 F135 has a wide range of peripheral modules, making it easy to capture, process, store, print, and transmit ECG signals, greatly simplifying the entire hardware circuit.

references

1.Teaxs Instrument, Inc., MSP430 F135 User's Manual, 2001

2.Teaxs Instrument, Inc., MSP430 F13X/14X Data's Manual, 2001

3.Teaxs Instrument, Inc., MSP430 WINODWS WORKBENCH Interface Guide, 2001

4.AT29LV1024A, Atmel Corporation, 2001

5. Li Sufen, Li Gang, Digital Pulse Width Modulation Method for Telephone Transmission of ECG Signals, Journal of Electronic Measurement and Instrument 2002 Supplement, 1457~1460

6.Topway, Inc., LMS0192A LCD Module User Guide, 2002

7. Cai Jianxin, edited by Zhang Weizhen, Biomedical Electronics, Peking University Press, 1997

8. Wang Baohua, editor, Biomedical Electronics, Higher Education Press, 1998

9. Sun Hanfang, Xu Aiqing, Principles and Applications of Single Chip Microcomputer, Beijing University of Aeronautics and Astronautics Press, 1988.

10. Biomedical Engineering Handbook (US) J. Klan (Jacob) edited by Xu Zhenyao, Tianjin Science and Technology Translation Publishing, 1993

MC Plus series Indoor LED Light Box  


1. Indoor Led Screen Display with price Advantage: We have the best competitive price in the market, we also have the same or even better quality.
2. Indoor LED Light Box with quality advantage: From material to finished product, from design to production, we control all processes.
3. Indoor Led Screen Display service advantage: We also provide best service after sales and we prioritize every customer's needs.
4. We ensure that our Indoor Led light box are CE certified, ROHS compliant, FCC identified and passed the system of ISO 9001.

5. Poster Led Screen Display With specially designed fast lock system, easy to install and dismantle

6. The new structure design enables Led Advertising Display diversified installation to meet the hanging-up and stacking requirements.
7. Full Color Led Screen Display with High contrast rate up to 5000:1 by using black LED

8. Led light box with high refresh rate with NOVA control system, no scan line when photographed.

Indoor LED Light Box

Indoor LED Light Box,LED Slim Light Box,LED Commercial Light Box,Indoor LED Frameless Light Box

Shenzhen Macion Optoelectronics Technology Co.,Ltd. , https://www.macion-led.com

This entry was posted in on