Design of Remote Diagnosis and Emergency Support System Based on C8051F021

Publisher:chaohuangmeitaoLatest update time:2012-06-15 Source: 21IC Keywords:C8051F021 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

With the development of multimedia technology, computer network and communication technology, telemedicine has become a rapidly developing interdisciplinary high-tech technology in the world. Remote diagnosis and emergency support system is an important branch of telemedicine. With this system, various vital information of patients at the emergency scene can be transmitted to doctors at a remote location, so that they can receive medical guidance or diagnosis and treatment in a timely manner. This is of great significance for patients to obtain high-level medical services and emergency support in emergency situations [1].

The acquisition and transmission of the patient's physiological parameters is an important part of the system. For this purpose, the author designed a multi-physiological parameter acquisition and wireless transmission device with the SOC chip C8051F021 of the American CYGNAL company as the central control unit. The device consists of a physiological parameter acquisition part and a real-time wireless digital transmission human-machine interface. These two parts are made into a small device that the patient can carry conveniently on the body to continuously and dynamically monitor the patient's body temperature, blood pressure, blood oxygen, pulse, electrocardiogram and other physiological parameters, and send these parameters wirelessly to a computer connected to the network, and then transmit them to a remote consultation center after processing. Using this remote diagnosis and emergency support system, experts at the consultation center can understand the patient's condition and promptly guide the on-site rescue personnel to implement appropriate rescue measures for the patient.

1 Hardware Design

The multi-physiological parameter acquisition device based on C8051F021 includes five parts: ECG module, blood pressure module, blood oxygen module, body temperature module and wireless data transmission module. The coordination of each part and the wireless transmission of data are managed by the main microcontroller C8051F021. The main microcontroller is the core of the system, which completes the detection of body temperature and ECG parameters, is responsible for controlling other modules and exchanging data with them, and also controls the wireless transmission of physiological parameters. Therefore, there are high requirements for its operating speed and interface functions.

C8051F021, with its fast speed and high performance, can ensure the real-time requirements of ECG signal detection and processing. In addition, its rich port resources can meet the needs of various serial communication interfaces required in the structural design of each module. Among them, the body temperature module communicates with the microcontroller in two directions through a single-wire interface; the blood pressure module transmits the collected parameters to C8051F021 through high-speed serial communication; the blood oxygen module transmits the detected parameter results to the microcontroller through UART; the wireless transmission module also transmits data through the serial port of the microcontroller. The A/D conversion, D/A conversion and serial port built into C8051F021 save a lot of peripheral circuits for system design and greatly reduce the volume. Its framework diagram is shown in Figure 1.

1.1 Introduction to C8051F021

C8051F021 is a 3-bit microprocessor launched by CYGNAL Corporation of the United States. Its most prominent feature is its high-speed instruction processing capability [2, 3]. C8051F021 uses the CIP-51 microcontroller core and is fully compatible with MCS-51 instructions. CIP-51 adopts a pipeline structure, which greatly improves the instruction execution speed compared to the standard 8051 structure. When CIP-51 works at the maximum system clock frequency of 25MHz, its peak speed can reach 25MIPS.

In addition to the digital peripheral components of the standard 8051, the C8051F021 also integrates analog components and other digital peripherals and functional components commonly used in data acquisition and control systems. The chip integrates multi-channel 12-bit and 8-bit A/D converters and a dual 12-bit D/A converter, two enhanced UART serial ports, which facilitate the acquisition, control and communication transmission of analog and digital quantities. The microcontroller also integrates 4KB internal data RAM and 64KB Flash and external 64KB data memory interface (programmable to multiplex and non-multiplex), bus interface, voltage comparator, temperature sensor and other components. It has more timers, counters, interrupts, and digital I/O interfaces than conventional 51 microcontrollers. The chip is also equipped with a standard JTAG interface (IEEEll49.1). With the support of the host computer software, the MCU installed in the final application system can be debugged directly through the serial JTAC interface in a non-invasive, non-resource-consuming, full-speed online system. No programmer or emulator is required. It is one of the most powerful MCUs with the best performance-price ratio at present [4].

