MAX1233/MAX1234触摸屏控制器入门
时间:03-17
来源:互联网
点击:
T R B1
Read BAT1 result BAT1 _code 0x8005 0x0000
T R B2
Read BAT2 result BAT2_code 0x8006 0x0000
T R A1
Read AUX1 result AUX1 _code 0x8007 0x0000
T R A2
Read AUX2 result AUX2 _code 0x8008 0x0000
T R T1
Read TEMP1 result TEMP1 _code 0x8009 0x0000
T R T2
Read TEMP2 result TEMP2 _code 0x800a 0x0000
3) 触摸屏实例
下面的例子解释了怎样使用DEMO1234.EXE程序来获得触摸屏数据。3.1) 低成本商用触摸屏
在互联网上搜索"PDA Digitizer/Glasstop",寻找合适的替代触摸屏。高清触摸屏玻璃的价格范围在50美元至10美元之间,价格取决于型号以及玻璃是否全部贴在显示屏上。3.2) 连接触摸屏和评估板
MAX1234评估板提供突出插头H5/H6来连接10mm柔性电缆或者长度更短的电缆。H6连接器的间距是0.5mm,比实际触摸屏柔性电缆间距更精细。把柔性电缆插入H6,上锁,选择位于四条柔性电缆中每一电缆中心位置的H5引脚。跳接器连接H5和标有U1的X+、Y+、X-以及Y-测试点。3.3) 检验触摸屏的连接
第一次连接触摸屏时,通过下面的步骤来验证X和Y连接是否正确。可以有几个触摸屏交叉连接,但大部分不会正常工作。在这些例子中,我们假设X- = left,X+ = right,Y- = top,Y+ = bottom。
表10. 触摸屏物理连接验证命令序列DEMO1234 Command
Action SPI data in
Verification Connect DVM to X+/GND T MD
No measurement; drive Y+,Y- 0x0040 0x3701
Touch top left X+ = approx. Y- Touch top right X+ = approx. Y- Touch bottom left X+ = approx. Y+ Touch bottom right X+ = approx. Y+ Connect DVM to Y+/GND T ME
No measurement; drive X+,X- 0x0040 0x3b01
Touch top left Y+ = approx. X- Touch top right Y+ = approx. X+ Touch bottom left Y+ = approx. X- Touch bottom right Y+ = approx. X+
表11. 纠正触摸屏连接问题Symptom Correction Touch coordinates are mirrored top-to-bottom Swap the Y+ and Y- connections Touch coordinates are mirrored left-to-right Swap the X+ and X- connections Touch coordinates are rotated 180 degrees Swap the X+ and X- connections, and swap the Y+ and Y- connections Touch coordinates are mirrored diagonally Swap the X+ and Y+ connections, and swap the X- and Y- connections Touch coordinates do not seem to track, and the distortion is not a simple flip/rotate/mirror transformation Swap the X+ and Y+ connections;
if distortion persists, swap the X+ and Y- connections;
if distortion still persists, disconnect touch screen and use DVM to verify X+ to X- resistance and Y+ to Y- resistance;
verify with no touch X+ and X- are isolated from Y+ and Y-3.4) 检测触摸屏的操作:根据需要扫描
在配置MAX1234检测触摸屏操作,根据需要数字化接触屏的位置时,写入寄存器0x40 (ADC控制),其PENSTS=0,ADSTS=0 (请参考MAX1233/MAX1234数据资料的表6)。读取寄存器0x00 (X轴)后,检测到后续的触摸屏操作时,/PENIRQ信号锁存至低电平,在写入ADC控制寄存器测量X、Y轴之前,保持低电平。
表12. 触摸屏检测命令序列:根据需要扫描DEMO1234 Command
Action SPI data in
Verification T W AC 0b01
Demand scan 0x0040 0x0b01
T R AX
Read conversion result register X 0x8000 0x0000
P R 6
Read PENIRQ-bar pin status PENIRQ = 1 Touch the touch screen P R 6
Read PENIRQ-bar pin status PENIRQ = 0 T M2
Measure X,Y,Z1,Z2 0x0040 0x0b01
0x8000 0x0000
0x8001 0x0000
0x8002 0x0000
0x8003 0x0000
P R 6
Read PENIRQ-bar pin status PENIRQ = 1 Touch and hold the touch screen P R 6
Read PENIRQ-bar pin status PENIRQ = 0 T M2
Measure X,Y,Z1,Z2 0x0040 0x0b01
0x8000 0x0000
0x8001 0x0000
0x8002 0x0000
0x8003 0x0000
P R 6
Read PENIRQ-bar pin status PENIRQ = 0 T M2
Measure X,Y,Z1,Z2 0x0040 0x0b01
0x8000 0x0000
0x8001 0x0000
0x8002 0x0000
0x8003 0x0000
P R 6
Read PENIRQ-bar pin status PENIRQ = 0 Release the touch screen P R 6
Read PENIRQ-bar pin status PENIRQ = 0 T M2
Measure X,Y,Z1,Z2 0x0040 0x0b01
0x8000 0x0000
0x8001 0x0000
0x8002 0x0000
0x8003 0x0000
P R 6
Read PENIRQ-bar pin status PENIRQ = 1 3.5) 检测触摸屏操作:自动扫描
在检测触摸屏操作,配置MAX1234,自动数字化触摸屏的接触位置时,写入寄存器0x40 (ADC控制),其PENSTS=1,ADSTS=0 (请参考MAX1233/MAX1234数据资料的表6)。第一次接触屏幕时,/PENIRQ信号暂时变为低电平,并在读取X寄存器之前不会变化。
表13. 触摸屏检测命令序列:自动扫描
- 声学脉冲波辨识触摸屏控制技术(09-16)
- 电容式触摸屏系统解决方案(01-19)
- 触摸屏设计日益简化(03-03)
- 将系统的阻性触摸屏更新到多点触摸屏(10-22)
- 基于嵌入式技术的智能仪器触摸屏接口设计(03-02)
- 如何解决触摸屏的电磁干扰问题(03-01)