1550 views|0 replies

3836

Posts

19

Resources
The OP
 

Design of low power portable electrocardiograph based on MSP430 [Copy link]

Electrocardiogram is one of the important tools for diagnosing heart diseases. It is currently widely used in hospital clinics and is of great help to doctors in diagnosing diseases. Although traditional electrocardiograms can effectively monitor electrocardiograms and reduce the mortality rate of patients with heart disease, they cannot monitor patients in real time for a long time, and they have the disadvantages of large size, high power consumption, and inconvenience in carrying. In view of this, this paper designs a portable electrocardiogram with simple structure, stable performance, and reliability. It can monitor electrocardiograms in real time at home, in the wild, and has broad application prospects.

1 System hardware structure and principle

The low-power portable ECG instrument consists of MSP430F169, ECG signal acquisition and conditioning circuit, LCD display module, data storage module, key input module, etc., as shown in Figure 1.

The ECG signal obtained by the electrodes connected to the human body in the standard lead mode I must be amplified, filtered and conditioned by the analog amplifier circuit before entering the MSP430F169 microcontroller because of various interferences in the environment (myographic interference of the human body itself, external power frequency interference, etc.). The analog signal is converted to digital using the A/D module inside the microcontroller, and then the data is stored and displayed on the LCD screen. The observer can intuitively see the ECG signal waveform and the number of heartbeats per minute. The system uses an SD card to store the collected data. The collected ECG signal data can be stored for a long time, which is of great value for patients with abnormal and sporadic ECG signals. The system can also transmit the collected ECG signals to the host computer in real time through the serial port, which is displayed and analyzed in real time by the host computer.

1.1 Microcontroller

The microcontroller uses TI's MSP430F169 microcontroller, which is a low-power microcontroller. When all devices are working in low-power mode, the total power is less than 1 W. The power consumption in RAM data retention mode is only 0.1 μA, and the power consumption in active mode is 250 μA/MIPS. It is particularly suitable for portable devices. The chip integrates a 12-bit A/D conversion module with 4 conversion modes and a maximum conversion speed of 200 Kb/s, which is sufficient to meet the requirements of ECG acquisition [2].

1.2 ECG signal conditioning circuit

ECG signal conditioning circuit is one of the important links of this system, which is mainly composed of preamplification, high-pass filtering, 50 Hz notch, low-pass filtering and post-amplification circuit, as shown in Figure 2. Because the surface ECG electrocardiograph is generally only 0.05 mV~5 mV, it is weak and susceptible to interference. Therefore, a differential amplifier circuit with high input impedance and high common mode rejection ratio is used for preamplification to increase input impedance and reduce common mode signal interference; the bandpass filter circuit is mainly composed of high-pass filter and low-pass filter, with a passband of 0.5 Hz~100 Hz, to filter out interference signals outside the ECG frequency range; the 50 Hz notch processor filters out power frequency interference; the post-amplifier further amplifies the ECG signal by about 100 times to a suitable range, and then outputs it to the A/D module of the core controller MSP430F169.

1.3
Data Storage Module

In this system, SD card is used to store the collected ECG signal data. SD card is a memory card with small size, large capacity, high cost performance and simple access interface. It has the characteristics of low power consumption and non-volatility. It is widely used in portable devices such as digital cameras and mobile phones. Using SD card, ECG data can be transmitted to a more powerful PC for further analysis and processing. Its interface circuit is shown in Figure 3. Among them, DAT0~DAT3 are data lines, CMD is the command line, CLK is the clock line, which provides clock for the storage module, and CD_SW is used to control the hot plug of SD card.

P1.1~P1.5 of MSP430F169 are connected to 5 independent buttons, 4 of which are used to adjust the period and amplitude of the ECG waveform display, and 1 is used for serial port data transmission.

2 Software System Design

The system software was developed and debugged on the IAR430 development platform. IAR430 is a development software designed specifically for TI's MSP430 microcontroller. It provides almost all functions such as project management, program editing, code downloading, and software and hardware debugging [3].

The system flow chart is shown in Figure 5. First, the system is initialized (including the initialization of the watchdog, system clock, I/O port, UART1, ADC12, TimerB and LCD). After the general interrupt is turned on, the system enters the main loop. When the data collected is full of one screen, the ECG waveform is refreshed and displayed in the main loop; when the data is less than one screen, it enters a low power consumption state. A/D acquisition uses interrupt mode, the sampling frequency of the system is controlled by a timer, and the 5 independent buttons use interrupt mode, and the button jitter is eliminated through software delay.