1.2 Implementation of communication between each module and the microcontroller After completing the corresponding register settings of ADC0, timer 3 is used to set the ECG sampling time interval, and the ECG sampling frequency is set to 360Hz. When timer 3 overflows and interrupts, ADC0 is started to start conversion. The ADC0 control register ADC0CN.5 is used to determine whether the conversion is completed. After the conversion is completed, the sampling result is automatically stored in the lower 4 bits of ADC0H and ADC0L. Read the 12-bit ECG data and suppress the baseline drift in the ECG signal through the adaptive algorithm to obtain a stable ECG signal.

1.2.1 Temperature measurement part

The temperature measurement system is constructed using the DS18B20 temperature sensor. DS18B20 is a single-wire digital temperature sensor produced by DALLAS, USA. It can directly convert the temperature signal into a serial digital signal for processing by the microcontroller. The DS18B20 digital thermometer can provide 9-bit temperature readings and communicate bidirectionally with the I/O port P1.0 of the C8051F021 through a single-wire interface. The power for reading, writing and temperature conversion comes from the data line without the need for an additional power supply.

1.2.2 ECG

After preamplification and secondary amplification, the ECG signal is sent to the A/D converter of C8051F021 for sampling.

The C8051F021 chip integrates two multi-channel ADC subsystems (each subsystem includes a programmable gain amplifier and an analog multiplexer). ADC0 is selected to perform A/D conversion on the ECG signal. The ADC0 subsystem includes: a 9-channel configurable analog multiplexer (AMUX0), a programmable gain amplifier (PGA0) and a 100ksps 12-bit resolution successive approximation register ADC. The ADC also integrates a track-and-hold circuit and a programmable window detector. All these features are completely controlled by CIP-51 through special function registers. The settings for ECG signal sampling are as follows: (1) Set the AMUX0 configuration register AMX0CF = 0x00; make AIN0 ~ AIN7 independent single-ended inputs. (2) Set the AMUX0 channel selection register AMX0SL = 0x00; select AIN0 as the analog input of ADC0, that is, the collected ECG signal is input into the C8051F021 from the AIN0 analog channel. (3) Set ADC0 configuration register ADC0CF = 0x48; the number of cycles of the analog signal input by the ACD0 sample/hold amplifier is 1/10 system clock, and the internal amplifier gain is 1. (4) Set ADC0 control register ADC0CN.0 = 0; the data of ADC0H and ADC0L registers are right-aligned; ADC0CN.7 = 1; the ADC is active and ready to convert data. (5) Set EIE2.1 = 1; ADC0 conversion interrupt is enabled.

1.2.3 Blood Pressure Module

The blood pressure module and the microcontroller use a high-speed serial communication method. The working status and measurement results of the blood pressure module are output through two function pins for the microcontroller to process. These two function pins are connected to the two I/O ports of C8051F021, where the output serial clock line is connected to I/O port P1.2, and the output serial data line is connected to I/O port P1.3. If a voltage jump from high to low appears on the data line within a clock cycle, data reception begins.

The output data format is shown in Figure 2. The voltage jump at the start is shown in Figure 3. The start indicates that 16 bits of data will be transmitted in the following 16 clock signals. The upper 4 bits of data indicate the data type. Different codes indicate different data. For example, diastolic pressure, systolic pressure and heart rate have their own codes, as shown in Table 1. The lower 12 bits of data indicate specific values. Corresponding to the previous data types, the data of systolic pressure, diastolic pressure and heart rate can be obtained. [page]

Table 1 High-speed serial communication data frame 16-bit data definition

D15~D12 D11~D0
0 0 0 0 Real-time pressure 0~300
0 0 0 1 Systolic blood pressure 60-280
0 0 1 0 Diastolic blood pressure 40-200
0 0 1 1 Heart rate 40-200
0 1 0 1 Self-test signal
1 1 1 0 Measurement error

1.2.4 Blood oxygen module

The blood oxygen module transmits the measurement results through the RS232 serial interface. This system uses UART1 of C8051F021 to exchange data with the blood oxygen module, and assigns UART0 to the wireless transceiver module.

First, the main microcontroller C8051F021 completes the dynamic allocation of digital resources by setting the values ​​of the priority crossbar decoders XBR0, XBR1 and XBR2. The priority crossbar decoder can allocate the pins of ports P0 to P3 to the digital peripherals (UART, SM-Bus, ICA, timers, etc.) on the device in order of priority.

