0 Introduction
The 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 the health status of themselves and their families in a fast-paced work and life in a timely and accurate manner. 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, uses TFT liquid crystal 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 system human-machine interface 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, without considering power consumption, TFT liquid crystal is a good choice. 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 TI's LM3S3748, which supports the ARM Codex-M3 core with a main frequency of 50 MHz and 128 KByte FIASH, 64 KByte SRAM. At the same time, it 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 solidified inside, which 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 arbitrary rotation of the display screen, and has a touch screen and touch control chip. The module defaults to i8080 16-bit parallel interface, and an 8-bit parallel interface mode can be selected. 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+, turn on the Y+ and Y- drivers at the same time, and then digitize 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 communication circuit is shown in Figure 4.
2 System software design
2.1 Touch screen software design
ADS7843 has two working modes, namely 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 the differential reference mode and 12-bit conversion mode, namely:
WriteCharTo7843 (0xD0); ∥ send control word 10010000,
that is, use differential mode + 12-bit conversion mode to read the X coordinate;
...
WriteCharTo7843 (0x90); ∥ send control word 11010000,
that is, use differential mode + 12-bit conversion mode to read the Y coordinate;
The CPU uses the interrupt mode 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 the 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 then performs bubble sorting on the values in the two arrays so that they are arranged in order from small to large. Then, the two largest and smallest values are removed, and the middle value is used as the benchmark. The remaining values are calculated by the absolute value of the difference with the benchmark value. A threshold value can be set in the design (this threshold value can be set to 5 according to the experiment). If the absolute value is greater than the threshold value, this value is discarded. 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 flowchart of the system is shown in Figure 6. The touch screen calibration process adopts a more general calibration algorithm. Since resistive touch screens have a common feature that the voltage is linearly evenly distributed, the conversion between logical coordinates and physical coordinates can be realized by only finding the proportional coefficient between logical coordinates and physical coordinates. First, 5 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 during the calibration process are stored in the array Read_X[3]. Finally, the proportional 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 scale factor
After obtaining the scale factor, the fifth point is set as the reference point (Set_X[4]), so that 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 obtained.
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 a 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.
The Modbus protocol has two transmission modes, ASCII and RTU, but 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, so 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 the corresponding operation according to the key code and respond to the handle controller. If the CRC check fails, the core board will respond to the handle controller with an error message. After completing one communication, the system will wait for the next communication.
3 Conclusion
The human-machine interface designed in this paper has been proven to be stable and reliable in communication and simple and convenient to operate through actual use, which can fully meet the requirements of the medical data acquisition system. In addition, the design has strong portability and can be improved according to the complexity of the system used. Therefore, it has a fairly wide range of uses.
Previous article:FPGA driver design based on ARM9 and Linux
Next article:Design and implementation of high-definition digital set-top box software system based on ARM-Linux
Recommended ReadingLatest update time:2024-11-16 21:41
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- What is an ISO Connector?
- Power consumption of CCFL driver circuit based on Royer topology
- MSP432E401Y Motor Encoder QEI Module
- i.MX8 Mini series chip core board (MYC-C8MMX) data sharing
- BQ34Z100 operation process
- Power adapter indoor use symbol requirements and pictures
- How to use the single-cell battery charging chip TP4054 with a single-cell fuel gauge chip to achieve accurate power monitoring and reliable charging...
- Limitations of Flash_API for C2000 Series (28335) DSP
- This single-power supply to dual-power supply op amp
- Ultrasonic transducer drive and impedance matching circuit design