当前位置:网站首页>Driver development and abnormal analysis of "technical dry goods" industrial touch screen (serial)

Driver development and abnormal analysis of "technical dry goods" industrial touch screen (serial)

2022-06-10 15:57:00 51CTO

Touch screen is a common interactive device in embedded products , Interactive and intuitive , Easy programming and other characteristics , This series of articles will analyze how to choose the appropriate touch screen scheme and common fault solutions from various angles . The subject of this paper is the driving composition of resistive screen and the abnormal analysis of most touch screens .

1.1 Test environment

processor :AM335x

Kernel version :Linux-3.2

Hardware conditions : Four wire resistance screen 、 Five wire resistance screen

1.2 Drive components

The processing flow of the touch screen is inseparable from , Respond to interrupt escalation events , It is also effective for capacitive screens . So for the touch screen , Just grasp the process of responding to the interrupt escalation event in , It can locate whether it is a software or hardware failure .

With AM335x As an example , The list of driving subsystems involved is shown in table 1.1 Shown . Touch subsystem is the abstraction layer of touch screen , The input subsystem provides an interface that conforms to the upper application , The interrupt subsystem is responsible for receiving interrupt signals from peripheral devices ,ADC The subsystem is responsible for providing electric field signals and collecting voltage values .

surface 1.1 Resistance screen related drive

「 Technical dry cargo 」 Driver development and abnormal analysis of industrial touch screen ( Serial )_ Touch screen

1.3 AM335x Resistance screen drive

The relevant code positions are shown in table 1.2 Shown .

surface 1.2 Resistance screen code path

「 Technical dry cargo 」 Driver development and abnormal analysis of industrial touch screen ( Serial )_ Pin _02

Board level file records ADC Which channels in the module are used for touch function , Which channels are used as analog-to-digital conversion functions , Such as code list 1.1 Shown .

Code list 1.1 Board level description file

route :arch/arm/mach-omap2/board-am335xevm.c

「 Technical dry cargo 」 Driver development and abnormal analysis of industrial touch screen ( Serial )_ Input subsystem _03

ADC Module driver is right ADC Abstract arrangement of channels , Registers that involve partial touch . for example 《【 applied technology 】 Touch screen technology II : Principle analysis 》 I mentioned CTRL Register Of AFE_Pen_Ctrl Bits Used to select the interrupt trigger signal input pin , Such as code list 1.2 Shown .

Code list 1.2 ADC Module drive

route :drivers/mfd/ti_tscadc.c

「 Technical dry cargo 」 Driver development and abnormal analysis of industrial touch screen ( Serial )_ Pin _04

Finally, let's introduce the touch screen driver file that is responsible for abstracting the entire touch device , An interrupt is encapsulated in the touch driver 、ADC Module register operation 、 Enter the escalation of the event .

Set up X The configuration of axis acquisition is shown in the code list 1.3 Shown . combination 《【 applied technology 】 Touch screen technology II : Principle analysis 》 Of 《 Four line screen register configuration 》 and 《 Five line screen register configuration 》 The content is known ,stepconfigx by X General configuration for axis acquisition , When the system equipment is in four wire mode , Turn on XPP、XNN Form an electric field ,INP Value indicates that the acquisition pin is AN2. When the system equipment is in five wire mode , Turn on XPP、YNN、XNN、YPP Form an electric field ,INP_5 The representative acquisition pin is AN4.

Code list 1.3 X Axis ADC To configure

route :drivers/input/touchscreen/ti_tsc.c

「 Technical dry cargo 」 Driver development and abnormal analysis of industrial touch screen ( Serial )_ Input subsystem _05

Set up Y The configuration of axis acquisition is shown in the code list 1.4 Shown ,stepconfigy by Y General configuration for axis acquisition , When the system equipment is in four wire mode , Turn on YPP、YNN Form an electric field ,INP Value is not set , By default AN0. When the system equipment is in five wire mode , Turn on XPP、YNN、XNP、YPN Form an electric field ,INP_5 The representative acquisition pin is AN4.

Code list 1.4 Y Axis ADC To configure

