Share this

Touchscreen interface design in laser therapy devices

2026-04-06 04:47:47 · · #1
Abstract: The application of various touch screens simplifies the human-computer interaction process. This paper introduces the working principle of a four-wire resistive touch screen and its application in laser therapy devices. The data transmission process between the ADS7846 and the PIC16F876 microcontroller is explained. Keywords: Touch screen, ADS7846, PIC16F876 microcontroller Introduction With the increasing automation of society, human-computer interaction capabilities urgently need a major transformation, developing towards greater ease of use and intuitiveness. Laser therapy devices mainly utilize the physical properties of lasers to act on the human body, producing a chemical reaction to achieve the purpose of treating diseases. As a precision instrument, laser therapy devices require precise control and strict requirements for dustproofing, anti-static properties, and moisture protection. The input device of the laser therapy device adopts touch screen control, which is based on the above requirements and also considers the ease of user operation and intuitive interface. The application of the touch screen integrates data display and data input, simplifying the entire device. 1. Touch Screen Principle The touch screen is attached to the surface of the display and works in conjunction with the display. Touch generates analog electrical signals, which are converted into digital signals. The microprocessor calculates the coordinates of the touch point, thereby obtaining the operator's intention and executing it. Touchscreens can be categorized into five types based on their technical principles: vector pressure sensor, resistive, capacitive, infrared, and surface acoustic wave (SAW) touchscreens, with resistive touchscreens being the most commonly used in practical applications. A resistive touchscreen consists of four transparent layers. The bottom layer is a base layer made of glass or acrylic glass, the top layer is a hardened, smooth, and scratch-resistant plastic layer, and the inner surfaces of the top and bottom layers are two conductive metal layers (OTI, indium oxide). These two layers are insulated by tiny transparent insulating dots. When a finger touches the screen, the two conductive layers make contact at the touch point. The two conductive metal layers of the touch layer are used to measure the coordinates in the X and Y axes, respectively. The conductive layer used for X-axis measurement has two electrodes at its left and right ends, denoted as X+ and X-. The conductive layer used for Y-axis measurement has two electrodes at its top and bottom ends, denoted as Y+ and Y-. This is the lead configuration of a four-wire resistive touchscreen. When a voltage is applied to a pair of electrodes, a uniformly connected voltage distribution is formed on the conductive layer. If a specific voltage is applied to the electrode pair in the X direction, while no voltage is applied to the electrode pair in the Y direction, the voltage value at the touch point can be reflected on the Y+ (or Y-) electrode in the X parallel voltage field. By measuring the voltage of the Y+ electrode to ground, the X coordinate value of the touch point can be determined. Similarly, when a voltage is applied to the Y electrode pair, while no voltage is applied to the X electrode pair, the Y coordinate of the touch point can be determined by measuring the voltage of the X+ electrode. The measurement principle is shown in Figure 1. Five-wire touchscreens differ from four-wire touchscreens. The main difference is that a five-wire touchscreen uses four terminals of one conductive layer as four electrodes, while the other conductive layer only acts as a conductor for measurement, outputting voltages in the X and Y directions. During measurement, voltages must be applied alternately in the X and Y directions. 2. Working Principle of Touch Layer Controller There are various types of touchscreen controllers. Their main function is to apply voltage to the two directions of the touchscreen in a time-division manner under the control of a microprocessor, and transmit the corresponding voltage signals to their own A/D converter. Under the synchronous clock provided by the microprocessor's SPI port, the digital signals are read into the microprocessor. The basic structure of the ADS7846 controller is shown in Figure 2. The measurement result at touch point P in Figure 1 is calculated as follows: The ADS7846 internally allows setting the A/D converter resolution to 8 bits or 12 bits via register settings. In this system, the A/D converter resolution is set to 12 bits. Therefore, the binary output code for point P is: Where: Vref_full is the reference voltage applied to the ADS6746's internal A/D converter. The touchscreen controller operates by inputting control commands through the serial data input port DIN. The basic control format is as follows: bit7 indicates the start of command transmission, active high. A2: A0 is used to select the data input channel; 101 selects X-coordinate measurement, and 001 selects Y-coordinate measurement. MODE defines the internal analog-to-digital converter resolution as 8 bits (MODE=1) or 12 bits (MODE=0). SER/DFR is the single-ended/double-ended reference voltage selection bit. PD1: PD0 is selected according to the power-saving mode requirements. These command control bit settings will be applied in the program code section. 3. System Hardware Design The input system of the laser therapy machine consists of three parts: a touch screen, a touch screen controller, and a microcontroller. The microcontroller uses Microchip's new PIC16F867 chip. Its internal bus adopts a Harvard dual-bus structure. With the same internal frequency, this accelerates data transmission speed and avoids bottlenecks. This chip uses a Reduced Instruction Set Computing (RISC) architecture, making it easy to use and accelerating development. Internally, it contains 8KB of program memory (paged operation), 256 bytes of EEPROM, 368 bytes of RAM, an 8-channel analog-to-digital converter, one general-purpose serial port (SCI), one I2C interface, one serial peripheral interface (SPI), three timers, and a watchdog circuit, among other important resources. The multiplexing of many peripheral interface functions makes the entire microcontroller concise yet powerful. Based on the interface characteristics for data exchange between the ADS7846 and the microcontroller, the SPI port of the PIC16F8676 is selected. The SPI port includes three signals: SDO (serial data output), SDI (serial data input), and SCK (serial synchronization clock). The hardware connection relationship is shown in Figure 3. This paper focuses on the design of the laser therapy instrument input system; the design of other hardware only provides the meaning of the interfaces. Due to the high internal integration of the PIC16F876, the peripheral interface is quite simple, but to complete complex control functions, internal register settings are necessary. 4. Software Design The application software was designed according to the above design ideas. Figure 4 shows the program flowchart of the main program and the touch screen input detection part. Coordinate data processing typically uses a lookup table method, forming a data table from the coordinates of the user commands. The obtained coordinate information is then used for transformation and rapid table lookup, thereby improving the software's running speed. Below is part of the program code for the PIC16F876 interface with the ADS7846. CMDATA EQU 30H XDATA_H EQU 31H XDATA_L EQU 32H YDATA_H EQU 33H YDATA_L EQU 34H ; Initialize registers MOVLW 02H MOVWF TRICB ; Define port B direction MOVLW 90H MOVWF TRISC ; Define port C direction BCF SSPCON, 5 MOVLW 10H MOVWF SSPCON ; Initialize SSPCON BSF SSPCON, 5 ; Start SPI ; Get X, Y coordinates GetXY BCF PORTB, 0 ; Select port AD7846 MOVLW 0D4H ; Get X coordinate command MOVWF SSPBUF ; Send command BUSY BTFSC PORTB, 1 ; Check busy? GOTO BUSY MOVF SSPBUF, W ; 12-bit data MOVWF XDATA_H ; XDATA_H stores the high byte MOVF SSPBUF, W MOVWF XDATA_L ; XDATA_L stores the low byte ... ; Y coordinate data is processed similarly RETLW 0 5. Conclusion The design of this system makes input extremely convenient and simplifies peripheral devices. In practical applications, it improves human-computer interaction capabilities and achieves good social benefits. The system design concept can be applied not only to the medical industry but also to industrial production automation and handheld devices, among other industries.
Read next

CATDOLL 126CM Sasha (Customer Photos)

Height: 126cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/58/66cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22