introduction
Medical data acquisition system can provide medical staff with first-hand data of patients in a timely and effective manner, which helps to strengthen the hospital's modern information management and improve work efficiency. In terms of home health care, it can meet people's needs to know their own and their family's health status in a timely and accurate manner in their fast-paced work and life. In the daily use of the equipment, a good human-machine interface design will also save a lot of time and provide great convenience for equipment users. This article mainly takes LM3S3748 as the core, and uses TFT LCD as the display device of the system, and uses touch screen and handle controller as the control device of the system, and introduces the design method of its human-machine interface.
1 System Hardware Design
The human-machine interface of the system mainly includes TFT liquid crystal, touch screen and handle controller, and its structural block diagram is shown in Figure 1. Among them, TFT liquid crystal has good brightness, high contrast, strong layering and bright colors. Therefore, TFT liquid crystal is a good choice without considering power consumption. The touch screen uses the analog-to-digital conversion chip ADS7843 to sample the data of the touch screen, and then the sampled output value is calibrated to obtain the physical coordinates of the touch screen. The handle controller uses the Modbus protocol and controls the core board through the serial port .
1.1 Control Unit
The control unit of this system can use LM3S3748 from TI, which supports ARM Codex-M3 core with a main frequency of 50 MHz and 128 KByte FIASH, 64 KByte SRAM . It also integrates USB HOST/ DEVICE /OTG, sleep module, orthogonal encoder, ADC, dead zone deletion, temperature sensor , analog comparator , UART, SSI, general timer , I2C, CCP, DMA controller and other peripherals. In addition, the chip also has a driver library that can better meet the system requirements.
1.2 LCD interface Circuit
The LCD can use a 3.2-inch TFT (240×320) 260,000 color screen touch module, which supports
SD card
and DATAFLASH, and supports 16-bit/8-bit mode. The module can realize 180-degree rotation of the display screen, and has a touch screen and touch control chip. The module defaults to i8080 16-bit parallel interface, and can choose 8-bit parallel interface mode. Its LCD interface circuit is shown in Figure 2.
1.3 Touch screen Control circuit
The ADS7843 used in the touch screen control chip is a 4- wire resistive touch screen conversion interface chip produced by TI . It is a 12-bit sampling analog-to-digital converter with a synchronous serial interface . The ADS7843 has two auxiliary inputs (IN3, IN4) that can be set to 8-bit or 12-bit mode.
[page]
ADS7843 can input the touch signal to the A/D converter by connecting the touch screen X+, turning on the Y+ and Y- drivers at the same time, and then digitizing the voltage of X+ to obtain the measurement result of the current Y position. Similarly, the logical coordinates of the X coordinate can also be obtained. After obtaining the logical coordinates of X and Y, the data is transmitted to LM3S3748 through the SPI interface for data processing. The external circuit of ADS7843 is shown in Figure 3.
1.4 RS232 serial communication circuit
The RS232 serial port is mainly used for communication between the handle controller and the core board, which is similar to the keyboard interface in the human-machine interface. They communicate with each other through the Modbus protocol. The RS232 serial port communication circuit is shown in Figure 4.
2 System Software Design
2.1 Touch screen software design
ADS7843 has two working modes, single-ended reference mode and differential reference mode. At the same time, it can also be selected for 12-bit or 8-bit conversion mode. This design uses differential reference mode and 12-bit conversion mode, namely:
WriteCharTo7843(0xD0); ∥ send control word 10010000,
That is, use the differential mode + 12-bit conversion mode to read the X coordinate;
…
WriteCharTo7843(0x90); ∥ send control word 11010000,
That is, use the differential mode + 12-bit conversion mode to read the Y coordinate;
[page]
The CPU uses an interrupt to read the coordinates. When the screen is not touched, the pin PENIRQ of ADS7843 is a high-level output. When the screen is touched, the pin PENIRQ becomes a low-level output. Whenever the CPU detects the falling edge of this pin, the system enters an interrupt to read the coordinates. The process of reading the coordinate value is shown in Figure 5. When the CPU obtains the logical coordinates each time, it actually reads the X and Y coordinates 11 times respectively, and then stores the read logical coordinate values into two arrays respectively, and sorts the values in the two arrays in a bubble order so that they are arranged in order from small to large, then removes the largest and smallest values, and uses the middle value as the benchmark, and performs an absolute value operation of the difference between the remaining values and the benchmark value. A threshold can be set in the design (this threshold can be set to 5 according to the experiment). If the absolute value is greater than the threshold, this value is discarded, and finally the remaining values are summed and averaged, and used as the final logical coordinate value. This is the function completed by "data processing" in the flowchart.
The main program flow chart of the system is shown in Figure 6. The touch screen calibration process uses a more general calibration algorithm. Since resistive touch screens have a common feature that the voltage is linearly and evenly distributed, the conversion between logical coordinates and physical coordinates can be achieved by only calculating the proportionality coefficient between the logical coordinates and the physical coordinates. First, the five physical coordinate points can be determined. They are displayed on the screen in turn with "+", and their coordinate values are saved in the array Set_x[4] (taking the X coordinate as an example). The logical coordinate values read out during the calibration process are stored in the array Read_X[3]. Finally, the proportionality coefficient between the logical coordinates and the physical coordinates is calculated:
K1=(Read_x[1]-Read_x[0])/Set_X[1]-Set_x[0]);
K2=(Read_X[3]-Read_X[2])/Set_X[3]-Set_x[2]);
KX=(K1+K2)/2; ∥Average the values of the two operations to get the final X ratio coefficient
After obtaining the proportional coefficient, the fifth point is set as the reference point (Set_X[4]). In this way, the physical coordinates of any touch point can be obtained:
X=(ReadX-Read_X[5])/KX+Set_X[4];
Similarly, the physical coordinates of the Y-axis can also be calculated.
[page]
2.2 Modbus Communication Protocol
This system uses Modbus as the communication protocol between the handle controller and the core board. Modbus communication uses master-slave technology, that is, only one device (master device) can initiate transmission (query), and other devices (slave devices) respond accordingly based on the data provided by the master device query. The message structure of the host query and the slave reply is shown in Figure 7. The master device can communicate with the slave device alone or with all slave devices in broadcast mode. If communicating alone, the slave device returns a message as a response; if it is queried in broadcast mode. No response is made. The Modbus protocol establishes the master device query format, including the device (or broadcast) address, function code, and all data error detection fields to be sent. The slave device response message is also composed of the Modbus protocol, including the field to confirm the action to be taken, any data to be returned, and the error detection field. If an error occurs during the message reception process, or the slave device cannot execute its command, then the slave device will create an error message and send it out as a response.
Modbus protocol has two transmission modes: ASCII and RTU. However, all devices on the same Modbus network must select the same transmission mode and serial port parameters. This design uses the RTU mode, that is, each 8-bit byte in the message contains two 4-bit hexadecimal characters. Therefore, at the same baud rate, more data can be transmitted than the ASCII mode. The message structure of the RTU mode is shown in Figure 8. When the handle controller detects that a key is pressed, the key code of the pressed key is sent to the core board through the serial port according to the structure of the RTU message frame. After the core board receives the information sent by the handle controller, it first performs a CRC check. After the check is correct, the core board will perform corresponding operations according to the key code and respond to the handle controller. If the CRC check is wrong, the core board responds to the handle controller with an error message. After completing one communication, the system waits for the next communication.
3 Conclusion
The human-machine interface designed in this paper has been proven to be stable and reliable in communication, simple and convenient in operation, and can fully meet the requirements of medical data acquisition systems. In addition, the design has strong portability and can be improved according to the complexity of the system used. Therefore, it has a very wide range of applications.
Previous article:Design of a new low-frequency ultrasound transdermal instrument
Next article:Application of automatic range control in DNA electrochemical signal acquisition instrument
- 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
- Display community logo on three-color E-Ink Gizmo
- 【GD32450I-EVAL】UART
- Simple VGA driver for MicroPython
- How to solve CAN bus test problems
- Fudan Micro FM33LG0xx Series Data Summary
- How to use a computer
- [DIY] Transform electric car lights into 5V mobile power supply
- IIC control of DSP
- Can the master device send data to the slave device?
- MOSFET tube "fully saturated conduction"?