route :drivers/input/touchscreen/ti_tsc.c

「 Technical dry cargo 」 Driver development and abnormal analysis of industrial touch screen ( Serial )_ Touch screen _06

Processor complete ADC After collection , An interrupt needs to be triggered , The registration code of the interrupt handler function is shown in the code list 1.5 Shown . For the user layer , The most intuitive thing is to see how many times this interrupt is triggered in the system , So the interrupt name at this time is request_irq Interrupt name parameter passed in .

Code list 1.5 Interrupt function design

route :drivers/input/touchscreen/ti_tsc.c

「 Technical dry cargo 」 Driver development and abnormal analysis of industrial touch screen ( Serial )_ Pin _07

The last point is the encapsulation of the input subsystem , What is essential in the touch screen code is input Subsystem call , The code is like the code list 1.6 Shown ,input_report That is, the input subsystem reports the function family , Reported events include : Press the key 、 The buttons pop up 、 Absolute coordinates 、 Relative coordinates, etc . So for the system , Eventually as long as input_report Can be carried out smoothly , Then the touch signal can be obtained normally .

Code list 1.6 Input subsystem design

route :drivers/input/touchscreen/ti_tsc.c

「 Technical dry cargo 」 Driver development and abnormal analysis of industrial touch screen ( Serial )_ Pin _08

1.4 Troubleshooting methods for user space

The problem location method of resistance screen is sorted out here , As shown in the table 1.3 Shown .

surface 1.3 User space troubleshooting methods

「 Technical dry cargo 」 Driver development and abnormal analysis of industrial touch screen ( Serial )_ Input subsystem _09

Next, let's combine some specific cases to see how to troubleshoot the touch problem .

1.4.1 No response to touch

problem : No response when connected to the touch screen .

Analysis steps :

  1. see dmesg | grep touch, Check whether the system is loaded with touch driver ; There are kernel configuration options in this section , If there is no information, it will be positioned as a drive exception , Check the kernel configuration or initialization functions .
  2. see /proc/interrupts file , See if the interrupt count changes . If you click on the screen , The interrupt count does not change , According to the interrupt input pin mentioned above , This indicates that the interrupt pin is not connected to the corresponding pin in this case .

1.4.2 Touch jitter

problem : Use ts_test see , I found the cursor flickering .

Analysis methods : adopt cat /proc/interrupts, View interrupt count , If it keeps increasing , Reuse hexdump Command to view the output information , Generally, this kind of irregularity , Because the interrupt signal input pin is connected to the wrong position , For example, the induction pin of the five wire screen , After receiving the ground , Equivalent to the screen being pressed all the time , Therefore, error events will be reported continuously . It is also possible that the sensing pin is connected to an unstable level , There is always a disturbance with high and low changes , The system takes the disturbance of high and low changes as the signal that the touch screen is pressed .

1.4.3 Inaccuracy of touch

problem : When using a five wire screen , One of the four corners is always untouchable .

Analysis methods :ADC The module has an input reference voltage , In general 1.8V, But there are some surprises , Connect it to GND, It is equivalent to that the collection point has been unable to collect normal data .

1.4.4 Abnormal touch

problem : When using a five wire screen , The data jumps randomly .

Analysis methods : From the last article “【 applied technology 】 Principle analysis of touch screen technology ” Analysis can be seen , The normal four corners of the five wire screen are shown in the figure 1.1 Shown ,(H,H) And (L,L) Form a diagonal distribution , In this way X、Y Axial electric fields can form mutually perpendicular distributions , But if the figure appears 1.2 in (H,H) And (L,L) In the same direction , It is impossible to form mutually perpendicular electric fields , At this time, the collected sensing point data is disordered .

「 Technical dry cargo 」 Driver development and abnormal analysis of industrial touch screen ( Serial )_ Touch screen _10

chart 1.1 Normal five wire screen electrode distribution

「 Technical dry cargo 」 Driver development and abnormal analysis of industrial touch screen ( Serial )_ Input subsystem _11

chart 1.2 Abnormal five wire screen electrode distribution

原网站

版权声明
本文为[51CTO]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206101532427057.html

随机推荐