The embedded multi-parameter monitoring system generally includes multiple independent hardware acquisition modules. Each hardware acquisition module completes the acquisition of physiological parameters such as human electrocardiogram, respiratory rate, body temperature, blood pressure and blood oxygen saturation, receives control information from the HOST end through its serial port, and sends the collected data to the HOST end at regular intervals.
The embedded multi-parameter monitor uses the AT91RM9200 processor on the HOST side, which has four universal synchronous/asynchronous receivers/transmitters (USARTs), one of which is a DEBUG serial port, but they are all time-division multiplexed [1]. In order for the HOST side to better communicate with each acquisition module, the problem of serial port expansion must be solved.
There are two common serial port expansion solutions. One is implemented through hardware, using a multi-serial port ARM/MCU or a dedicated serial port expansion chip. Available serial port expansion chips include the 16C55X series serial port expansion chips developed by TI and the GM812X series serial port expansion chips developed by Guoteng. TI's 16C55X series chips use parallel ports to expand serial ports. They are powerful and have high communication speeds, but they are complex to control and are expensive. They are mainly used for PC serial port expansion. The other serial port expansion solution is implemented through software, but there are disadvantages to using software to simulate serial ports: (1) The sampling frequency is low, generally only 2 times/bit, so the correctness of the data is difficult to guarantee; (2) High baud rate communication cannot be achieved. Software simulated serial ports generally cannot achieve baud rates higher than 4,800 b/s [2-3].
Regardless of whether hardware or software solutions are used, most serial port expansion products are almost one-way transmission and lack transparency [4-7]. Based on the needs of the multi-parameter monitor project in which we participated, this paper proposes a bidirectional transparent serial port expansion design solution, which has been verified by experiments.
1 Hardware Design
1.1 Serial port expansion module topology diagram
In the design, the serial port expansion module can be connected to 4 user devices. Each user device can perform bidirectional data transmission with the HOST end, using time-division multiplexing technology, that is, at any time, only one serial port is connected to the HOST end, and the serial port expansion module is responsible for switching/selecting the 4 channels. Both parties arbitrate through hardware and software mechanisms. As shown in Figure 1.
1.2 Hardware Design
The serial port expansion module mainly consists of two parts: the single-chip microcomputer AT89C2051 and the analog switch CD4052, a dual 4-channel analog switch.
The topological structure diagram of the serial port expansion module is shown in FIG2 , wherein the dotted frame is the main part of the serial port expansion module.
[page]
2 Communication Protocol Design
2.1 Data is sent from the user device to the HOST
Since each module is time-division multiplexed, in order to avoid competition between user devices, AT89C2051 is required to arbitrate the four user device channels. This article adopts the following solution.
Each of the four user devices is connected to the P1.0~P1.3 pins of AT89C2051 with an I/O port line, and is also connected to a 4-input NOR gate. One or several I/O port lines are set to a high level and pass through the 4-input NOR gate to trigger an interrupt, notifying AT89C2051 that a user device has requested to send data to the HOST terminal, and at the same time AT89C2051 queries the user device number. After receiving the request signal, AT89C2051 first determines whether the data transmission between the HOST terminal and other user devices has ended. If it has ended, according to the arbitration mechanism, the P1.4~P1.7 pins connected to each user device are set high to give a response signal. At the same time, AT89C2051 sets the P3.4 and P3.5 pins according to the user device number queried by the interrupt to control the CD4052 analog switch to select the corresponding channel. The user device starts to send data after receiving the response signal; if it has not ended, the interrupt is masked until the data transmission is completed. When the user device finishes sending data, an interrupt will be triggered through a 4-input NOR gate to notify the AT89C2051 that the data transmission is completed. When responding to data transmission requests, multiple user device requests will be involved, so the AT89C2051 needs to perform arbitration. The arbitration mechanism is as follows: the ECG and blood oxygen modules send data at a 50 ms interval, while the blood pressure module needs the HOST to send a start measurement command before sending blood pressure data to the HOST. Therefore, the request for the blood pressure module to send data needs to be set to a higher priority to ensure that the blood pressure data is correctly and timely sent to the HOST, while the ECG and blood oxygen modules are set to low priority and send in turn.
2.2 Data is sent from the HOST to the user device
In order to send the data from the HOST end to each user device in a timely and accurate manner, it is necessary to define a communication protocol between the HOST end and the AT89C2051. The protocol is as follows.
AT89C2051 always monitors the information sent by the HOST terminal. Once it receives the serial port selection command sent by the HOST terminal, as shown in Table 1, it immediately sets the P3.4 and P3.5 pins to control the CD4052 analog switch to select the corresponding channel and control the corresponding LED light for indication. After the serial port is selected, the HOST terminal needs to delay a certain time according to the AT89C2051 instruction execution and analog switch switching time before starting to send data/commands to the corresponding user device. When the HOST end sends data, the user device at the receiving end sends an interrupt end signal to AT89C2051, and its end processing is the same as the end processing of data sent from the user device to the HOST end. If a user device requests AT89C2051 to send data to the HOST end at the same time, the HOST end's request to send data/commands will be responded to first, that is, the HOST end's request to send data/commands has the highest priority.
In this design, the TXD pin of the HOST end is connected to the RXD pin of AT89C2051, so that the serial port receive interrupt of AT89C2051 can communicate with the HOST end. When the HOST end sends data/commands, it first sends the serial port selection command word, and then sends data/commands to control the data collection of the user device, such as the gain size, whether to start blood pressure measurement and other commands.
3. Software Design
The software design is divided into four parts: main function, serial port interrupt service routine, external interrupt 0 and 1 service routine, as shown in Figure 3.
In many cases, serial port expansion is required to meet the needs of system integration of multiple serial port devices. There are many expansion methods, each with its own advantages and disadvantages. The solution proposed in this paper is to use the single-chip microcomputer AT89C2051 to expand the serial port of AT91RM9200. It is based on the low price and small size of the single-chip microcomputer, which can completely replace the general dedicated interface chip. As a truly programmable interface, it can realize two-way communication and make the serial port expansion module transparent. This solution is flexible to use and has better applicability to external user devices than general interface chips. It has been verified by experiments that the design goal has been achieved. Using the single-chip microcomputer as an ordinary interface chip is a new idea with certain enlightenment and practical reference value.
Previous article:Design of remote ECG medical signal monitoring system
Next article:Design of wireless multi-bed ECG monitor based on ARM9
Recommended ReadingLatest update time:2024-11-16 20:33
- Popular Resources
- Popular amplifiers
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Principles and Applications of Single Chip Microcomputers and C51 Programming (3rd Edition) (Xie Weicheng, Yang Jiaguo)
- Semantic Segmentation for Autonomous Driving: Model Evaluation, Dataset Generation, Viewpoint Comparison, and Real-time Performance
- High-speed 3D bioprinter is available, using sound waves to accurately build cell structures in seconds
- [“Source” Observation Series] Application of Keithley in Particle Beam Detection Based on Perovskite System
- STMicroelectronics’ Biosensing Innovation Enables Next-Generation Wearable Personal Healthcare and Fitness Devices
- China's first national standard for organ chips is officially released, led by the Medical Devices Institute of Southeast University
- The world's first non-electric touchpad is launched: it can sense contact force, area and position even without electricity
- Artificial intelligence designs thousands of new DNA switches to precisely control gene expression
- Mouser Electronics provides electronic design engineers with advanced medical technology resources and products
- Qualcomm Wireless Care provides mobile terminal devices to empower grassroots medical workers with technology
- Magnetoelectric nanodiscs stimulate deep brain noninvasively
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- 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
- When using a crystal oscillator, you should pay attention to the relationship between temperature and
- Accelerometer and gyroscope
- Download of Siemens e-book "PCB Manufacturing Process - Optimization through Digital Transformation" has started~
- DP83822I Industrial Ethernet PHY auto-negotiation function and its strap resistor configuration
- 【DIY】Remodeling the mobile phone battery charger
- Modern processors and optimized code performance
- TMS320F28035 ECAN interrupt sending and receiving
- Request X-CUBE-MEMS1 firmware package
- TI CCS compiler download update
- Simple and efficient zero-point acquisition circuit