Secondly, to realize the communication between C8051F021 and blood oxygen module, the following register configurations need to be completed: (1) Initialize the cross switch configuration register XBR2, the initial value is 0x44; enable the cross switch and UART1 respectively; (2) Initialize the port 0 output mode register P0MDOUT, the initial value is 0x05; assign P0.2 and P0.3 to TX1 and RX1 respectively; (3) Complete the setting of UART1 working mode and baud rate. The serial port of the blood oxygen module works in mode 1 and the baud rate is 9600bps. Timer 2 is used to complete the setting of the corresponding baud rate of UART1.

1.2.5 Transmission of physiological parameters

In order to facilitate patients to carry and doctors to use, the wireless transceiver chip nRF401 is selected to complete the wireless transmission of physiological parameters. The single-chip transceiver chip nRF401 integrates functional modules such as high-frequency transmission, high-frequency reception, PLL synthesis, FSK modulation, FSK demodulation and multi-channel switching. It works in the ISM international public frequency band and can perform wireless data transmission at a maximum speed of 20kbps [5]. The microcontroller only needs to perform simple control on nRF401 to complete data transmission and reception through the serial port. The wireless communication system composed of nRF401 and C8051F021 is shown in Figure 4.

The setting of UART0 of C8051F021 is similar to that of UART1. First, initialize the cross switch registers XBR0=0x04 and XBR2=0x40; enable UART0 and cross switch respectively; then initialize the special function register P0MDOUT=0x01; assign P0.0 and P0.1 to TX1 and RX1 respectively; because UART0 has the highest priority, when UART0EN is set to 1, P0.0 and P0.1 are always assigned to TX1 and BX1; finally, complete the setting of UART0 working mode and baud rate.

In order to send the collected physiological parameters to the receiving system, before sending the data, the chip is first powered on (i.e. PWR_UP=1), and then the data transmission channel is selected. nRF401 has two transmission channels to choose from: channel 1 (433.92MHz) and channel 2 (434.33MHz). Set the TXEN pin to high level (transmit mode), and nRF401 can send data through the serial port of the microcontroller.

2 System Software Design

The system software mainly completes the collection and wireless transmission of physiological parameters with C8051F021 as the core. Since multiple different modules need to be processed, the patrol detection method is adopted in the implementation process. During the data transmission process, a physiological information packet protocol is set up. The communication protocol package is defined between the acquisition system and the wireless transmission module as shown in Table 2. The serial port reassembles the 2 bytes of data received continuously according to the protocol rules. Since physiological data (ECG, blood pressure, body temperature, etc.) generally does not exceed 12 bits, the acquisition system splits them into the lower 7 bits and the upper 5 bits for transmission. Among them, the first high bit is the high data identifier, which is set to 0; the first low 8 bits is the low data identifier, which is set to 1.

Table 2 Serial communication protocol package

1bit 2bit 5bit 1bit 7bit
B7 B6 B5 B4 B3 B2 B1 B0 B7 B6 B5 B4 B3 B2 B1 B0
0 type data 1 data

Table 3 Specific identification methods of each parameter

B6 B5 B4 B3
0 0 ECG parameters (12 bits)
1 0 0 0 Blood pressure parameters (systolic pressure)
1 0 0 1 Blood pressure parameters (diastolic pressure)
1 0 1 0 Heart rate
1 0 1 1 body temperature
1 1 0 0 Blood saturation

In order to identify different physiological parameters, different signal identifiers are set for different physiological signals for corresponding frame encoding. ECG data is identified by the high 8 bits B6B5, and other types of data are identified by the high 8 bits B6B5B4B3. The specific identification methods of each parameter are shown in Table 3. The encoded data is wirelessly transmitted through the UART0 of the microcontroller and nRF401. The UART0 of the microcontroller is set to working mode 1, and the baud rate is 9600bps.

The system software adopts modular programming method, and divides the system program into six basic modules according to the function: system initialization module (including C8051F021 microcontroller I/O port setting, register and variable definition), body temperature module, ECG module, blood pressure module, blood oxygen module and wireless transmission module. The flow of system software is shown in Figure 5.

Keywords:C8051F021 Reference address:Design of Remote Diagnosis and Emergency Support System Based on C8051F021

Previous article:Introduction to the method of expanding the ultra-large capacity Flash memory of C8051F
Next article:Design and implementation of signal generator based on FPGA and 51 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号