TI官方文档:电容式触摸屏使用说明(风火轮)
- 格式:pdf
- 大小:397.84 KB
- 文档页数:18
触摸屏操作说明触摸屏采用菜单式管理。
共有六个根目录菜单和一个故障复位按扭。
六个根目录按扭位于触摸屏底部,分别为主菜单、维护、油路管理、静电高压、强制控制、油量控制。
按下六个根目录按扭其中一个,触摸屏将自动切换到相对应的根目录菜单画面。
故障复位按扭与六个根目录按扭同排列于触摸屏底部。
还有后台故障报警。
以下将分别详细介绍各目录的功能内容和操作方法。
一、主菜单:■刀梁静电场:〈状态显示菜单〉显示刀梁静电场的开启或关闭。
○当涂油机开启后,所有涂油条件都满足的情况下,涂油机将自动进入正常工作状态,静电场将自动开启。
○当强制高压开启按扭被按下后,静电场将自动开启。
■PLC系统:〈状态显示菜单〉显示PLC系统的正常或故障。
○ PLC系统发生故障而不能正常工作时,该菜单将显示故障。
涂油机将进入停机报警状态,并有浮动错误窗口弹出(PLC故障,请停机检查PLC模块或与本公司联系)○当PLC系统的I/O端口发生故障,该菜单将显示故障。
涂油机将进入一般报警状态,并有浮动错误窗口弹出(I/O错误,请断电重起设备,如还有此报警请检查PLC模块)。
■板带探测:〈状态显示菜单〉显示进口与出口处是否有钢带的状态(有带或无带)。
○只有当进口与出口同时显示有带时,穿带保护结构才会打开。
只要其中有一个显示无带,穿带保护结构都将自动闭合,而此时涂油机将无法进行涂油。
■涂油机状态:〈状态显示菜单〉显示涂油机状态,显示除故障和强制状态(非正常状态)以外的预热、待机和睡眠三个状态。
○预热状态:当油温低于20℃时,加热器处于加热状态。
报警器灯:黄+红常亮○待机状态:当油温低于40℃高于20℃时,加热器处于加热状态。
报警器灯:黄常亮○睡眠状态:进入待机状态后,连续30分钟内没有满足涂油条件,整机将进入睡眠状态。
报警器灯:红常亮+黄闪烁,屏幕上将浮动小猪睡觉图。
■主油箱加热:〈状态显示菜单〉显示主油箱底部3个加热器的开或关。
○当主油箱内的油温低于20℃时,主油箱底部3个加热器将自动开启。
触摸屏操作手册一、简介触摸屏是一种常见的人机交互设备,通过触摸屏可以直接通过手指或者特定的工具来进行操作和控制。
本操作手册旨在向用户介绍触摸屏的使用方法和注意事项,以便更好地实现各种功能。
二、基本操作1. 点击:在触摸屏上轻触一下,表示点击操作。
点击可以选择菜单、打开应用程序或者进行其他各种操作。
2. 滑动:用手指在触摸屏上滑动,可以进行滚动、拖动或者翻页的操作。
滑动可以实现页面切换、查看长文本内容等功能。
3. 放大缩小:用两个手指并拢或张开,在触摸屏上进行放大或缩小的操作。
放大缩小可以用于查看图片、网页或者进行地图缩放等。
三、多点触控触摸屏支持多点触控,利用多个手指可以实现更多的操作功能。
1. 双指缩放:用两个手指并拢或张开进行放大或缩小的操作,与基本操作中的放大缩小类似。
2. 旋转:用两个手指在触摸屏上进行旋转的操作,可以调整图片、地图等的旋转角度。
3. 拖拽:用两个手指并拖动可以移动物体或者改变物体的位置。
拖拽可以用于拖动文件、调整窗口大小等操作。
4. 其他:根据触摸屏设备的不同,还可以支持更多的多点触控操作,比如双击、按住移动等。
四、手势操作触摸屏还支持各种手势操作,通过特定的手指动作可以触发不同的功能。
1. 上滑/下滑:用手指从屏幕底部向上或向下滑动,可以打开或关闭通知栏、展开或收起菜单等。
2. 左滑/右滑:用手指从屏幕左边向右或向左滑动,可以进行页面切换、查看上一张照片等操作。
3. 双击:用手指快速点击屏幕两次,可以进行快速放大或缩小、双击打开应用程序等操作。
4. 长按:用手指在屏幕上长时间按住不动,可以弹出操作菜单、选择文本等功能。
五、注意事项1. 确保手指干净和屏幕无油污,这可以增加触摸屏的灵敏度和精确度。
2. 避免用力按压触摸屏,轻触即可触发操作。
3. 不要使用尖锐物体或者过于粗糙的物体来触摸屏,以免刮伤或损坏屏幕。
4. 避免长时间不动触摸屏,以免屏幕长时间亮着造成能源消耗过多。
tl2510触摸屏说明书1、如果您使用的是电容式触摸屏,那么建议您在第一次使用时,首先先按照说明书的要求正确安装好电容触摸屏所需要的驱动程序,然后用手指依次单击屏幕上的“开始”来运行屏幕校准程序,校准完成以后,系统自动将校准后的数据存放在控制器的寄存器内,以后再重新启动系统后就无需再校准屏幕了。
2、如果在中途操作电容触摸屏时,重新改变了触摸屏的显示器分辨率或显示模式,或者是自行调整了触摸屏控制器的刷新频率后,感觉到光标与触摸点不能对应时,都必须重新对触摸屏系统进行校准操作。
3、为了保证触摸屏系统的正常工作,除了要保证系统软件的正确安装之外,大家还必须记得在一台主机上不要安装两种或两种以上的触摸屏驱动程序,这样会容易导致系统运行时发生冲突,从而使触摸屏系统无法正常使用。
4、在使用电阻式触摸屏时,如果发现光标不动或者只能在局部区域移动时,您可以查看一下触摸屏的触摸区域是否被其他触摸物始终压主,例如一旦触摸屏被显示器外壳或机柜外壳压住了,就相当于某一点一直被触摸,那么反馈给控制器的坐标位置就不准确,光标当然也就不能正确定位了。
如果是机柜外壳压住触摸区域您可以将机柜和显示器屏幕之间的距离调大一点,如果是显示器外壳压住触摸区域,您可以试着将显示器外壳的螺丝拧松一点试一下。
5、前面笔者曾经提到,一旦系统在更换显示分辨率、调整屏幕大小和第一次安装时都有会出现单击不准或漂移,需启动应用程序中自带的定位程序重新定位,不过大家在定位时,最好要使用比较细的笔或指尖进行定位,这样比较准。
6、表面声波触摸屏的工作环境要求较高,它必须要求工作在一个干净、没有灰尘污染的环境中,而且还要定期清洁触摸屏表面上的灰尘,不然的话,空气中的灰尘覆盖在触摸屏四周的反射条纹或换能器上时,就会影响系统的正确定位。
7、不要让触摸屏表面有水滴或其它软的东西粘在表面,否则触摸屏很容易错误认为有手触摸造成表面声波屏不准。
另外在清除触摸屏表面上的污物时,您可以用柔软的干布或者清洁剂小心地从屏幕中心向外擦拭,或者用一块干的软布蘸工业酒精或玻璃清洗液清洁触摸屏表面。
CAPACITIVE TOUCH PANEL SPECIFICATION电容式触摸屏规格书CONTENT:目录1. GENERAL SPECIFICATION 产品规格1-1. Product name 产品名称1-2. Product No. 产品编号1-3. Drawing No. 图纸版本1-4. Code No. 样品编号2. BASIC FEATURES 基本特征2-1 Dimension 尺寸2-2 Construction 结构2-3 Surface Hardness 表面硬度2-4 Scope 应用方式2-5 Application 应用范围3. MECHANICAL CHARACTERISTICS 机械性能3-1 Operation distance 操作距离3-2 Package drop 包装后跌落测试3-3 FPC bending test FPC弯折测试4. ELECTRICAL CHARACTERISTICS 电气特性4-1 Insulation 绝缘性4-2 Supply voltage for logic 电压4-3 Supply current for logic 电流5. OPTICS CHARACTERISTICS 光学特性5-1 Light transmissivity 光透过率6. RELIABILITY 可靠性6-1 Operating temperature and humidity 操作温度和湿度6-2 Storage Temperature and humidity 存储温度和湿度6-3 Humidity resistance 湿度抗性6-4 Heat resistance 抗热性6-5 Cold resistance 抗低温性6-6 Thermal shock 热冲击6-7 Vibration resistance 抗振动7. BLOCK DIAGRAM 原理框图7-1 IC Pin Configuration IC 脚定义7-2 BLOCK DIAGRAM 原理框图8. DRAWING 图纸1. General Specification 产品规格2 .Basic features 基本特性3. Mechanical characteristics 机械特性4. Electric characteristics 电气参数5. Optics characteristics 光学特性6. Reliability 可靠性7.Block diagram 原理框图7-1 IC Pin Configuration IC 脚定义7-2 Block diagram 原理框图8. DRAWING 图纸。
目录220V 12V 手柄麦克主用接口备用接口音箱触摸屏VGA 接口触摸屏232接口USB 接口电源开关2. 呼叫调度台正常运行后,会显示如下界面:图2 调度台运行界面示意图左上角圆球状态代表调度台的接口状态:绿色代表主用通信正常,黄色代表备用通信正常,红色代表通信故障。
●用户键区本系统用户键区为分页设计,目前为13页;每页设计为72个用户键。
●用户呼叫记录状态区在这里可以显示用户的呼入呼出状态和号码,记录呼叫的进程和通话记录。
●功能键区在这里有系统设定的功能键:主辅应答键、重拨、转接、保持、切换。
按需要点击系统设置可自行添加会议、自动、簿等功能键。
2.1单个用户的呼叫当进行单个用户的呼叫时,直接点按相应的用户键就可以了,若用户呼叫的对象没有预设在用户键上,可以通过拨号键来完成呼出,拨号键的具体用法将在功能键介绍中进行说明。
2.2多个用户的呼叫当调度员需要进行多个用户的呼叫时,只需依次按下相应用户的用户键即可;当车站值班员需要进行多个用户呼叫时,需要先按下会议键,然后点按需要呼叫的用户键,或者当正在通话的用户使用的是麦克时,此时点按麦克键,该按钮会显示为手柄,然后可拿起手柄进行第二个用户的呼叫。
当有用户呼入时,相应的用户键会闪烁并伴有振铃音,如下图:图3 调度台呼入状态示意图此时,有3种接听方法●点按相应的用户键来接听●点按主应答键接听●点按辅应答或者直接拿起手柄接听当有用户正在通话,同时又有其他用户呼入时,调度员操作台会直接把该用户接通并在用户键上显示,而车站值班员操作台会响铃提示值班员,值班员可以选择通过手柄直接接听或者挂掉当前通话再接听。
4.功能键介绍用户在平时使用中只需按相应的用户键呼叫或在来电时按应答键接听即可,其他常用功能键有:拨号键、紧急键、切换键、麦克键、会议键、转接键、保持键、备用键等。
本键用来呼叫没有预先定义到用户键按钮上的用户,需要使用时可先按下“拨号”键,然后在弹出的拨号盘上按相应的号码后按呼出即可。
触摸屏中⽂说明书(只供参考-可编辑)前⾔为了您能尽快轻松⾃如地操作本机,在您开始使⽤本机之前,请仔细阅读我们随机提供的说明书,以便您能正确使⽤本机。
本⼿册中的信息资料如有变更,恕不另⾏通知,且不承担此⼿册产⽣的错误或者疏漏引起的任何事件。
⼀、主要功能·2.8⼨全触摸屏,320X240点阵全彩⾼速TFT显⽰屏全屏触摸·⽀持MP3、WMA、WA V⾳乐格式·⽀持MPEG-4(AVI)视频格式·⽀持JPEG格式图⽚浏览·内置麦克风,超长时间录⾳·节能设置,亮度可⾃由调节,⾃动关机·多种⾳效、循环可供选择·⽀持多国⽂字·USB2.0⾼速传输·⽀持电⼦书阅读·⽀持游戏功能,·移动硬盘功能·⽀持固件升级⽀持SD扩展,可⽀持到2GB SD卡⼆、外型及按键说明:1、本说明书中要求短按的时候您要在播放器上停留1S-2S,2、长按锁键可锁定机器的触摸屏,以防⽌误动作。
如需要解锁,请再长按锁键。
3、本机触摸屏可⽤⼿触摸,也可以⽤本机后壳上触摸笔孔中所带触摸笔进⾏操作。
三、主界⾯在主界⾯中,短按⼀下该菜单确认该功能,长按进⼊四、⾳乐播放在主菜单选择“⾳乐播放”选项,再长按进⼊⾳乐播放模式,进⼊以下界⾯:键选择上下曲,按调节⾳量。
2.按进⼊放⾳设置菜单。
其中设置⽅法和系统设置菜单中的⼀样,后来详述。
其中⾳效设置可设置成以下⼏种设置:,可选择正常(NOR)/3D/摇滚(ROCK)/流⾏(POP)/古典(CLASS)/重低⾳(BASS)/爵⼠(JAZZ)/⽤户⾃定(USER)8种⾳效模式。
3.按进⾏A-B复读短按⼀下,在播放状态下设置复读起始点,显⽰状态“A-”;再次短按,设置复读结束点,显⽰状态“A-B”,开始循环复读;短按“,,退出复读模式;在暂停状态下“A-B复读”功能⽆效。
当在“A-”、或“A-B”状态下,长按“”键进⾏快进或快退将取消“A-B复读”功能。
目录0.前言 (2)1.操作注意事项 (2)2.操作台触摸屏画面构成及说明 (3)2-1画面阶层及上下触摸屏画面分配 (3)2-2各画面说明 (3)各画面共同部分 (3)①运转监控画面 (8)①-1掘削条件未成立明细显示Window (12)①-2油脂充填运转设定Window (13)②计测监控画面 (14)③泵启动画面 (17)④推进油缸选择画面 (18)④-1同步设定Window (20)⑤辅助操作画面 (21)⑤-1盾尾油脂操作画面 (22)⑤-1-1自动注入周期设定Window (25)⑤-2超挖刀操作画面 (26)⑤-3铰接操作画面 (28)⑥其他设定画面 (31)⑥-1系统设定Window (32)⑥-2其他设定Window (33)⑥-3土压控制参数设定画面 (34)⑥-4PLC内部AD/DA监控画面 (35)⑥-5异常履历表示画面 (36)⑦异常数据表示画面 (37)⑦-1故障诊断提示Window (38)⑧系统出错表示画面 (39)3.推进油缸操作箱画面构成 (40)3-1画面阶层 (40)3-2各画面的说明 (41)各画面的共同部分 (41)①泵启动画面 (42)②推进油缸操作画面 (43)③其他设定画面 (46)③-1系统设定Window (47)④系统出错表示画面 (48)4.异常内容一览 (49)4-1触摸屏自我诊断异常情况及处理一览 (50)4-2系统出错内容及对应一览 (51)4-3运转关系异常及对应一览 (52)4-4掘削条件未成立导引内容及对应一览 (56)0.前言本说明书为φ6250mm泥土压式盾构操作台及推进油缸操作箱専用的操作説明書(別冊)。
因内容非独立成立,阅读时请参照主机说明书一起使用。
本说明书中的画面为説明用,与实际显示画面可能会有不同,敬请注意。
1.操作注意事項用触摸屏操作时,请仔细阅读以下事项,安全使用。
(1)勿用手指以外的东西操作触摸屏。
硬物操作会损坏触摸屏表面的菜单开关和液晶屏。
Application ReportSLAA491B–April2011–Revised July2011Getting Started With Capacitive Touch Software LibraryMSP430ABSTRACTThe objective of this document is to explain the process of getting started with the Capacitive Touch Software Library.There are multiple ways to perform capacitive touch sensing with the MSP430™.This document gives an overview of the methods available,the applicable target platforms and example projects to start development.Example projects accompanied with a step-by-step walkthrough of library configuration with the Capacitive Touch BoosterPack based on the LaunchPad™Value Line Development Kit(MSP-EXP430G2)using the MSP430G2452are also presented.Software collateral and Example Project Files for Code Composer Studio™4.2.1and IAR Embedded Workbench™5.20can be downloaded from the MSP430Capacitive Touch Sensing Landing Page.Contents1Overview of Capacitive Touch Sensing Methods (2)2Example Projects (3)3References (16)Appendix A Current Measurements (17)List of Figures1Library Architecture (2)2Capacitive Touch BoosterPack:Element Port/Pin Assignment (4)3File and Directory Structure (9)4Code Composer Studio New Project Wizard–Target MCU Device Selection Step (10)5Code Composer Studio Project Properties Window–Predefined/Preprocessor Symbols (11)6Code Composer Studio Project Properties Window–Enable GCC Extensions Option (12)7Code Composer Studio Project Explorer View(C/C++Tab) (12)8Code Composer Studio Project Properties Window–Include Options (13)9IAR Project Options–Target Device (14)10IAR Project Options–Preprocessor Options (14)11IAR Project Options–FET Debugger (15)12IAR Project Explorer View (15)List of Tables1Overview of Capacitive Touch Measurement Methods(Supported by the Library) (3)2Description of the Example Projects (10)3Current Measurements for Example Projects (17)MSP430,LaunchPad,Code Composer Studio are trademarks of Texas Instruments.IAR Embedded Workbench is a trademark of IAR Systems AB.All other trademarks are the property of their respective owners.………Overview of Capacitive Touch Sensing Methods 1Overview of Capacitive Touch Sensing MethodsThere are several methods of performing capacitive touch sensing using the MSP430family of devices.A combination of different peripheral sets across different device families can be used to measure thecapacitive touch response from a sensor.Figure1breaks down the architecture of the Capacitive Touch Software Library.The top layer is theApplication Layer that has user-defined application code.The layers underneath belong to the Capacitive Touch Library.The bottom layer is the Hardware Peripheral Layer that contains low-level functions forperipheral configurations.The Hardware Abstraction Layer(HAL)has functions for implementing sensing techniques using different peripheral sets.The next layer up is the Capacitive Touch Layer that contains high-level abstract functions for implementing sensor structures such as buttons,wheels and sliders.Note that the level of abstraction increases from left to right,where the Raw simply outputs raw counts versus the Wheel that outputs touch position.Figure1.Library Architecture2Getting Started With Capacitive Touch Software Library SLAA491B–April2011–Revised July2011 Example Projects Table1lists the different methods available.The Method Name column on the left hand side indicates the HAL Description Name as implemented in the Capacitive Touch Library.Details on each method andimplementation can be found in the Capacitive Touch Library Programmer's Guide(SLAA490)[1].Table1.Overview of Capacitive Touch Measurement Methods(Supported by the Library) Method Name Measurement Example MSP430 (HAL description)Sensing Type Peripheral Timer Gate Timer Benefits DevicesRO_COMPAp_TA0_WDTp Relaxation Comparator TimerA0Watchdog Enables low-power MSP430F20x1Oscillator(RO)COMPA+Timer WDT+mode during MSP430F4xxmeasurements RO_PINOSC_TA0_WDTp Relaxation Pin Oscillator TimerA0Watchdog Enables low-power MSP430G2xx2Oscillator(RO)Timer WDT+Modes duringmeasurements RO_PINOSC_TA0Relaxation Pin Oscillator TimerA0Software Does not use MSP430G2xx2Oscillator(RO)counter watchdog timerresourceRO_COMPB_TA0_WDTA Relaxation Comparator TimerA0Watchdog Enables low-power CC430FxxOscillator(RO)COMPB Timer WDTA Modes duringmeasurements RO_COMPB_TA1_WDTA Relaxation Comparator TimerA1Watchdog Enables low-power MSP430F55xxOscillator(RO)COMPB Timer WDTA Modes duringmeasurements RC_PAIR_TA0RC Time Digital I/O TimerA0N/A Simple All MSP430devicesConstant(RC)and resistor Implementation fRO_PINOSC_TA0_SW Fast Relaxation Pin Oscillator Software TimerA0Fast Scan Rate MSP430G2xx2Oscillator(fRO)counterDescriptions of the RO and RC principles can be found in PCB-Based Capacitive Touch Sensing WithMSP430(SLAA363)[2]and a detailed design guide for the RC-based single touch sensor can be found in the MSP430Capacitive Single-Touch Sensor Design Guide(SLAA379)[3].2Example Projects2.1Overview of the Example ProjectsThe example project uses the Capacitive Touch BoosterPack on the LaunchPad value line development kit with the MSP430G2452MCU.The LaunchPad is a low-cost development kit with a20-pin PDIPsocket,on-board programmer and debugger,universal serial bus(USB)communication to PC,etc.[4].Along with the8KB of Flash and256B of RAM,the MSP430G2452MCU has16touch-sense enabled input/output(I/O)pins that use the pin oscillator feature aforementioned in Section1[5].WheelP2.4 (up)P2.1 (left)P2.3 (right)P2.2 (down)P2.0 (proximity)P2.5 (middle)Example Projects 2.2Overview of the Capacitive Touch BoosterPack HardwareThe capacitive touch BoosterPack is based on the pin oscillator feature and illustrates three types ofsensors:Proximity,Button and Wheel(group of buttons).Figure2shows the layout of the sensors and port/pin definition to the MSP430G2452MCU.Figure2.Capacitive Touch BoosterPack:Element Port/Pin AssignmentThere are also nine LED elements that are multiplexed to indicate touch:four on either side and one for the middle element.For details on the schematic connections and PCB layout,see the Capacitive Touch BoosterPack User’s Guide(SLAU337)[6].2.3Configuring the Software LibraryThe Capacitive Touch Software Library must be configured with the port definition,sensing method,number of elements,and other factors.These factors can be configured in structure.c source code and structure.h header files.The following steps are presented using theRO_PINOSC_TA0_WDTp_One_Button Example where the sensing method is RO_PINOSC_TA0_WDTp and the sensor structure comprises of one button(the middle element).1.Element Definition:Declare the element structure and assign the port/pin definition.Example:The middle element is mapped to P2.5(Port2/Pin5).Within the structure.c source code file://Middle Element(P2.5)const struct Element middle_element={.inputPxselRegister=(uint8_tt*)&P2SEL,.inputPxsel2Register=(uint8_t*)&P2SEL2,.inputBits=BIT5,//When using an abstracted function to measure the element//the100*(maxResponse-threshold)<0xFFFF//ie maxResponse-threshold<655.maxResponse=200+655,.threshold=200//Set threshold to zero for element characterization };Within the structure.h header file:extern const struct Element middle_element;4Getting Started With Capacitive Touch Software Library SLAA491B–April2011–Revised July2011 Example Projects NOTE:The threshold variable should be set to zero for the element characterization step.NOTE:The maxResponse variable is required to be set only for the wheel/slider implementationand is not needed for a single sensor implementation.For more details,see the CapacitiveTouch Library Programmer's Guide(SLAA490)[1]2.Sensor Structure Definition:Declare the sensor structure and define the sensing method,number ofsensor elements,the gate timer source,and the measurement window.Example:The sensor structure:•Comprised of one element(the middle element)•Sensing method is the relaxation oscillator using the pin oscillator feature•TimerA0is measurement timer;watchdog timer(WDT)is gate timerWithin the structure.c source code file://One Button Sensorconst struct Sensor one_button={.halDefinition=RO_PINOSC_TA0_WDTp,//Sensing Method.numElements=1,//#of Elements.baseOffset=0,//First element index=0//Pointer to elements.arrayPtr[0]=&middle_element,//point to middle element//Timer Information.measGateSource=GATE_WDT_ACLK,//0->SMCLK,1->ACLK.accumulationCycles=WDTp_GATE_64//64-Default};Within the structure.h header file:extern const struct Sensor one_button;3.Characterizing Element Performance:•Initialize Threshold:As mentioned in Step1,the threshold value should be initialized to zero for element characterization.•Configure the Gate Timer:This example uses the RO_PINOSC_TA0_WDTp method with the Watchdog timer used as the Gate Timer.The Gate Time will have a direct impact on the noiseimmunity,touch sensitivity,power consumption and overall performance of the sensor.–Adjust the Gate Timer Source(measGateSource)to source the WDT from eitherlow-frequency ACLK or high-frequency SMCLK.–Adjust the measurement window(accumulationCycles)to select between different WDT intervals.Example Projects Within the structure.c source code file://One Button Sensorconst struct Sensor one_button={.halDefinition=RO_PINOSC_TA0_WDTp,//Sensing Method.numElements=1,//#of Elements.baseOffset=0,//First element index=0//Pointer to elements.arrayPtr[0]=&middle_element,//point to middle element//Timer Information//Select Gate Timer Source for Watchdog Timer//.measGateSource=GATE_WDT_SMCLK,//SMCLK?.measGateSource=GATE_WDT_ACLK,//ACLK?//Select Measurement Window timeframe by selecting//the Watchdog Timer Input Clock divider setting//.accumulationCycles=WDTp_GATE_32768//32768//.accumulationCycles=WDTp_GATE_8192//8192//.accumulationCycles=WDTp_GATE_512//512.accumulationCycles=WDTp_GATE_64//64};•Setup the characterization function:Once the Gate Time has been configured,the main() function should call the Baseline tracking function and monitor the counts returned from theTI_CAPT_Custom()function.This action can be accomplished by un-commenting or declaring thefollowing compiler directive in the main.c source code file.//Uncomment to have this compiler directive run characterization functions only#define ELEMENT_CHARACTERIZATION_MODEWhen the compiler directive ELEMENT_CHARACTERIZATION_MODE is defined,the following codefor element characterization is compiled within main.c source code file.//Within the application layer source code file:main.c#include"CTS_Layer.h"//Delta Counts returned from the API function for the sensor during characterizationunsigned int dCnt;void main(void){WDTCTL=WDTPW+WDTHOLD;//Stop watchdog timer................................//Set up system clocksBCSCTL3|=LFXT1S_2;//LFXT1=VLO Clock SourceP1OUT=0x00;//Drive all Port1pins low................................//Initialize PortsP2DIR=0xFF;//Configure all Port2pins outputs//Initialize Baseline measurementTI_CAPT_Init_Baseline(&one_button,5);while(1){//Get the raw delta counts for element characterizationTI_CAPT_Custom(&one_button,&dCnt);__no_operation();//Set breakpoint here}}6Getting Started With Capacitive Touch Software Library SLAA491B–April2011–Revised July2011 Example Projects •Getting the Characterization Delta Counts:To get the delta counts for element characterization, set a breakpoint on the NOP following the TI_CAPT_Custom()function and add the variable dCntto the Watch window.Run the program several times and record the value for the following twocases:–No Touch:No finger is touching the middle element and no conductive object in the immediate vicinity of the sensor.This is effectively characterizing the background noise.Record themaximum value of dCnt in this scenario as noTouchCnt.–Touch:A finger is touching the middle element or some conductive object is in the immediate vicinity of the sensor.This is effectively characterizing the touch response sensitivity.Recordthe minimum value of dCnt in this scenario as TouchCnt.4.Setting the Threshold Value:The threshold value should nominally be set to the middle of the range:threshold=(TouchCnt-noTouchCnt)/2.The threshold can be set higher or lower to increase noiseimmunity or increase sensitivity.NOTE:Setting a threshold value too low increases the probability of false triggers(and make itsusceptible to noise).Setting a threshold value too high causes the sensor to not recognizethe presence of a conductive object.Once the threshold value is calculated,the respective element structure should be updated with thenew value.For example,during the characterization process,noTouchCnt=100and TouchCnt=1000.The threshold value should be set to450.Within structure.c source code file://Middle Element(P2.5)const struct Element middle_element={.inputPxselRegister=(uint8_t*)&P2SEL,.inputPxsel2Register=(uint8_t*)&P2SEL2,.inputBits=BIT5,//When using an abstracted function to measure the element//the100*(maxResponse-threshold)<655.maxResponse=450+655,.threshold=450//Update the threshold after characterization NOTE:Steps3and4may have to be attempted multiple times to determine the appropriate gatetime for the PCB layout,neighboring element structures and application noise levels.This isan iterative fine-tuning process.ing API calls to achieve higher levels of abstraction:The library provides several API calls thatcan abstract out all of the inner workings,such as baseline tracking,rate of change,etc.These callsprovide the advantage of having streamlined code in the Application Layer.NOTE:All of the measurement API functions(with the exception of the TI_CAPT_RAW()function)update the baseline tracking.The TI_CAPT_Update_Baseline()and/orTI_CAPT_Init_Baseline()functions should be used if the sensor is not measured for a longperiod of time(during which drift over time in supply voltage,temperature,or environmentconditions may have occurred).Example Projects •Objective of the Sample Application:To detect touch of one button(middle element),the application calls the TI_CAPT_Button()API function.The function returns logic one or zero toindicate if there is a valid touch or not.This information is used to turn on the center LED on theCapacitive Touch BoosterPack.The LED serves as a visual indicator of center button touch.Between consecutive polling calls,the MSP430is placed into low-power mode(LPM3).Timer A0isused to implement a delay timeout feature to wake up from LPM3into Active Mode.This delay isprogrammable and can be adjusted in main.c source code file.#define DELAY5000//Timer delay timeout count-5000*0.1msec=500msec•Configuring the Sample Application:In main.c source code file,the compiler directive ELEMENT_CHARACTERIZATION_MODE should be commented out so that the application code(rather than characterization code)is compiled.//Comment to have this compiler directive run example application//#define ELEMENT_CHARACTERIZATION_MODE2.4Example ProjectsFigure3shows the directory and the file structure for the associated files that are available for download with this application report.•CCS:Contains Project folders and files for Code Composer Studio IDE•IAR:Contains Project folders and files for IAR Embedded Workbench•Library:Contains the Capacitive Touch Library Files(HAL and Application Layer)•Examples:Each folder within has code examples that provide a starting point for developing applications on different MSP430families using various implementations.(Sample Application andstructure definition files).The high-level API calls such as TI_CAPT_Custom(),TI_CAPT_Buttons(),etc.,consume more Flashmemory space but abstract the inner workings such as Baseline Tracking,Rate of Updates,Direction of Interest,etc.,from the Application layer.The resulting Application Layer is compact and any updates to the HAL or Layer functions do not require any modifications to the application code.The low-level API calls such as TI_CAPT_Raw()can be used to achieve lower Flash memory codefootprint but features such as baseline tracking will have to be implemented manually in the application code.This scenario can possess an advantage for very low-memory devices and yet obtain verylow-levels of power consumption.8Getting Started With Capacitive Touch Software Library SLAA491B–April2011–Revised July2011SLAC489+- - - Documentation+- - - Getting_Started_Projects||+- - - Library| CTS_HAL.c | CTS_HAL.h | CTS_Layer.c | CTS_Layer.h |+- - - Examples+- - - - -RO_PAIR_TA0| main.c | structure.c | structure.h |+- - - RO_COMPAp_TA0_WDTp | main.c | structure.c | structure.h |+- - - RO_COMPB_TA1_WDTA | main.c | structure.c | structure.h +- - - . . .+- - - . . .+- - - SourceRO_PINOSC_TA0_WDTp_One_Buttonmain.c structure.c structure.h +--- CCS| +--- RO_PINOSC_TA0_WDTp_One Button | +--- ...+--- IAR+--- RO_PINOSC_TA0_WDTp_One Button +--- ...+---+--- Example ProjectsFigure 3.File and Directory StructureExample Projects Table2.Description of the Example ProjectsAPI Sensor Flash RAM Example Name Level Structure Description(bytes)(1)(bytes)(1)(2) RO_PINOSC_TA0_WDTp_Low Button(Middle Element)Turn the center LED on or off59618One_Button_Compact based on middle elementtouchRO_PINOSC_TA0_WDTp_High Button(Middle Element)Turn the center LED on or off190014One_Button based on middle elementtouchRO_PINOSC_TA0_WDTp_High Proximity Sensor Turn the center LED on or off190814Proximity_Sensor based on proximity sensordetectionRO_PINOSC_TA0_WDTp_High Wheel(Group of Five Turn the center LED on or off225432Wheel_Buttons Buttons)based on the five wheelbuttons(1)Code Composer Studio4.2.1IDE was used to generate the Flash and RAM memory allocation results.(2)The default boot/rts stack size(0x50~80bytes)is not included in the RAM size.2.5Project Setup in Code Composer Studio IDEThe Code Composer Studio(CCS)Integrated Development Environment(IDE)can be used to build,download,and debug the project source code.NOTE:Code Composer Studio v4.2.1with MSP430Code Generation Tools v3.3.3was used tocreate the example projects.1.Initiate Code Composer Studio,File→New CCS Project,and follow the steps through the New ProjectWizard to create a project for an example.For more information on new project setup,please refer tothe Code Composer Studio v4.2User's Guide for MSP430User's Guide(SLAU157)[7].2.Select the appropriate target MCU device.In the case of the Capacitive Touch BoosterPack,select theMSP430G2452MCU(as shown in Figure4).Figure4.Code Composer Studio New Project Wizard–Target MCU Device Selection Step10Getting Started With Capacitive Touch Software Library SLAA491B–April2011–Revised July2011 Example Projects3.Ensure that the preprocessor/predefined symbol in the Project Build Options matches the target MCUdevice(as displayed in Figure5).Figure5.Code Composer Studio Project Properties Window–Predefined/Preprocessor Symbols11 SLAA491B–April2011–Revised July2011Getting Started With Capacitive Touch Software Library Submit Documentation FeedbackCopyright©2011,Texas Instruments IncorporatedExample Projects 4.Enable the GCC Extensions for the Project Build(as shown in Figure6).•Go to Project→Properties to bring up the Project properties dialog.•On left side,select C/C++Build.•On right side,under Configuration Settings,select the Tab Tool Settings→MSP430Compiler→Language Options→Enable Support for GCC extensions(--gcc).Figure6.Code Composer Studio Project Properties Window–Enable GCC Extensions Option5.Link the Capacitive Touch Library(HAL and Layer)and the Example Project files(Main and Structure)to the project:Project→Link Files to Active Project.For directory structure and file path,seeSection2.3.The Project configuration should look similar to Figure7.Figure7.Code Composer Studio Project Explorer View(C/C++Tab)12Getting Started With Capacitive Touch Software Library SLAA491B–April2011–Revised July2011Submit Documentation FeedbackCopyright©2011,Texas Instruments Incorporated Example Projects6.Add the path of the directories to the Include Path Option(as shown in Figure8).Figure8.Code Composer Studio Project Properties Window–Include Options7.Download and debug the example project:Target→Debug Active Project.13 SLAA491B–April2011–Revised July2011Getting Started With Capacitive Touch Software Library Submit Documentation FeedbackCopyright©2011,Texas Instruments IncorporatedExample Projects 2.6Project Setup in IAR Embedded Workbench IDEThe IAR Embedded Workbench(IAR)Integrated Development Environment(IDE)can be used to build, download and debug the project source code.NOTE:IAR Embedded Workbench6.0with MSP430v5.20was used to create the exampleprojects.1.Initiate IAR,Project→Create New Project,and follow through the steps of giving a new project namewith MSP430to create a new project.For more information on new project setup,see the IAREmbedded Workbench Version3+for MSP430User's Guide(SLAU138)[8].2.Select the appropriate target MCU device,Project→Options,General Options and Target Tab.In thecase of the Capacitive Touch BoosterPack,select the MSP430G2452MCU(as shown in Figure9).Figure9.IAR Project Options–Target Device3.Ensure that the preprocessor/predefined symbol in the Project Options→C/C++Compiler matchesthe target MCU device(as displayed in Figure10).Add the path of the directories to the Additionalinclude directories input box.Figure10.IAR Project Options–Preprocessor Options14Getting Started With Capacitive Touch Software Library SLAA491B–April2011–Revised July2011Submit Documentation FeedbackCopyright©2011,Texas Instruments Incorporated Example Projects4.Select FET Debugger as the Debugger option to download and debug the example project(as shownin Figure11).Figure11.IAR Project Options–FET Debugger5.Add the Capacitive Touch Library(HAL and Layer)and the Example Project files(Main and Structure)to the project:Project→Add Files.The Project configuration should look similar to Figure12.Figure12.IAR Project Explorer View6.Download and debug the example project:Project→Download and Debug.15 SLAA491B–April2011–Revised July2011Getting Started With Capacitive Touch Software Library Submit Documentation FeedbackCopyright©2011,Texas Instruments IncorporatedReferences 3References1.Capacitive Touch Library Programmer's Guide(SLAA490)2.PCB-Based Capacitive Touch Sensing With MSP430(SLAA363)3.MSP430Capacitive Single-Touch Sensor Design Guide(SLAA379)4.MSP-EXP430G2LaunchPad Experimenter Board User’s Guide(SLAU318)5.MSP430G2x52,MSP430Gx12Mixed Signal Microcontroller Data Sheet(SLAS722)6.Capacitive Touch BoosterPack User’s Guide(SLAU337)7.Code Composer Studio v4.2User's Guide for MSP430User's Guide(SLAU157)8.IAR Embedded Workbench Version3+for MSP430User's Guide(SLAU138)16Getting Started With Capacitive Touch Software Library SLAA491B–April2011–Revised July2011Submit Documentation FeedbackCopyright©2011,Texas Instruments IncorporatedAppendix A Current MeasurementsThe current measurements for the example projects are presented in Table3.Note that thesemeasurements represent typical values(averaged)only.Table3.Current Measurements for Example ProjectsExample Name Configuration Voltage Current Range RO_PINOSC_TA0_WDTp_One Middle Element Button 3.3V 2.4µA Touch One_Button_CompactScan Time=500msec 3.0V 2.0µAWDT source=ACLK/64 2.5V 1.4µAACLK=VLO(~12kHz) 1.8V0.9µAGate Time~5.3msec/elementRO_PINOSC_TA0_WDTp_One Middle Element Button 3.3V 2.6µA Touch One_ButtonScan Time=500msec 3.0V 2.1µAWDT source=ACLK/64 2.5V 1.7µAACLK=VLO(~12kHz) 1.8V1µAGate Time~5.3msec/elementRO_PINOSC_TA0_WDTp_STRUCTURE_CONFIG_0(1) 3.3V 2.5µA 1.5cm Proximity_SensorScan Time=500msec 3.0V2µA1cmWDT source=ACLK/64 2.5V 1.5µA0.5cmACLK=VLO(~12kHz) 1.8V 1.1µA TouchGate Time~5.3msec/elementRO_PINOSC_TA0_WDTp_STRUCTURE_CONFIG_1(1) 3.3V9.5µA 2.5cm Proximity_SensorScan Time=500msec 3.0V8µA2cmWDT source=ACLK/512 2.5V6µA 1.8cmACLK=VLO(~12kHz) 1.8V3µA 1.5cmGate Time~42.6msec/elementRO_PINOSC_TA0_WDTp_STRUCTURE_CONFIG_2(1) 3.3V20µA 3.5cm Proximity_SensorScan Time=500msec 3.0V17.5µA3cmWDT source=SMCLK/8192 2.5V14µA 2.8cmSMCLK=DCO(~1MHz) 1.8V9µA 2.5cmGate Time~65.5msec/elementRO_PINOSC_TA0_WDTp_Four Wheel Buttons+ 3.3V8.5µA Touch Wheel_ButtonsOne Middle Element Button 3.0V7µAScan Time=500msec 2.5V 4.8µAWDT source=ACLK/64 1.8V 2.6µAACLK=VLO(~12kHz)Gate Time~5.3msec/element(1)The compiler directive for the structure configuration should be defined at the top of structure.c source file.Current Measurement Setup:•On the LaunchPad,remove all Jumpers on J3:V,TXD,RXD,RST and TEST.CC•On the LaunchPad,remove resistor R34,the pull-up resistor on P1.3and pushbutton switch S2.NOTE:R34removal is necessary for low-current measurements.•If a pull-up resistor is required,configure the Port registers on P1.3to use the internal on-chip pull-up resistors.17 SLAA491B–April2011–Revised July2011Getting Started With Capacitive Touch Software Library Submit Documentation FeedbackCopyright©2011,Texas Instruments IncorporatedIMPORTANT NOTICETexas Instruments Incorporated and its subsidiaries(TI)reserve the right to make corrections,modifications,enhancements,improvements, and other changes to its products and services at any time and to discontinue any product or service without notice.Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete.All products are sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard warranty.Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty.Except where mandated by government requirements,testing of all parameters of each product is not necessarily performed.TI assumes no liability for applications assistance or customer product design.Customers are responsible for their products and applications using TI components.To minimize the risks associated with customer products and applications,customers should provide adequate design and operating safeguards.TI does not warrant or represent that any license,either express or implied,is granted under any TI patent right,copyright,mask work right, or other TI intellectual property right relating to any combination,machine,or process in which TI products or services are rmation published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a warranty or endorsement e of such information may require a license from a third party under the patents or other intellectual property of the third party,or a license from TI under the patents or other intellectual property of TI.Reproduction of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties,conditions,limitations,and notices.Reproduction of this information with alteration is an unfair and deceptive business practice.TI is not responsible or liable for such altered rmation of third parties may be subject to additional restrictions.Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice.TI is not responsible or liable for any such statements.TI products are not authorized for use in safety-critical applications(such as life support)where a failure of the TI product would reasonably be expected to cause severe personal injury or death,unless officers of the parties have executed an agreement specifically governing such use.Buyers represent that they have all necessary expertise in the safety and regulatory ramifications of their applications,and acknowledge and agree that they are solely responsible for all legal,regulatory and safety-related requirements concerning their products and any use of TI products in such safety-critical applications,notwithstanding any applications-related information or support that may be provided by TI.Further,Buyers must fully indemnify TI and its representatives against any damages arising out of the use of TI products in such safety-critical applications.TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products are specifically designated by TI as military-grade or"enhanced plastic."Only products designated by TI as military-grade meet military specifications.Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-grade is solely at the Buyer's risk,and that they are solely responsible for compliance with all legal and regulatory requirements in connection with such use. TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI products are designated by TI as compliant with ISO/TS16949requirements.Buyers acknowledge and agree that,if they use any non-designated products in automotive applications,TI will not be responsible for any failure to meet such requirements.Following are URLs where you can obtain information on other Texas Instruments products and application solutions:Products ApplicationsAudio /audio Communications and Telecom /communicationsAmplifiers Computers and Peripherals /computersData Converters Consumer Electronics /consumer-appsDLP®Products Energy and Lighting /energyDSP Industrial /industrialClocks and Timers /clocks Medical /medicalInterface Security /securityLogic Space,Avionics and Defense /space-avionics-defense Power Mgmt Transportation and /automotiveAutomotiveMicrocontrollers Video and Imaging /videoRFID Wireless /wireless-appsRF/IF and ZigBee®Solutions /lprfTI E2E Community Home Page Mailing Address:Texas Instruments,Post Office Box655303,Dallas,Texas75265Copyright©2011,Texas Instruments Incorporated。