Home
Configuration for Capacitive Touch-Sensing Application
Contents
1. 6 Touch Sense Counter Clock Setting 0 000 7 Compare Value Setting csse aria eee ee eee ee ee RE ERE ERE d 7 Sensitivity Factor o arpa chde oc xe A Edu dac edad aa aa 9 Accumulation amp Low Pass Filter LPF Gain Setting 10 Trp Polnt Setting c pU e dak a ZAN e gi a RR PRU ee eae wane a PEE 13 Valid Pad Touch Detection Period Setting 15 Calibration Tool U SPY m ms 19 Compare Calibration Tool liis rn 21 Code Generation and Compilation 000 cece es 23 Procedure sen ae Geka Ree RU eee owe eee RR CAL iki Gea RR ER Gala a 24 Compare Calibration teens 25 Module Calibration Tool 0 0 26 Code Generation and Compilation 00 000 cee es 27 Proced re Cc 27 RomLib Calibration Tool 0000 cece m s 29 Code Generation and Compilation 30 PIOCedUIe M Petre AURA VET bets whee a 30 Summary Sayek Ae eee ewe kl ee ae eae keme age a das 31 Application Note 4 V1 0 2010 06 ec AP08100 In fi n eon Configuration for Capacitive Touch Sensing Application Introduction 1 Introduction This application note is for the XC82x XC83x family of products and describes the configuration of the main pa
2. Calibration Tool U SPY Enter the COM port number adjust the baud rate and connect Click the Get button to get register settings Click the Calibrate button to start Module calibration process Observe TSVAL padx values To change any of the register settings pad oscillation window or frequency modify respective field s and click the Set button to program new values Repeat Step 7 to restart Module calibration process 10 Touch the pad and observe the changes in corresponding TSVAL padx values To continue observing other pad results the procedure is 11 Write 0 to PADT and PADTSW fields followed by clicking the Set button 12 Click the Stop button to clear TSVAL padx values 13 Disconnect COM port 14 Click File gt Open Setting to select ini file uspy ModuleCalibration PadGrp2 ini 15 Connect COM port 16 Repeat Step 7 to 10 for pad4 7 Note The user can enable the software control pad turn PADTSW 1 to focus on the behavior of a particular pad turn defined by PADT Application Note 28 V1 0 2010 06 Infineon AP08100 Configuration for Capacitive Touch Sensing Application 3 3 RomLib Calibration Tool The RomLib Calibration Tool is used to observe the waveform of the TS counter value for selected pad input when pad is idle or touched There is one ini file for the RomLib Calibration Tool e uspy RomLibCalibration ini The GUI interface is shown in
3. TSIN1 pad1 TSIN2 pad2 and TSIN3 pad3 while uspy ModuleCalibration PadGrp2 ini is used for TSIN4 pad4 TSIN5 pad5 TSING pad6 and TSIN7 pad7 The GUI interfaces are shown in Figure 20 while Table 5 shows the corresponding display fields with respect to the SFR fields and functions The code generation and compilation is described in Section 3 2 1 The procedure for using the Compare Calibration Tool is described in Section 3 2 2 ioii Z File Edit view Config Tools Window Help 18 x comes ulala EJ ES 3 3 76 Clock Control CLK PS 0 63 NR PADT 0 7 CLKSEL 0 1 PADT 0 7 COMPARE hex PADTSw 0 1 TSOEXT 0 1 TS SAT 071 U SP Co T File Edit cow25 Bi tsvallpad0 tsvval pad2 CLK PS tsvval pad1 tsval pad3 CLKSEL COMPARE Calibrate Stop Soft reset TSOEXT hdd gt Ready Disconnected HEX HEX 4 tsvalfpad4 tsvalipad tsval pad5 tsval pad Calibrate Stop Softreset J a 4 gt Ready Disconnected HEX HEX 4 Figure 20 Module Calibration Tool Table 5 Display of the Module Calibration Tool Display Field SFR Field Input Output Description CLK_PS LTS GLOBCTLO CLK PS Input Output To adjust pad oscillation frequency CLKSEL LTS GLOBCTL1 CLKSEL Input Output To adjust pad oscillation frequency COMPARE LTS COMPARE Input Output To adjust pad oscillation window
4. TSOEXT LTS LDTSCTL TSOEXT Input Output To adjust pad oscillation frequency Application Note 26 V1 0 2010 06 Infineon AP08100 Configuration for Capacitive Touch Sensing Application Calibration Tool U SPY Table 5 Display of the Module Calibration Tool cont d Display Field SFR Field Input Output Description NR_PADT LTS LDTSCTL NR PADT Input Output This defines the number of pad turns enabled PADT LTS TSCTL PADT Input Output To select the pad turn number PADTSW LTS TSCTL PADTSW Input Output To enable disable software control pad turn TS SAT LTS_TSCTL TSCTRSAT Input Output To enable disable saturation of TS counter TSVAL padx LTS TSVAL Output To obtain the corresponding TS counter values 1 When PADTSW 0 COMPARE value is applicable for all pad turns When PADTSW 1 COMPARE value is applicable for the selected pad turn indicated in PADT display field 2 To select the pad turn number the user must enable the software control pad turn PADTSW 1 3 2 1 Code Generation and Compilation The free tools DAvE and DAvE Bench are used to generate and compile code for calibration The project files are found in their respective folders The DAvE project includes the set up for U SPY communication and the LEDTSCU module The user can modify the project files provided to perform the calibration process for their application However the U SPY set up must not be modified in order to use the cali
5. Citi Infineon XC800 Family AP08100 Configuration for Capacitive Touch Sensing Application Application Note V1 0 2010 06 Microcontrollers Edition 2010 06 Published by Infineon Technologies AG 81726 Munich Germany 2010 Infineon Technologies AG All Rights Reserved LEGAL DISCLAIMER THE INFORMATION GIVEN IN THIS APPLICATION NOTE IS GIVEN AS A HINT FOR THE IMPLEMENTATION OF THE INFINEON TECHNOLOGIES COMPONENT ONLY AND SHALL NOT BE REGARDED AS ANY DESCRIPTION OR WARRANTY OF A CERTAIN FUNCTIONALITY CONDITION OR QUALITY OF THE INFINEON TECHNOLOGIES COMPONENT THE RECIPIENT OF THIS APPLICATION NOTE MUST VERIFY ANY FUNCTION DESCRIBED HEREIN IN THE REAL APPLICATION INFINEON TECHNOLOGIES HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND LIABILITIES OF ANY KIND INCLUDING WITHOUT LIMITATION WARRANTIES OF NON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OF ANY THIRD PARTY WITH RESPECT TO ANY AND ALL INFORMATION GIVEN IN THIS APPLICATION NOTE Information For further information on technology delivery terms and conditions and prices please contact the nearest Infineon Technologies Office www infineon com Warnings Due to technical requirements components may contain dangerous substances For information on the types in question please contact the nearest Infineon Technologies Office Infineon Technologies components may be used in life support devices or systems only with the express written approva
6. File Edit View Config Tools Window Help 81 x com 5g t mE E Ets E Input Compare0 3 Compare4 7 LOwiIMIT 0 255 Compared Compares HiGHLIMT 0 255 Compare Compare5 OK Ps 0 63 Compae2 Compares ClKsEL on Compares Compare TSFINISH hex Auto calibrate Stop Softreset Disconnected HEX HEX 4 Figure 17 Compare Calibration Tool Showing LTS_COMPARE Application Note 21 V1 0 2010 06 ec AP08100 In fi n eon Configuration for Capacitive Touch Sensing Application Calibration Tool U SPY ioii T Fie Edit View Config Tools Window Help 18 x Input Result Result L Set LOWL MIT O 0 255 Res hex Resut4 hex HiGHLMIT 0 255 Resutt hex Resuts hex ckrPs 0 63 Resut2 hex Resut amp hex CLKSEL Of Resut3 hex Result hex OO ETTE TSFINISH Z File Edit view Config Tools Window Help 12 x com SAS lalael Selaeul 2 Input TSVALO 3 TSVAL4 7 Auto calit LOWLIMIT 0 255 TSV amp LO TSVALA HIGHLIMIT 0 255 TSVALI TSVAL5 CLK_PS 0 63 TSVAL2 TSVALG Fail0 CLKSEL 0 1 TSVAL3 rs TSVAL Faili Fail2 Fail3 TSFINISH hex Ready Auto calibrate Softreset Disconnected HEx HEX 4 Figure 18 Compare Calibration Tool Showing LTS TSVAL and Result Table 2 shows the corresponding display fields with respect to SFR fields and functions Table 2 Display of the Compare Calibration T
7. v Compare Value i Compare Calibration Tool Get calibrated COMPAREx amp respective TSVALx based on user s required range setting Module Calibration Tool For fine tuning or selecting small us COMPARE value Ox10 Accumulation amp LPF Module Calibration Tool m Get ATSVALx during touched and Y eU untouched Idle Gain setting RomLib Calibration Tool Observe AVERAGEx waveform during touched and untouched Idle Compare the sensitivity performance of different combinations of AccumulatorCounter amp Divisor n v Trip point setting a RomLib Calibration Tool Measure AVERAGEx value during touched and untouched Idle to get ATSVAL_AVG Calculate Subtraction m from v e Valid amp Long pad touch setting Es ATSVAL AVG Figure 16 Overview Flow of Using Calibration Tools Application Note 20 V1 0 2010 06 ec AP08100 In fi n eon Configuration for Capacitive Touch Sensing Application Calibration Tool U SPY 3 1 Compare Calibration Tool The Compare Calibration Tool is used to get the calibrated SFR LTS COMPARE values for all enabled pads with the corresponding SFR LTS TSVAL values Pass or fail flags are given to determine the calibration status There are three ini files for the Compare Calibration Tool uspy CompareCalib
8. 12 Repeat Step 7 9 to restart Compare Calibration process To continue observing other results the procedure is Click File gt Open Setting to select ini file 4soy CompareCalibration Compare ini Enter the COM port number adjust the baud rate and connect Click the Get button to get current register settings Click the Auto Calibrate button to start Compare Calibration process Wait till TSFINISH 0xAA indicating completion of Compare Calibration process 13 Click the Stop button and then click the Get button to clear calibration results 14 Disconnect COM port 15 Click File gt Open Setting to select ini file uspy CompareCalibration LTSVAL ini or uspy CompareCalibration Result ini 16 Repeat Step 5 to 12 Application Note 24 V1 0 2010 06 AP08100 Configuration for Capacitive Touch Sensing Application Infineon Calibration Tool U SPY 3 1 3 Compare Calibration The Compare Calibration Tool utilizes a software calibration function LTS_vSWCalibration in LTS C running on the microcontroller to assist the user in finding suitable compare values LTS COMPARE In this function the TS counter value LTS_TSVAL is kept within a user defined low and high limit range The low limit LOWLIMIT and high limit HIGHLIMIT values if not defined by the user are 70 0xB2 and 80 0xCC of full count 255 respectively The flow chart overview of the software calibration funct
9. Do the following and re calibrate touch pad is OxFE Reduce time slice duration or Reduce touch pad oscillation frequency ERROR2 EE Calibration is not successful Touch pad oscillation frequency is too high LTS_TSVAL gt HIGHLIMIT and Do the following and re calibrate touch pad LTS COMPARE is OxFE Reduce time slice duration or Reduce touch pad oscillation frequency or Increase HIGHLIMIT value ERROR3 DD Calibration is not successful Touch pad oscillation frequency is too low LTS_TSVAL lt LOWLIMIT and Do the following and re calibrate touch pad LTS COMPARE is 0x10 Increase time slice duration or Increase touch pad oscillation frequency or Reduce LOWLIMIT value 1 Reduce the PREscaler CLK PS or increase the input clock fo x 2 Refer to Section 2 2 1 3 Increase the PREscaler CLK PS or decrease the input clock fe 3 1 1 Code Generation and Compilation The free tools DAvE and DAvE Bench are used to generate and compile code for calibration The project files are found in their respective folders The DAVE project includes the set up for U SPY communication and the LEDTSCU module The user can modify the project files provided to perform the calibration process for their application However the U SPY set up must not be modified in order to use the calibration tool The main configurations that can be modified by the user are shown in Table 4 Application Note 23 V1 0 2010 06 Infineon
10. Figure 21 Table 7 shows the corresponding display fields with respect to the SFR fields and functions The code generation and compilation is described in Section 3 3 1 The procedure for using the Compare Calibration Tool is described in Section 4 Calibration Tool U SPY Input ACCCNT 1 255 Get DIVISOR 0 8 Reset Ost Close Osc pad pad2 pad4 pad1 pad3 pad5 pad6 pad F3 Oscilloscope el gt A li Mn X Trigger RANT zi ve Beams Hex m 3 Man V ait rest Hide panel Disconnect Figure 21 RomLib Calibration Tool Table 7 Display of the RomLib Calibration Tool Display Field SFR Field Input Output Description ACCCNT Input Output AccumulatorCounter input of LEDTS ROM Library FINDTOUCHEDPAD function to determine the number of accumulation Divisor Input Output Divisor n input of LEDTS ROM Library FINDTOUCHEDPAD function to determine low pass filter gain pad x LTS TSCTL PADT Input To select the pad turn number to observe Oscilloscope Output To view waveform of AVERAGEL H of the selected pad turn Application Note 29 V1 0 2010 06 Infineon 3 3 1 AP08100 Configuration for Capacitive Touch Sensing Application Code Generation and Compilation The free tools DAvE and DAvE Bench are used to generate and compile code for calibration The project files are found in their respective folders The DAvE project includes the
11. LOXO U JOSIAIG 0X0 Jeyunogyojejnuunoov 1T Touch Sense Parameter Setting Workflow Configuration for Capacitive Touch Sensing Application 12 MEM uoysun VedGSHNALGNIS 7 900 ASHNCOIO INNO N o Bues Joy e pp ep SIOVIJQVd l fo ano CT ji SOX0 CLOvd SYVdNOO 0X0 JeyunopJojejnuunoov v 210vd WASLV B VOXO LLOvd zd OO 9 uec jer 8 LLavd TWASLV uoneiqueo einpo 9X0 OLGVd zHVdlNOO 8 Lavd WASLV HSWIO L128019 S11 SOLLLOL Sd M10 01128019 SLI Infineon AccumulatorCounter amp Divisor n Settings Example Application Note Figure 6 ec AP08100 In fi n eon Configuration for Capacitive Touch Sensing Application Touch Sense Parameter Setting Workflow 2 4 Trip Point Setting A touch on the pad will decrease the TS counter thus resulting in differences in the Average value ATSVAL AVG is the differences of the Average value in idle state and in touched state as shown in Equation 7 The Trip point LOWTRIPL H is defined as the level where a pad touch is detected It is obtained by subtracting a value Subtraction m from the Average value idle as shown in Equation 8 The user is able to get the Averag
12. PREscale factor CLK PS A pad touch is considered valid only when the pad touched period is between the minimum and maximum valid pad detection period as shown in Figure 11 In invalid cases a pad touch is considered too short typically ignore or too long typically error as shown in Figure 12 and Figure 13 Application Note 15 V1 0 2010 06 Infineon AP08100 Configuration for Capacitive Touch Sensing Application Touch Sense Parameter Setting Workflow PadFlag 0 Cow A m d AVERAGE idle untouched c O LOWTRIP 00 JEN GE MEN aM amp gi AVERAGE touched L L i 604 i PDC FFy FE F7 F6u AO i ME Y ERRORCOUNT 0x40 L L L I aaa L lt gt ENG e SHORTCOUNT OxF7 AEPACP First PadFlag being set gt Last PadFlag being cleared PDC initialized to OxFF e enod PDC cleared to 0x00 PadFlag gt 0 PadFlag 0 Figure 11 Valid Pad Touch PadResult Flag PDC A xt AVERAGE idle untouched n O LOWTRIP o p TERR TUR HER e eee rouler n UR a amp e x AVERAGE touched i tot i FFu FEK F74 F6u A0 ENS n T 7 ERRORCOUNT 00 lt gt tot SHORTCOUNT OxF7 AEPACP gt First PadFlag being set Last PadFlag being cleared PDC initialized to OxFF a einige PDC cleare
13. To use the calibration tool the user needs to have the hex and ini files The main procedure for using the calibration tool from code generation to using U SPY is shown below Setup modules in DAvE and generate code Compile code to obtain the hex file Download hex file to device Execute Flash Open U SPY tool on PC Loadinitialization ini file in U SPY Use calibration tool as provided Each calibration tool is described in detail in respective sections Table 1 shows a list of the initialization files for different calibration tools Figure 16 shows an overview of using the calibration tools to calibrate the parameters for a touch sensing application Application Note 19 V1 0 2010 06 Infineon Table 1 AP08100 Configuration for Capacitive Touch Sensing Application Listing of Initialization Files for Calibration Tools Calibration Tool U SPY Calibration Aspect Folder Project Hex Name Initialization File Compare Calibration Tool USpy_CompareCalibration uspy CompareCalibration Compare ini uspy CompareCalibration TSVAL ini uspy CompareCalibration Result ini Module Calibration Tool USpy_ModuleCalibration uspy ModuleCalibration PadGrp1 ini uspy ModuleCalibration PadGrp2 ini RomLib Calibration Tool USpy RomlibCalibration uspy RomLibCalibration ini Touch Sense Parameter Setting v TS Counter clock setting
14. calibration COMPARE PADT1 OXCA COMPARE PADT2 OxC5 iL LTS COMPARE Ox7F COLO CMP OPTION OxFF COMPARE COLO 0x7F COMPARE COL1 0x7F COMPARE PADTO OxD6 COMPARE PADT1 OXCA COMPARE PADT2 OxC5 User defined Parameters Registers to be configured ROMLIB Parameters to be set Figure 5 Compare Value Setting Example 2 2 1 Sensitivity Factor The pad oscillation frequency affects the sensitivity of the touch pad and the compare value selection Device specific factors for example external pull up presence of LEDs etc affect the oscillation frequency Therefore the user should pay attention to the external pull up resistor selection and the LED layout in order to balance the sensitivity of the pad and the accuracy of the detection The pad oscillation frequency increases by using a smaller external pull up connected to COLA pin This results in better sensitivity although it increases the crosstalk between adjacent pads LED driving and touch pad sensing is time multiplexed on a single pin Therefore the presence of LEDs modifies the equivalent capacitance for a touch pad The recommendation is to reduce the number of LEDs connected to the touch pads If it is necessary LEDs should be located near to the touch pads to reduce the additional parasitic capacitance introduced by the traces Application No
15. set up for U SPY communication and the LEDTSCU module The user can modify the project files provided to perform the calibration process for their application However the U SPY set up must not be modified in order to use the calibration tool Calibration Tool U SPY The main configurations that can be modified by the user are shown in Table 8 Table 8 Configurations for RomLib Calibration Tool Type Module Tab Control Block Description Function DAvE LEDTSCU Pin Control Operating Mode Enable Touch sense or LED amp Touch sense GUI Touch Sense Pins To select the touch sense pins LED Column Enable To define number of columns LED Line Pins To select the LED line pins LED Column Pins To select the LED column pins General LED TS Counter Clock To define time slice duration COMPARE To define initial compare value COLLEV To select LED column active level TSOEXT To define touch sense output low level extension ROM LED To define the LDLINE LEDTSCU and brightness Library LED Touch sense To define the touch sense parameters UART UART Pin Configuration To define transmit and receive pins BRG BRG Settings To define the baud rate used by U SPY 3 3 2 Procedure Procedure for using RomLib Calibration Tool Download uspy RomLibCalibration hex to Flash Execute Flash Open U SPY Click File gt Open Setting to select ini file uspy RomLibCalibration ini Click th
16. to low pass filter effect P AVERAGE idle untouched A SUBTRACTION m a AVERAGE touched Figure 9 Enlarged View of Trip Point Figure 10 shows the example of Trip Point setting LTS_GLOBCTLO CLK_PS 101110B LTS_GLOBCTL1 CLKSEL 1 LTS COMPARE Ox7F COLO AccumulatorCounter 0x03 Divisor n 0x01 ROMB ATSVAL_AVE PADTO 45 18 lt Subtraction m PADTO 36 ShortCount 0x01 calibration Subtraction m 0x00 H PADFLAGis ATSVAL_AVE PADT1 56 Kk ei 23 lt Subtraction m PADT1 s 44 cleared after calling Common Subtraction m OxBO FINDTOUCHEDPAD function i CMP_OPTION OxFF unction ATSVAL AVE PADT2 52 21 s Subtraction m PADT2 lt 41 COMPARE COLO Ox7F COMPARE COL1 2 Ox7F COMPARE PADTO 0xD6 COMPARE PADT1 OXCA COMPARE PADT2 0xC5 Se Subtraction m 0x50 Subtraction m PADTO 0x12 Subtraction m PADT1 0x17 Subtraction m PADT2 0x15 m T ROMLIB Parameters to be set Figure 10 Trip Point Setting Example Application Note 14 V1 0 2010 06 ec AP08100 In fi n eon Configuration for Capacitive Touch Sensing Appli
17. AP08100 Configuration for Capacitive Touch Sensing Application Calibration Tool U SPY Table 4 Main Configurations for Compare Calibration Tool Type Module Tab Control Block Description Function DAvE LEDTSCU Pin Control Operating Mode Enable Touch sense or LED amp Touch sense GUI Touch Sense Pins To select the touch sense pins LED Column Enable To define number of columns LED Line Pins To select the LED line pins LED Column Pins To select the LED column pins General LED TS Counter Clock To define time slice duration COMPARE To define initial compare value COLLEV To select LED column active level H W Control Pad Turn To define the number of pad turn s Enable TSOEXT To define touch sense output low level extension UART UART Pin Configuration To define transmit and receive pins BRG BRG Settings To define the baud rate used by U SPY DAvE Shared_int C SHINT viXINTR11Isr To define SFR LTS LDLINE for LED and TS File or Search for User defined LDLINE SHINT_viXINTR13lsr 3 1 2 Procedure Procedure for using Compare Calibration Tool Execute Flash Open U SPY ONOaARwWN gt Download uspy_CompareCalibration hex to Flash 9 Click the Get button to obtain calibration results 10 Click Stop button and then click the Get button to clear calibration results 11 Change any input settings and click the Set button to confirm changes
18. accumulate low pass filter AcCnt P LTS TSVAL i 1 Y K T Y X 1 T Y K T 2Divisorn Figure 1 Overview of the Main LED and Touch Sense Configurable Components The LEDTS ROM Library FINDTOUCHEDPAD function contains a noise rejection feature The Average value calculation uses a moving average filter for noise measurement which makes the touch detection handling robust Calibration is not required during application run time as the LEDTS ROM Library allows the system to adapt to variations caused by the environmental changes for example temperature humidity dirt etc There are several application specific configuration options for the LEDTS ROM Library input parameters AccumulatorCounter Divisor n Subtraction m Trip Point setting Compare value Calibration tools U SPY are provided to assist in parameter configuration refer to Chapter 3 Application Note 5 V1 0 2010 06 ec AP08100 In fi n eon Configuration for Capacitive Touch Sensing Application Touch Sense Parameter Setting Workflow 2 Touch Sense Parameter Setting Workflow There are 5 major steps to configure the touch sense parameter settings Touch Sense Counter Clock Setting Compare Value Setting Accumulation amp Low Pass Filter LPF Gain Setting Trip Point Setting Valid Pad Touch Detection Period Setting Figure 2 shows the flow of touch sense parameter setting Each parameter setting will be further expla
19. bration tool The main configurations that can be modified by the user are shown in Table 6 Table 6 Configurations for Module Calibration Tool Type Module Tab Control Block Description Function DAvE LEDTSCU Pin Control Operating Mode Enable Touch sense or LED amp Touch sense GUI Touch Sense Pins To select the touch sense pins LED Column Enable To define number of columns LED Line Pins To select the LED line pins LED Column Pins To select the LED column pins General LED TS Counter Clock To define time slice duration COMPARE To define initial compare value COLLEV To select LED column active level H W Control Pad Turn To define the number of pad turn s Enable ITSOEXT To define touch sense output low level extension UART UART Pin Configuration To define transmit and receive pins BRG BRG Settings To define the baud rate used by U SPY DAvE Shared_int C SHINT viXINTR11lIsr To define SFR LTS LDLINE for LED and TS File or Search for User defined LDLINE SHINT_viXINTR13lsr 3 2 2 Procedure Procedure for using Module Calibration Tool 1 Download uspy ModuleCalibration hex to Flash 2 Execute Flash 3 Open U SPY 4 Click File gt Open Setting to select ini file uspy ModuleCalibration PadGrp1 ini for pad0 3 Application Note 27 V1 0 2010 06 ONO 9 AP08100 oe In fi n eon Configuration for Capacitive Touch Sensing Application
20. cation Touch Sense Parameter Setting Workflow 2 5 Valid Pad Touch Detection Period Setting The pad detection period depends on many parameters such as the number of pad turns and LED columns enabled accumulation of SFR LTS TSVAL etc For a fixed defined All enabled pads accumulated count period AEPACP the ShortCount determines the minimum valid pad detection period VPDP The minimum and maximum valid pad detection period can be calculated as shown in Equation 10 and Equation 11 9 AEPACP TFD x Number of Touch sense inputs TSIN x x AccumulatorCounter 1 where TSD is Time Frame Duration PREscaler x 256Yf x Number of Time Slice s and AccumulatorCounter is the user defined input for the FINDTOUCHEDPAD function 10 Minimum Valid Pad Detection Period VPDP OxFF ShortCount 1 x AEPACP 11 Maximum Valid Pad Detection Period VPDP OxFF x AEPACP The user is able to decrease the maximum valid pad detection period by introducing an ErrorCount as shown in Equation 12 12 Maximum Valid Pad Detection Period VPDP OxFF ErrorCount 1 x AEPACP The user can increase the valid pad detection period by enabling dummy LED columns without assigning setting the LED column pins selecting 8 MHz input clock CLKSEL Selecting bigger PREscale factor CLK PS The user can decrease the valid pad detection period by selecting 48 MHz input clock CLKSEL selecting smaller
21. d to 0x00 PadFlag 0 PadFlag gt 0 PadFlag 0 Figure 12 Invalid Pad Touch due to Too Short Touch Duration Ignore Application Note 16 V1 0 2010 06 e AP08100 In fi n eon Configuration for Capacitive Touch Sensing Application Touch Sense Parameter Setting Workflow Tm a AVERAGE idle untouched d LOWTRIP vu AVERAGE touched TOTAL TSCTR PDC Pe ee ERRORCOUNT 0xA0 aL n woes Mane n N qoo n D sae gt O see I SHORTCOUNT OxF7 AEPACP First PadFlag being set Last PadFlag being cleared PDC initialized to OxFF RCM PadTouchPeriod PDC dleared to 0x00 PadFlag 0 PadFlag gt 0 PadFlag 0 Figure 13 Long Pad Touch PadError Flag Figure 14 shows the example of ShortCount and ErrorCount settings Application Note 17 V1 0 2010 06 infir AP08100 in neon Configuration for Capacitive Touch Sensing Application Touch Sense Parameter Setting Workflow PREscaler 0x2E fek 8MHz NR PADT 2 AccumulatorCounter 0x03 Min Max VPDP OxFF ShortCount ShortCount OxF7 ErrorCountt 1 No of Columns 1 No of Pad turnst 1 AccumulatorCounter 1 2 8 PREscaler fc ErrorCount OxAO ShortCount OxF7 ErrorCount OxAO Fi
22. e Get button to get current register settings Oscilloscope will display the AVERAGEL H values for padO Press pad0 and observe the change in waveform Change any input settings and click the Set button to confirm changes 0 Click the corresponding padx button to observe other pad turns Application Note 30 1 2 3 4 5 Enter the COM port number adjust the baud rate and connect 6 7 8 9 1 V1 0 2010 06 ec AP08100 In fi n eon Configuration for Capacitive Touch Sensing Application Summary 4 Summary The features of Infineon microcontrollers especially comprising of touch sensing capability opens the door to create a wide variety of applications The Infineon touch sensing solution is a total solution on chip comprising of optimized hardware and effective software functions running from ROM The combined solution is adaptive e g to environment and requires no run time calibration This application note has demonstrated the design time calibration process using free tools from Infineon With the given instructions the calibration tools are easy and convenient to use Using these calibration tools the touch sense software and hardware parameters can be configured and tested to provide for robust sensitive capacitive touch sensing in target applications Application Note 31 V1 0 2010 06
23. e value at the idle and touched state as the threshold from the RomLib Calibration Tool 7 ATSVAL AVG AVERAGEL H idle AVERAGEL H touched 8 LOWTRIPL H x AVERAGEL H x SUBTRACTION m where the Subtraction m is a user defined input parameter to the FINDTOUCHEDPAD function Figure 7 and Figure 8 illustrate the Subtraction m and Trip Point for touch sense detection The Subtraction m value is recommended to be 4096 8096 of the ATSVAL AVG With a smaller Subtraction m value the pad becomes more sensitive to the detection and noise The user must select a suitable Subtraction m value to balance the sensitivity and accuracy of the detection AVERAGE idle untouched a LEN A a 40 ATSVAL_AVG Min SUBTRACTION m 80 ATSVAL_AVG Y Max SUBTRACTION m ATSVAL AVG T J v xi AVERAGE touched 4096 ATSVAL AVG lt SUBTRACTION m s 80 ATSVAL_AVG recommended Figure7 Illustration of Subtraction m rdi AVERAGE idle untouched SUBTRACTION m LOWTRIP y ae xv AVERAGE touched Figure 8 Illustration of Trip Point Application Note 13 V1 0 2010 06 ec AP08100 In fi n eon Configuration for Capacitive Touch Sensing Application Touch Sense Parameter Setting Workflow Figure 9 shows a zoomed in view of the Trip Point with respect to the Average value due
24. gure 14 ShortCount amp ErrorCount Settings Example Application Note 18 V1 0 2010 06 ec AP08100 In fi n eon Configuration for Capacitive Touch Sensing Application Calibration Tool U SPY 3 Calibration Tool U SPY U SPY is part of the free tool DAvE Bench It is a flexible and easy to use tool to set up and observe parameters via a UART to USB interface in real time Different GUI interfaces elements can be set up via different Initialization files The touch sense calibration tool contains a hex file including set up for communication and LEDTSCU module and U SPY initialization ini file There are three aspects of calibration available for the user Compare Calibration Tool To calibrate SFR LTS COMPARE values for all enabled pads Module Calibration Tool To fine tune SFR LTS COMPARE values for all enabled pads RomLib Calibration Tool To observe the sensitivity performance of all enabled pads The calibration set up is shown in Figure 15 Program Tool KEIL SDCC FLOAD so that the device is able to Calibration Tool U SPY with ini file communicate with U SPY Program amp Calibration Tools installed Program hex file into the Flash through full duplex UART Connect to PC COM di Virtual port via Serial USB cable MCU m Uu ES ES oO Uu Connector Target Board PC Figure 15 Calibration Set Up
25. h Sensing Application Touch Sense Parameter Setting Workflow 2 1 Touch Sense Counter Clock Setting The user must first determine the time slice duration TSD for the application The TSD is the maximum length of time that a single pad is enabled for touch sensing The TSD defines the interval of the time slice time frame interrupt events Once the time slice duration is fixed the clock pre scale factor PREscaler can be calculated from the selected input clock fck as shown in Equation 1 1 TSDx cik PREscaler 28 Figure 3 shows the example of TS counter clock setting fei 8MHz PREscaler TSD fc 2 8 PREscaler 46 fox MHz 1 lt PREscaler s 63 fork 48MHzZz 9o LTS_GLOBCTLO CLK_PS 101110B LTS_GLOBCTL1 CLKSEL 1 User defined Parameters Registers to be configured Figure 3 Touch Sense Counter Clock Setting Example 2 2 Compare Value Setting The compare value determines the active duration during which the pad oscillation is enabled within the touch sense time slice duration TSD where the TS counter is counting The bigger the compare value the smaller the oscillation window therefore fewer oscillations are counted For example a compare value 0x00 enables oscillation for the full duration of the time slice whereas OxFF disables oscillation F
26. igure 4 shows the oscillation window with respect to compare value in a time slice duration Application Note 7 V1 0 2010 06 Infineon AP08100 Configuration for Capacitive Touch Sensing Application Touch Sense Parameter Setting Workflow LTS_COMPARE 0x00 Oscillation Window LM LTS COMPARE Ox F Time Slice Duration Oscillation Window LM Time Slice Duration Figure 4 Oscillation Window with respect to Compare value In order to maximize the resolution compare value should be selected to maximize the oscillation count without overflowing the TS counter LTS_TSCTL TSCTROVF 0 Note that the compare value should be large enough to ensure there is sufficient time to read out the oscillation count data before it is cleared by the LEDTSCU when the next pad turn is started Figure 5 shows the example of compare value setting The LOWLIMIT and HIGHLIMIT are the user defined range of TS counter within the enabled oscillation window Application Note V1 0 2010 06 ec AP08100 In fi n eon Configuration for Capacitive Touch Sensing Application Touch Sense Parameter Setting Workflow LTS GLOBCTLO CLK PS 101110B LTS_GLOBCTL1 CLKSEL 1 COMPARE PADTO OxD6 gt Compare value
27. ined in detail in following sections Touch Sense Parameter Setting oU ROM Y yat Us Determine time slice duration as per application D TS Counter clock i needs setting t Calculate CLK_PS with appropriate CLKSEL Compare value ww Determine LOWLIMIT and HIGHLIMIT Get 2 Sem iz A calibrated COMPAREx values and corresponding g TEE TSVALx values Get minimum T S counter value change without any gain filter applied ATSVALx Determine the Total Gain required based on Min counter value change needed for detection Y ae ATSVAL RQD p Accumulation amp LPF Gain setting Call LEDTS ROMLIB functions with different combinations of AccumulatorCounter amp Divisor n Observe changes in AVERAGEx value during touched and untouched idle Compare sensitivity performance of different combinations of AccumulatorCounter amp Divisor n LAE Tri bin imami Calculate Subtraction m OFFSET from 4 EE EN ES ATSVAL_AVG recommended range 40 800 kil i Valid amp Long pad ee Define valid amp long pad touch detection period as touch setting per application needs Figure 2 Overview Flowchart of Touch Sense Parameter Setting Application Note 6 V1 0 2010 06 ec AP08100 In fi n eon Configuration for Capacitive Touc
28. ion is shown in Figure 19 If itis necessary to choose compare values lower than the minimum compare value 0x10 defined in the software calibration function the Module Calibration Tool can be used instead Sat LTS_vSWCalibration gt lt TSCTL n Decrement TSCTROVF 1 LTS COMPARE A y Ting ie S COMPARE gt E NM ie n n Y S COMPARE y Increment LTS TSVAL LTS COMPARE a uq y aa n y v v Output Error Output Results Output Error Figure 19 Overview Flow Chart of LTS vSWCalibration Application Note 25 V1 0 2010 06 ec AP08100 In fi n eon Configuration for Capacitive Touch Sensing Application Calibration Tool U SPY 3 2 Module Calibration Tool The Module Calibration Tool is used to adjust pad oscillation window and frequency via SFR settings see Table 5 to fine tune the compare value SFR LT8 COMPARE This tool is also used to observe the change in the TS counter value SFR LTS TSVAL when a pad is touched with respect to untouched idle There are two ini files for the Module Calibration Tool e uspy ModuleCalibration PadGrp1 ini uspy ModuleCalibration PadGrp2 ini Different ini files mean different GUI interfaces Both ini files have the same usage but are used for different pad input pins TSIN x uspy ModuleCalibration PadGrp1 ini is used for TSINO pad0
29. l of Infineon Technologies if a failure of such components can reasonably be expected to cause the failure of that life support device or system or to affect the safety or effectiveness of that device or system Life support devices or systems are intended to be implanted in the human body or to support and or maintain and sustain and or protect human life If they fail it is reasonable to assume that the health of the user or other persons may be endangered ec AP08100 In fi n eon Configuration for Capacitive Touch Sensing Application XC82x XC83x Revision History V1 0 2010 06 Previous Version s Page Subjects major changes since last revision This is the first release We Listen to Your Comments Is there any information in this document that you feel is wrong unclear or missing Your feedback will help us to continuously improve the quality of this document Please send your proposal including a reference to this document to mcdocu comments infineon com Application Note 3 V1 0 2010 06 AP08100 oe In fi n eon Configuration for Capacitive Touch Sensing Application Table of Contents Table of Contents 1 1 2 1 2 2 2 2 1 2 3 24 2 5 3 1 3 1 1 3 1 2 3 1 3 3 2 3 2 1 3 2 2 3 3 3 3 1 3 3 2 Introduction mrs 5 OVerVIOW siva sai im oldi kalkma ER RO ARE IPEA seki bla AU P a RE RE 5 Touch Sense Parameter Setting Workflow
30. nter value change required for the detection ATSVAL_RQD the minimum Total Gain required can be calculated as 5 Total Gain ATSVAL_RQD ATSVAL The Total_Gain is the combination of the AccumulatorCounter and the LPF_Gain 6 Total Gain AccumulatorCounter x LPF Gain where LPF Gain is 2Divsorn Several possible combinations of AccumulatorCounter and Divisor n can achieve the same Total Gain reguirement However different combinations result in different key response times When the Divisor n becomes larger the response time becomes longer Therefore the user needs to determine a suitable combination based on the application as well as the sensitivity performance The user also needs to take care to ensure the Total Gain does not exceed the maximum of 256 Application Note 10 V1 0 2010 06 ec AP08100 In fi n eon Configuration for Capacitive Touch Sensing Application Touch Sense Parameter Setting Workflow The RomLib Calibration Tool is provided to assist the user to evaluate the sensitivity and performance of different configuration options During calibration the PADFLAG needs to be cleared after calling the FINDTOUCHEDPAD function so that the Average value will be updated all the time even though a touch on a pad is detected PADFLAG gt 1 Figure 6 shows the example of AccumulatorCounter and Divisor n settings Application Note 11 V1 0 2010 06 AP08100 V1 0 2010 06 psn go emi d
31. ool Display Field SFR Field Input Output Description LOWLIMIT Input Output The low limit for LTS_TSVAL value Default B2 HIGHLIMIT Input Output The high limit for LTS_TSVAL value Default CC CLK_PS LTS GLOBCTLO CLK PS Input Output To adjust pad oscillation frequency CLKSEL LTS GLOBCTL1 CLKSEL Input Output To adjust pad oscillation frequency Compare x LTS COMPARE Output To obtain the calibrated compare values TSVAL x LTS TSVAL Output To obtain the corresponding TS counter values Result x Output To obtain the corresponding ok error results of calibration process see Table 3 TSFINISH Output OxAA indicates completion of calibration process Fail x Output To indicate pass or fail status of calibration process Fail status will be highlighted in black Application Note 22 V1 0 2010 06 ec AP08100 In fi n eon Configuration for Capacitive Touch Sensing Application Calibration Tool U SPY TSRESULT parameters indicate the output ok error results of Compare Calibration Tool There are 3 types of error results Their respective description value and next actions are defined in Table 3 Table 3 TSRESULT Parameters Parameter Value Description Next Action PASS OK 55 COMPARE parameter has been N A calibrated successfully ERROR1 FF Calibration is not successful Touch pad oscillation frequency is too high Overflow occurs and LTS COMPARE
32. rameters for touch sensing applications as well as introducing various calibration methodologies For detailed descriptions of the XC82x XC83x products please refer to the XC82x XC83x User s Manual 1 1 Overview The LED Touch Sense Control Unit LEDTSCU provides a time multiplexed control for matrix LED driving and touch sensing The LEDTS ROM Library is integrated into the Microcontroller ROM and consists of the FINDTOUCHEDPAD and SET LDLINE CMP functions These functions are to be called from Time Slice and or Time Frame Interrupt Service Routines The input parameters need to be set up by the the user before calling these functions Figure 1 shows the main hardware and software components the user needs to control set up for the touch sensing and LED applications The parameter setup details will be covered in Chapter 2 Interrupt Control Functional Control CLE PS prescaler SET LDLINE CMP LEDTS ROM Library LEDLINE 7 LEDLINE 6 gt FINDTOUCHEDPAD Ly padFlago LEDLINE 5 gt PadFlagl v LEDLINE 4 Ly PadFlag2 ISR BN EDNET Total TSCTR xq LEDLINE 2 i LEDLINE 1 LowTrip gt PadFlag4 call ROMLIB LEDLINETU subtraction gt PadFlags Eee ly X Subtraction m P PadFlago H gt PadFlag7 increment PADT Ko
33. ration Compare ini uspy CompareCalibration TSVAL ini uspy CompareCalibration Result ini Different ini files means different GUI interfaces and each ini file has a different usage uspy CompareCalibration Compare ini is used to calibrate the compare values SFR LTS COMPARE uspy CompareCalibration TSVAL ini provides the corresponding TS counter values with respect to the calibrated compare values uspy CompareCalibration Result ini is used to analyze the calibration results Calibration for a pad is successful when its fail flag is not set i e not highlighted in black If there is no fail flag set in using uspy CompareCalibration Compare ini it is not necessary to analyze the data using uspy CompareCalibration TSVAL ini and uspy CompareCalibration Result ini The user should disregard the respective SFR LTS COMPARE and LTS TSVAL values when a fail flag is set as indicated in the GUI interface To analyze why the calibration process fails and how to change the pad oscillation frequency and the expected TS counter value range the uspy CompareCalibration Result ini can be used The result parameters are described in Table 3 The GUl interfaces are shown in Figure 17 and Figure 18 respectively Table 2 shows the corresponding display fields with respect to SFR fields and functions The code generation and compilation is described in Section 3 1 1 The procedure for using the Compare Calibration Tool is described in Section 3 1 2 ioi xd Z
34. te 9 V1 0 2010 06 e AP08100 In fi n eon Configuration for Capacitive Touch Sensing Application Touch Sense Parameter Setting Workflow 2 3 Accumulation amp Low Pass Filter LPF Gain Setting A touch on the pad will decrease the oscillation count on the TS counter and the differences of the TS counter is defined as ATSVAL ATSVAL can be obtained by using Module Calibration Tool 2 ATSVAL LTS TSVAL idle LTS TSVAL touched An amplification of the ATSVAL is achieved by applying multi sampling and a low pass filter to increase the resolution and accuracy of touch pad detection This helps to smooth out low and high frequency noise The multi sampling TOTAL TSCTRL H accumulates the pad oscillation count by a configurable number AccumulatorCounter of times shown in Equation 3 A low pass filter is embedded in the Average value calculation shown in Equation 4 The Average value will be updated all the time by the FINDTOUCHEDPAD function unless a touch on a pad is detected PADFLAG gt 1 3 AccumulatorCounter TOTAL TSCTRL H x Y LTS_TSVAL i izl where AccumulatorCounter is a user defined input parameter to the FINDTOUCHEDPAD function and ranges from 1 to 255 4 AVERAGEL H x 1 Divisor n 2 AVERAGEL H x AVERAGEL H x 1 TOTAL TSCTRL H x where the Divisor n is user defined input parameter for FINDTOUCHEDPAD function ranges from 1 to 8 Once ATSVAL is known with the user defined minimum cou
Download Pdf Manuals
Related Search
Related Contents
Manual de Usuario – TWISTER 1500 Fellowes 320-2 User's Manual 1 D-EDIP60_6400E(Portada) TUBE ULTRAGAIN MIC200 AUTO TOOLS - Zipf Lock Company Batteries MSX Ni-Cd Journal des Grésouillais n°4 : mars 2015 - Saint 870552_PressWash_EngSpa - Ppe- pressure - washer ATMOS S 61 Servant vision 取扱説明 - クボタ Copyright © All rights reserved.
Failed to retrieve file