作者:gooogleman
前阵子,俺已经发帖声明解决了2440 触摸屏跳点问题,可是这两天不断有技术支持反应俺的机器很多到了野外出现无法双击的现象,今天返回一个机器,说刚用的时候没有问题,当电池充电一晚上后触摸屏经常变的不能双击了。开始我以为触摸屏被模具压住了,后来拆开来,使用效果也不怎么好,不知道怎么回事,我桌面的那个机器刷同一个系统就非常好,感叹做个产品不容易。
据经验,双击不成功,或者很容易单击变右键,一般是AD采样延迟太长,或者采样周期太长,所以我要从这个下手,看了2440 ADC 触摸部分,有如下:
A/D Conversion Time
When the GCLK frequency is 50MHz and the prescaler value is 49, total 10-bit conversion time is as follows.
A/D converter freq. = 50MHz/(49+1) = 1MHz
Conversion time = 1/(1MHz / 5cycles) = 1/200KHz = 5 us
NOTE
This A/D converter was designed to operate at maximum 2.5MHz clock, so the conversion rate can go up to
500 KSPS.
PRSCEN [14] A/D converter prescaler enable
0 = Disable
1 = Enable
PRSCVL [13:6] A/D converter prescaler value
Data value: 0 ~ 255
NOTE: ADC Freqeuncy should be set less than PCLK by
5times. (Ex. PCLK=10MHZ, ADC Freq.< 2MHz)
DELAY [15:0] 1) Normal Conversion Mode, XY position mode, auto position
v_pADCregs->ADCDLY = 500;
v_pADCregs->ADCCON = (1<<14) | (ADCPRS<< 6) | (7<<3);
#define ADCPRS 49 // 200
从这个看来,得从上面的ADCDLY以及ADCPRS入手,根据上面信息,ADC 采样速度是50/(49+1)=1M,那么现在只要降低ADCDLY和ADCPRS的值就可以达到目的,好,先把ADCDLY改为300 试试,然后再改改ADCPRS。