当前位置:网站首页>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

1.3 AM335x Resistance screen drive
The relevant code positions are shown in table 1.2 Shown .
surface 1.2 Resistance screen code path

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

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

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

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

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

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

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

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 :
- 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 .
- 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 .

chart 1.1 Normal five wire screen electrode distribution

chart 1.2 Abnormal five wire screen electrode distribution
边栏推荐
- Vins theory and code explanation 0 -- theoretical basis in vernacular
- [sans titre]
- Anti "internal roll", it is said that 360 enterprise security cloud will launch the "one click forced off duty" function, and the computer will automatically close the office software
- The ultimate buff of smart grid - guanghetong module runs through the whole process of "generation, transmission, transformation, distribution and utilization"
- Interpretation of cube technology | past and present life of cube Rendering Design
- [MySQL basics]
- 点投影到平面上的方法总结
- VINS理论与代码详解0——理论基础白话篇
- 智能电网终极Buff | 广和通模组贯穿“发、输、变、配、用”全环节
- VINS理论与代码详解4——初始化
猜你喜欢

2D pose estimation for pose estimation - (openpose) realtime multi person 2D pose estimation using part affinity fields

运行mapreduce任务缺失setJarByClass()报错找不到类

Recommend an easy-to-use designer navigation website

MapReduce案例之排序

ORB_ Slam2 visual inertial tight coupling positioning technology route and code explanation 2 - IMU initialization

VINS理论与代码详解0——理论基础白话篇
![Google x open source grabbing manipulator can find the target part at a glance without manual marking [turn]](/img/69/02a3e0eeaf3049f41b118cf0c58972.jpg)
Google x open source grabbing manipulator can find the target part at a glance without manual marking [turn]

ORB_ Slam2 visual inertial tight coupling positioning technology route and code explanation 3 - tight coupling optimization model

MapReduce之排序及序列化案例的代码实现

2D human pose estimation for pose estimation - simdr: is 2D Heatmap representation even necessity for human pose estimation?
随机推荐
TensorFlow实战Google深度学习框架第二版学习总结-TensorFlow安装
22. Generate Parentheses
影刀RPA学习和遇见excel部分问题解决方式
Tensorflow actual combat Google deep learning framework version 2 learning summary tensorflow installation
ORB_ Slam2 visual inertial tight coupling positioning technology route and code explanation 3 - tight coupling optimization model
SVM and ANN of OpenCV neural network library_ Use of MLP
ORB_SLAM2视觉惯性紧耦合定位技术路线与代码详解2——IMU初始化
ORB_ Slam2 visual inertial tight coupling positioning technology route and code explanation 1 - IMU flow pattern pre integration
Scope and closure
姿态估计之2D人体姿态估计 - Numerical Coordinate Regression with Convolutional Neural Networks(DSNT)
How does the wireless communication module help the intelligent UAV build the "Internet of things in the air"?
You will never want to miss these vertical niche navigation websites
Anti "internal roll", it is said that 360 enterprise security cloud will launch the "one click forced off duty" function, and the computer will automatically close the office software
Méthodes couramment utilisées dans uniapp - TIMESTAMP et Rich Text Analysis picture
What has guanghetong done in the three years of 5g business from "seeding in the first generation" to "flower on the ground"?
【第14节 STL容器二】
sm59远程连接,如果提示没有host,则在服务器上加上host,然后重启sap_SAP刘梦
MapReduce之Map阶段的join操作案例
torch.utils.data.DataLoader()详解【Pytorch入门手册】
Summary of methods for point projection onto a plane