1.9.5_ADC ​​and touch screen_press and release detection_P

Publisher:chi32Latest update time:2021-08-17 Source: eefocusKeywords:ADC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

insert image description here

The flow of the program is shown in the figure above.


After writing the program, I tested and found that when the waiting interrupt is set to wait for the key press interrupt (enter_wait_pen_down_mode) in the initialization function, pen down is displayed after power on, but the touch screen is not actually pressed. At this time, the program will enter the waiting state and will not detect the press. At this time, it is necessary to perform the press and lift operation again for the subsequent detection to be normal. Only when it is set to wait for the key to be lifted (enter_wait_pen_up_mode), pen up is displayed after power on, and the program will enter the waiting state for the key to be pressed, and the detection can be normal.

insert image description here

When set to wait for the key to be released, the debugging information is as follows.

insert image description here

When set to wait for a key press, the debug information is as follows.

insert image description here

The strange thing is that the debug information in the video and the example is as follows, and the wait key press mode (enter_wait_pen_down_mode) is set.

insert image description here

According to the chip manual of 2440, it is possible to determine whether the key is pressed or lifted based on bit 15 of the ADCDATA0 register.

insert image description here
insert image description here

It can be seen that the debug information in the routine shows that the value of ADCDAT0 is 0x3000, and its bit15 is 0, but it shows pen up. Checking the configuration, it is found that the configuration of the routine is the same as that of the test program. It can also be seen from the debug information that the values ​​of the registers are the same. But why the routine shows pen up, while the test program shows pen down, I have not figured out the reason yet. The current solution is to set it to wait for the key to be lifted mode (enter_wait_pen_up_mode) during initialization, so that the program can run normally.

insert image description here

Keywords:ADC Reference address:1.9.5_ADC ​​and touch screen_press and release detection_P

Previous article:1.9.4_ADC and touch screen_S3C2440 touch screen interface_P
Next article:1.9.6_ADC and touch screen_ADC interrupt_P

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号