2.1 Low power consumption design

Since the MSP430 microcontroller is designed for low power consumption, the program part of this system is designed according to its low power consumption scheme. Except for the necessary steps such as ECG waveform display and erasure, which are run in the large loop, the rest (including A/D conversion program, timer sampling frequency, and keystrokes) all use interrupt mode and only run when an event is triggered; in the main program design, the ECG waveform display is only run after a screen of data is collected, and the rest of the time it enters the LPM1 low power consumption mode; data storage does not pass through the MCU, and directly uses the DMA module inside the MSP430F169 to realize data transmission. This design method greatly reduces the power consumption of the system [4].

2.2 Design of each subprogram of the system

(1) A/D section

P6.0~P6.7 of MSP430F169 are A/D multiplexed ports. This system uses P6.4, i.e. A4, as the input port of A/D, and adopts single-channel multiple conversion mode. A/D conversion adopts interrupt mode. Only one statement is written in the interrupt subroutine, i.e. turning off the A/D interrupt, and no other operations are performed, so that the maximum sampling frequency of A/D reaches the ideal state. The initialization program of A/D is as follows:
void ADC12_S_S_Init(void)
{ P6SEL|=BIT4;
ADC12CTL0=ADC12ON+REFON+REF2_5V+SHT0_2
+MSC;
ADC12CTL1=ADC12SSEL_0+SHP+CONSEQ_2
+CSTARTADD_4;
ADC12MCTL4=SREF_1+INCH_4;
ADC12IE |=BIT4;
ADC12CTL0 |=ENC+ADC12SC;
}

(2) Timer interrupt part

The sampling frequency of the system is controlled by a timer, and the frequency is scaled by a key. The timer uses the subsystem clock and is divided by 8 (the system clock is 8 MHz). The timer also uses an interrupt method. The interrupt subroutine stores the value after A/D conversion and checks whether a screen of data has been collected. If the full screen is collected, the timer interrupt and A/D interrupt are turned off, and then the full screen flag is set to 1, exiting the low power mode and exiting the interrupt [5]. The interrupt subroutine is as follows:
#pragma vector=TIMERB0_VECTOR
__interrupt void Timer_B (void)
{ results[index]=ADC12MEM4;
index++;
if(index==102)//If a screen is collected
{ index=0;
TBCCTL0 &=~CCIE;//First turn off timer B
ADC12IE &=~BIT4;//Turn off ADC interrupt
collect_a_screen=1;//Full screen flag is set to 1
LPM1_EXIT;//Exit low power mode
}
else ADC12IE |= BIT4;//Turn on ADC interrupt
}

(3) SD card part

The collected data is transferred to the SD card through the DMA module integrated in the MSP430F169. DMA uses channel 0, the trigger mode is ADC12IFG4, and the data is sent by byte. The operation of the SD card is carried out in command mode. All commands are actively sent by the host, and the SD card responds differently according to different commands. The response process is shown in Figure 6.


3 Application and precautions

This system is used to collect human ECG. It has been verified that the ECG waveform of the human body as shown in Figure 7 can be correctly displayed on the LCD screen, and the collected data can be transmitted to the host computer through the serial port or SD card for further display and analysis. It should be noted when designing this system: MSP430F169 turns off interrupt nesting by default, so when interrupt nesting is used, the general interrupt should be turned on first after entering the interrupt subroutine, so that the nested interrupt can be executed; when drawing the ECG waveform on the LCD, the column-by-column method should be used, that is, one column should be drawn after erasing one column, so as to ensure the stable display of the ECG waveform.

Based on the characteristics of a portable home ECG, this paper designs an ECG with appropriate functions, extremely low power consumption and low price suitable for home health care. Compared with the traditional data acquisition system, this system uses a low-power microcontroller MSP430F169. Through low-power design in software design, the system power consumption is greatly reduced. The performance is stable and reliable, the design process is simple, the cost is reduced, and it has a wide range of application value.

image-20200610204816-2.png (34.52 KB, downloads: 0)

image-20200610204816-2.png

image-20200610204916-4.png (122.06 KB, downloads: 0)

image-20200610204916-4.png
This post is from Microcontroller MCU
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list