XC83x AP Application Note. Microcontrollers. intouch Application Kit - Touch Sliders V1.0,

Similar documents
Edition Published by Infineon Technologies AG Munich, Germany 2010 Infineon Technologies AG All Rights Reserved.

AP08023 C504. Important application hints for dead time generation with the Capture/Compare Unit. Microcontrollers. Application Note, V 1.0, Feb.

AP CANmotion. Evaluation Platform with BLDC Motor featuring XC886CM Flash Microcontroller Version 2007/10. Microcontrollers

Application Note, V 1.0, Feb AP C16xx. Timing, Reading the AC Characteristics. Microcontrollers. Never stop thinking.

CDM10V programming user manual describes the COOLDIM_PRG_BOARD burner board usage, the UART protocol handling and the fusing details.

ILD2035. MR16 3 W Control Board with ILD2035. Application Note AN214. Industrial and Multimarket. Revision: 1.0 Date:

PROFET ITS716G Ω Ω. Green Product (RoHS compliant) Data Sheet 1 Rev. 1.1,

Application Note No. 022

Application Note No. 027

TLE4976-1K / TLE4976L

Application Note, V1.0, Oct 2006 AP08019 XC866. Sensorless Brushless DC Motor Control Using Infineon 8-bit XC866 Microcontroller.

TLE4916-1K. Datasheet. Sense & Control. Low Power Automotive Hall Switch. Rev.1.0,

3 phase bridge driver IC TLE7183F

Driving 2W LEDs with ILD4120

Using Z8 Encore! XP MCU for RMS Calculation

Application Note V

January 2009 TLE4906K / TLE4906L. High Precision Hall Effect Switch. Data Sheet V 2.0. Sensors

Application Note No. 116

TLS202A1. Demonstration Board Manual. Automotive Power. Demonstration Board Manual. Rev. 1.0,

Application Note No. 067

Application Note No. 158

Application Note PROFET + UNREGULATED PWM FOR LAMP. Application Note. Body Power. What the designer should know. Rev 1.

Type Package Configuration L S (nh) Marking BB814 SOT23 common cathode 1.8 SH1/2*

TLE5014 Programmer. About this document. Application Note

Type Marking Pin Configuration Package BFP520F APs 1=B 2=E 3=C 4=E - - TSFP-4

Application Note No. 099

Application Note No. 149

Smart High-Side Power Switch BTS4140N

Application Note, Rev.1.0, November 2010 TLE8366. The Demoboard. Automotive Power

D e m o B o a r d U s e r s M a n u a l. Demoboard Rev.1.0, Standard Power

Application Note No. 017

Data Sheet, V 1.1, Oct TLE4906H TLE4906L. High Precision Hall-Effect Switch. Sensors

Inverse Operation Behavior

TLV4946-2L. Datasheet. Sense and Control. Value Optimized Hall Effect Latch for Industrial and Consumer Applications. Rev1.

Data Sheet Explanation

TLV4946K, TLV4946-2K. Datasheet. Sense and Control. Value Optimized Hall Effect Latches for Industrial and Consumer Applications. Rev1.

Schottky diode mixer for 5.8 GHz radar sensor

Application Note No. 124

PIN Diode Switch using BAR90 for GHz WLAN/WiMAX Applications

Evaluation Board for DC Motor Control with the IFX9201. This board user manual provides a basic introduction to the hardware of the H-Bridge Kit 2Go.

Applications of 1EDNx550 single-channel lowside EiceDRIVER with truly differential inputs

Application Note No. 112

PCB layout guidelines for MOSFET gate driver

AP Scalable Pads. XC166 Microcontroller Family. Microcontrollers. Electrical Specification of Scalable Output Drivers in 250nm CMOS Technology

Qualified for industrial applications according to the relevant tests of JEDEC47/20/22

Generating DTMF Tones Using Z8 Encore! MCU

Application Note No. 075

Improving PFC efficiency using the CoolSiC Schottky diode 650 V G6

Surface Mount Capacitive Silicon Absolute Pressure Sensor KP120, KP120 Exxxx

Technical Report <TR130>

Parasitic Turn-on of Power MOSFET How to avoid it?

TLE4941plusC. Product Information. Sense & Control. Advanced Differential Speed Sensor. TLE4941plusC. TLE4941plusCB

Application Note No. 181

Application Note No. 127

Replacement of HITFET devices

Driving 0.5W LEDs on a light strip with Infineon BCR320U / BCR321U or BCR420U / BCR421U

Application Note No. 066

Application Note, V1.1, Apr CoolMOS TM. AN-CoolMOS-08 SMPS Topologies Overview. Power Management & Supply. Never stop thinking.

TLS202A1. Data Sheet. Automotive Power. Adjustable Linear Voltage Post Regulator TLS202A1MBV. Rev. 1.0,

Thermal behavior of the new high-current PROFET

Application Note, V1.0, Nov 2004 ICE3B2565. SMPS Evaluation Board with CoolSET TM ICE3B2565. Power Management & Supply

TLS10xB0MB Demoboard. Preface Z8F Table of contents

Qualified for industrial applications according to the relevant tests of JEDEC47/20/22

BCR450. Driving mid & high power LEDs from 65mA to 700mA with LED controller IC BCR450 with thermal protection

AP XC866. Optimized Space Vector Modulation and Over-modulation with the XC866. Microcontrollers. Application Note, V 2.0, Sept.

Qualified for industrial applications according to the relevant tests of JEDEC47/20/22

DTMF Signal Detection Using Z8 Encore! XP F64xx Series MCUs

Application Note, V1.0, March 2008 AP XC2000 Family. DSP Examples for C166S V2 Lib. Microcontrollers

PROFET Operating Modes (Normal, Inverse, Reverse)

Low Drop Voltage Regulator TLE

PowerBond TM Technology for High-Current Automotive Power MOSFETs

Driving High Power LEDs Starting from 700mA with Low Cost LED Controller IC ILD4001

ESD5V0SxUS. ESD5V0S5US E rotated in reel. Type Package Configuration Marking SOT363 SOT363 SOT363 ESD5V0S4US ESD5V0S5US

1200mA step down - LED controller IC ILD4120

Dual Low Drop Voltage Regulator TLE 4476

TLE Data Sheet. Automotive Power. Low Drop Voltage Regulator TLE4296-2GV33 TLE4296-2GV50. Rev. 1.13,

Infineon Basic LED Driver TLD1310EL. Data Sheet. Automotive. 3 Channel High Side Current Source. Rev. 1.0,

Low Drop Voltage Regulator TLE 4276

Application Note No. 047

MOSFET. CoolMOS CP. Data Sheet. Industrial & Multimarket. Metal Oxide Semiconductor Field Effect Transistor

Type Marking Pin Configuration Package BFR193 RCs 1 = B 2 = E 3 = C SOT23

Step down - LED controller IC for external power stages ILD4001

Qualified for industrial applications according to the relevant tests of JEDEC47/20/22

Power Control ICs EVALLED-TDA4863G-40W. Application Note. Industrial & Multimarket

TVS (transient voltage suppressor) Bi-directional, 18 V (AC), 13 V (DC), 0.3 pf, 0201, RoHS and halogen free compliant

Dynamic thermal behavior of MOSFETs

Type Marking Pin Configuration Package BCR405U L5s 1 = GND 2;3;5 = I out 4 = V S 6 = R ext SC74

n-channel Power MOSFET

n-channel Power MOSFET

3D Magnetic Sensor for Angle Measurements

Low Drop Voltage Regulator TLE 4274

n-channel Power MOSFET

InductionHeatingSeries ReverseconductingIGBTwithmonolithicbodydiode IHW20N120R3. Datasheet. IndustrialPowerControl

Application Note AN V1.6 April 2014

Type Marking Pin Configuration Package BFP520 APs 1=B 2=E 3=C 4=E - - SOT343

Data Sheet, Rev. 2.1, Sept BGA612. Silicon Germanium Broadband MMIC Amplifier. RF & Protection Devices

Type Marking Pin Configuration Package BFR92P GFs 1=B 2=E 3=C SOT23

Application Note AN V1.0 May T h i n P A K 5 x 6. IFAT PMM APS SE AC René Mente, MSc

Application Note No. 014

Z V S P h a s e S h i f t F u l l B r i d g e

Transcription:

XC83x AP08129 Application Note V1.0, 2012-02 Microcontrollers

Edition 2012-02 Published by Infineon Technologies AG 81726 Munich, Germany 2012 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 approval 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.

XC83x Revision History: V1.0 2012-02 Previous Version(s): Page Subjects (major changes since last revision) 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, 2012-02

Table of Contents 1 Introduction..................................................................... 5 2 Hardware & Program Flow......................................................... 6 2.1 Hardware....................................................................... 6 2.2 Program Flow.................................................................... 7 3 Sensing Touch on Slider......................................................... 11 3.1 Slider Position Calculation......................................................... 11 3.1.1 2-pad Slider................................................................... 11 3.1.2 3-pad Slider................................................................... 16 3.1.3 4-pad Slider................................................................... 22 3.1.4 Library for Position Calculation.................................................... 29 4 U-SPY......................................................................... 30 4.1 intouch_slider.ini................................................................ 30 4.2 intouch_slider_ii.ini.............................................................. 32 Appendix - Schematics and Layout................................................ 36 References.................................................................... 41 Application Note 4 V1.0, 2012-02

Introduction 1 Introduction In today's Human-Machine Interface (HMI) designs, capacitive touch technology is now often more widely used than traditional mechanical buttons. Capacitive touch technology is the more popular choice because it brings flexibility, a high-level of customization, and a significant reduction in overall system cost. The intouch Application Kit is available to help learn about working with the advanced touch solutions provided by Infineon. Step-by-step tutorials covers the basics of Infineon's touch solutions, while example application code can be used to start developing new touch-related projects. The intouch Application Kit comprises of a mother board, supplied as a USB stick, and a number of daughter boards. Figure 1 shows the USB stick with the Slider daughter board. Among the many different touch input elements that can be designed with capacitive touch technology, the slider is gaining popularity because of the intuitive control it provides. This application note describing the slider daughter board, aims to highlight the ease of implementing a design with Infineon's touch solutions. Topics covered include program flow, touch behavior and touch position calculation algorithm. Figure 1 intouch Application Kit (USB Stick and Slider board) Application Note 5 V1.0, 2012-02

Hardware & Program Flow 2 Hardware & Program Flow This section describes the hardware used and the connections involved. 2.1 Hardware Infineon s XC836MT 2FRI (Figure 2) is used in this application. The XC836MT is embedded in the intouch Application Kit s USB stick. For more details regarding the USB stick, please refer to AP08126: Infineon Touch Solutions - intouch Application Kit. Figure 2 Infineon s XC836MT 2FRI The intouch Slider and intouch Slider II boards (Figure 3) are available as plug-in daughter boards which are part of the intouch Application Kit. Figure 3 Slider Boards Application Note 6 V1.0, 2012-02

Hardware & Program Flow The intouch Slider board consists of a 4-pad slider (Figure 3, left). The intouch Slider II board consists of a 2- pad and a 3-pad slider (Figure 3, right). Both slider boards are standard PCBs with a 1mm thick plexiglas cover glued to the board. The 4-pad slider on the intouch Slider board is connected to 4 LEDTS pad inputs of the XC836. 4 indicator LEDs are each connected to an LEDTS line pin and they share an LEDTS column pin of the XC836. The 2-pad and 3- pad sliders on the intouch Slider II board are connected to 2 and 3 LEDTS pad inputs of the XC836 respectively. The schematics are available in the Appendix - Schematics and Layout. Users can tap or swipe the touch sliders. 2.2 Program Flow This section presents an overview of the program in terms of the interrupts involved, and then provides the tasks performed in each interrupt service routine. Both programs for intouch_slider and intouch_slider_ii are essentially the same. The main difference is that the program for intouch_slider has additional tasks to toggle the indicator LEDs. In terms of interrupts, the UART interrupt has the highest priority to ensure the smooth transmission of data to U- SPY. The Time Frame interrupt has the medium priority. In this service routine, touch sense related tasks are performed each time pad capacitance has been measured. LED updates (for intouch_slider board), which are performed in the Time Slice interrupt, have low priority. The Timer 2 (T2) Overflow interrupt is given lowest priority due to its slow frequency. Figure 4 and Table 5 provide an illustration of the program overviews for intouch_slider and intouch_slider_ii boards respectively. low TIMER 2 OVERFLOW every 2ms low TIME SLICE INTERRUPT every 320μs medium TIME FRAME INTERRUPT every 640μs high UART INTERRUPT Slider Position Calculation LED settings Touch Sense signal processing Communication with PC (send & receive data) RETI RETI RETI RETI Figure 4 Program Overview for intouch Slider board Application Note 7 V1.0, 2012-02

Hardware & Program Flow low TIMER 2 OVERFLOW every 2ms medium TIME FRAME INTERRUPT every 256μs high UART INTERRUPT Slider Position Calculation Touch Sense signal processing Communication with PC (send & receive data) RETI RETI RETI Figure 5 Program Overview for intouch Slider II board The tasks performed in each interrupt service routine are further illustrated in the flowcharts that follow: T2 Overflow Interrupt (Figure 6) The T2 module provides a slow time base by generating the T2 Overflow interrupt for calculations necessary to handle the touch slider. UART Interrupt (Figure 7) The UART module, which is part of the XC800 core, is used for full-duplex UART communication with the PC. Time Frame Interrupt (Figure 8) The LEDTS module generates this interrupt after every measurement where signal processing and touch detection take place. Time Slice Interrupt (Figure 9) (intouch_slider board only) The LEDTS module generates this interrupt after every LED column activation where the pattern for the next LED column is loaded into shadow registers. Application Note 8 V1.0, 2012-02

Hardware & Program Flow Start Startup over? Yes Condition slider signals Calculate Slider Amplitude No Calibrate slider pads No Slider touched? Yes Update LEDs (for intouch_slider board) Calculate Slider Position RETI Figure 6 Timer 2 Overflow Interrupt Service Routine Application Note 9 V1.0, 2012-02

Hardware & Program Flow Start Receiver Interrupt? Yes New command? Yes Retrieve data from buffer No No Check selected button Transmitter Interrupt? Yes Shift data out to buffer No RETI Figure 7 UART Interrupt Service Routine Start LEDTS pads signal processing Mask LEDTS ROM Library flags for slider pads RETI Figure 8 Time Frame Interrupt Service Routine Start Set LED LINE and COMPARE values Dim LEDs based on touched position RETI Figure 9 Time Slice Interrupt Service Routine (for intouch Slider only) Application Note 10 V1.0, 2012-02

Sensing Touch on Slider 3 Sensing Touch on Slider This section describes how the LEDTS module of the XC836, complemented with a software library, controls the touch slider. The algorithm for calculating the location of touch is also explained in the following section. The main touch sensing functions, handled by software, are as follows: Sample accumulation (ROM library) Signal filtering and moving average calculation (ROM library) Touch detection (ROM library) Touch slider calibration (user software in Flash) Signal tuning (user software in Flash) If properly configured, the LEDTS automatically measures the capacitance of the slider pads. This capacitance increases when a slider pad is touched. A library function in ROM processes the capacitance signals and detects touch on the slider. It does so by accumulating a number of samples and low-pass filtering them to obtain a moving average. The moving average filters noise and is used as a reference to detect sudden changes in capacitance. When the slider is touched or released, a corresponding pad flag in RAM will be set or reset. For more information on the LEDTS ROM Library, please refer to the XC836 User s Manual. The pad flags for the slider pads are unused (always cleared) in the slider position calculation algorithm. It is the moving averages ( pad averages ) that are used instead to calculate the position of the touch. The slider pads are automatically calibrated to the same sensitivity and resolution during startup. Once the pad averages are stable, a position calculation algorithm is run if the slider is touched. The calculated position is then used to determine the location of touch, and is shown on the LEDs. 3.1 Slider Position Calculation This section describes the algorithm for calculating the location of touch on the slider. This section is categorized according to the number of pads forming the touch slider. 3.1.1 2-pad Slider The two touch pads of the slider are placed in a spatially-interpolated manner as shown in Figure 10. The slider is divided into 2 sections for position calculation. Section 1 Section 2 Figure 10 Spatially interpolated 2-pad slider layout and abstraction Application Note 11 V1.0, 2012-02

Sensing Touch on Slider If the pads are calibrated to roughly the same sensitivity and a finger slides from left to right with constant speed and constant pressure (constant effective finger area), the pad average signals are expected to behave in a linear manner in this model as seen in Figure 11. finger position Left Right Section 1 Section 2 untouched_d slider_d untouched_e slider_e Figure 11 Pad average signals of the two pads when slider is swiped Values untouched_d and untouched_e are the pad average levels for pads D and E respectively when they are not touched. If the pads have roughly the same sensitivity, the two signals can be tuned to have a common untouched (UT) level (Figure 12). The actual signals can be expected to look like those in Figure 13. If the two pads have slightly different sensitivity due to board layout, it may be necessary to manually modify the oscillation windows. Left Section 1 Section 2 Right untouched_d Figure 12 Pad average signals of the two slider pads after tuning Application Note 12 V1.0, 2012-02

Sensing Touch on Slider Figure 13 Actual pad average signals after tuning The, now common, untouched level (UT) is very high compared to the difference between touched and untouched states. To make calculations easier, the signals are transformed near to zero by linear combinations which can be represented by the formulae below. Figure 14 provides an illustration of the transformation. X = UT B Y = UT A Application Note 13 V1.0, 2012-02

Sensing Touch on Slider Left Right UT Section 1 Section 2 E UT-MAXT D Y = UT - D X = UT - E MAXT Y 0 X position Figure 14 0 Transformed pad average signals Before the transformation, Section 1 has two signals between UT and UT-MAXT. UT stands for the untouched level and UT-MAXT stands for the signal level when the largest area of the respective pad is touched (this happens at the two extremes). After the transformation, the X and Y signals have much lower values. Application Note 14 V1.0, 2012-02

Sensing Touch on Slider The two signals can be described as: X = MAXT d Y = MAXT MAXT d X If we rearrange Equation (1), we get MAXT = --- which we can substitute in Equation (2): d X Y --- X = ---d d d (1) (2) Y + X = X --- d d = -------------- X X+ Y (3) Y d = 1 -------------- X + Y (4) One division is needed to calculate the position; this operation needs the most computing performance. To minimize the error, it is safer to use Equation (3) if X is larger and Equation (4) if Y is larger. A scaling factor of 2 R is added to create a more usable calculated position (Figure 15 and Figure 16). R is for resolution and corresponds to the number of left bitshifts in the numerator. Section 1 d 2 R Y = ---------------- 2R X + Y Section 2 d = X 2 ---------------- R X + Y X,Y MAXT Y X 0 d 0 2 R Figure 15 Transformed pad average signals after offsetting and scaling Application Note 15 V1.0, 2012-02

Sensing Touch on Slider Figure 16 Actual calculated position 3.1.2 3-pad Slider The three touch pads of the slider are placed in a spatially-interpolated manner as shown in Figure 17. The slider is divided into 3 sections for position calculation. Section 1 Section 2 Section 3 Figure 17 Spatially interpolated 3-pad slider layout and abstraction If the pads are calibrated to roughly the same sensitivity and the finger slides from left to right with constant speed and constant pressure (constant effective finger area), the pad average signals are expected to behave in a linear manner in this model as seen in Figure 18. Application Note 16 V1.0, 2012-02

Sensing Touch on Slider Left Right slider_a Section 1 Section 2 Section 3 untouched_a untouched_c slider_b untouched_b slider_c Figure 18 Pad average signals of the three slider pads during swiping Values untouched_a, untouched_b and untouched_c are the pad average levels for pads A, B and C respectively when they are not touched. If the pads have roughly the same sensitivity, the three signals can be tuned to have a common untouched level (Figure 19). The actual signals can be expected to look like those in Figure 20. Left Right slider_a Section 1 Section 2 Section 3 untouched_a slider_b slider_c Figure 19 Pad average signals of the three slider pads after tuning Figure 20 Actual pad average signals after tuning The, now common, untouched (UT) level is very high compared to the difference between touched and untouched states. To make calculations easier, the signals are transformed near to zero by linear combinations which can be represented by the formulae below. Figure 21 provides an illustration of the transformation. This transformation also makes the transitions between sections smooth, which is especially important if the three pads have different sensitivity or unstable untouched levels due to imperfect calibration or a changing environment. X A+ B = ------------- C Y 2 A + C B+ C = ------------- B Z = ------------- A 2 2 Application Note 17 V1.0, 2012-02

Sensing Touch on Slider Left Right UT Section 1 Section 2 Section 3 C B UT-MAXT A X=(A+B)/2-C Y=(A+C)/2-B Z=(B+C)/2-A MAXT Z Y 0 position X -MAXT/2 Figure 21 Combined pad average signals The resulting X, Y and Z signals still have three distinct sections. Section 1 Before the transformation, Section 1 has three signals between UT and UT-MAXT (Figure 22). UT stands for the untouched level and UT-MAXT stands for the signal level when the largest area of the respective pad is touched (this happens at section borders). Application Note 18 V1.0, 2012-02

Sensing Touch on Slider A, B, C UT UT-MAXT d Figure 22 Section 1 before transformation After the transformation, the X, Y and Z signals have much lower values (Figure 23). The position axis has been arbitrarily scaled from -1 to 2 in this region for convenience. X, Y, Z MAXT Z Y -MAXT/2 0 d X -1 0 1 2 Figure 23 Section 1 after transformation Application Note 19 V1.0, 2012-02

Sensing Touch on Slider Signal X is constant low in this section so it does not participate in the position calculation. The other two signals can be described as: Y = MAXT ---------------- d 2 (1) MAXT MAXT Z = ---------------- ---------------- d 2 2 MAXT Y If we rearrange Equation (1), we get ---------------- = --- which we can substitute in Equation (2): 2 d Y Y Z = --- ---d d d (2) Z = Y --- ( 1 d) d dy ( + Z) = Y d = Y ------------- Y + Z (3) Z d = 1 ------------- Y + Z (4) One division is needed to calculate the position; this operation needs the most computing performance. To minimize the error, it is safer to use Equation (3) if Y is larger and Equation (4) if Z is larger. An offset of 1 and a scaling factor of 2 R are added to create a more usable calculated position (Figure 24). R is for resolution and corresponds to the number of left bitshifts on the numerator. Section 1 Left Section 1 Right d 2 2 R Z 2 = --------------- R Y + Z Y 2 d = ---------------- R + Y+ Z 2R Application Note 20 V1.0, 2012-02

Sensing Touch on Slider X, Y, Z MAXT Z Y 0 d X -MAXT/2 0 2*2 R 3*2 R 2 R Figure 24 Section 1 after offsetting and scaling Sections 2 and 3 In these two sections, the position can be calculated in a similar way as in Section 1, using the two non-constant signals. Offsets of 4 and 7, and the same scaling factor, can then be added to sections 2 and 3 respectively to get a calculated position of 0..9*2 R. Section 2 Left d 5 2 R Y 2 = ---------------- R X + Y Section 2 Right d = ---------------- X 2 R + X + Y 4 2R Section 3 Left Section 3 Right d 8 2 R X 2 = ---------------- R X + Z Z 2 d = --------------- R + X + Z 7 2R Figure 25 gives an illustration of the calculated position across all 3 sections while Figure 26 shows the actual calculated position. Application Note 21 V1.0, 2012-02

Sensing Touch on Slider position Left Right Z Y X d calculated position 0 3*2 R 6*2 R 9*2 R Figure 25 Calculated position vs real position across all sections Figure 26 Actual calculated position 3.1.3 4-pad Slider The four touch pads of the slider are placed in a spatially-interpolated manner as shown in Figure 27. The slider is divided into 4 sections for position calculation. Application Note 22 V1.0, 2012-02

Sensing Touch on Slider Section 1 Section 2 Section 3 Section 4 Figure 27 Spatially interpolated 4-pad slider layout and abstraction If the pads are calibrated to roughly the same sensitivity and the finger slides from left to right with constant speed and constant pressure (constant effective finger area), the pad average signals are expected to behave in a linear manner in this model as seen in Figure 28. Left Right slider_a Section 1 Section 2 Section 3 Section 4 untouched_a slider_c untouched_c untouched_d slider_b untouched_b slider_d Figure 28 Pad average signals of the four slider pads during swiping Values untouched_a, untouched_b, untouched_c and untouched_d are the pad average levels for pads A, B, C and D respectively when they are not touched. If the pads have roughly the same sensitivity, the four signals can be tuned to have a common untouched level (Figure 29). The actual signals can be expected to look like those in Figure 30. Application Note 23 V1.0, 2012-02

Sensing Touch on Slider Left Right slider_a Section 1 Section 2 Section 3 Section 4 untouched_a slider_b slider_c slider_d Figure 29 Pad average signals of the four slider pads after tuning Figure 30 Actual pad average signals after tuning The, now common, untouched level is very high compared to the difference between touched and untouched states. To make calculations easier, the signals are transformed near to zero by linear combinations which can be represented by the formulae below. Figure 31 provides an illustration of the transformation. This transformation also makes the transitions between sections smooth, which is especially important if the four pads have different sensitivity or unstable untouched levels due to imperfect calibration or a changing environment. w A + B + C = ------------------------ D X 3 A + B + D = ------------------------ C Y 3 A + C+ D B + C+ D = ------------------------ B Z = ------------------------ A 3 3 Application Note 24 V1.0, 2012-02

Sensing Touch on Slider Left Right UT Section 1 Section 2 Section 3 Section 4 A UT-MAXT B D C W=(A+B+C)/3-D X=(A+B+D)/3-C Y=(A+C+D)/3-B Z=(B+C+D)/3-A MAXT Z 0 -MAXT/3 Y W X position Figure 31 Combined pad average signals The resulting W, X, Y and Z signals still have four distinct sections. Section 1 Before the transformation, Section 1 has three signals between UT and UT-MAXT (Figure 32). UT stands for the untouched level and UT-MAXT stands for the signal level when the largest area of the respective pad is touched (this happens at the section borders). Application Note 25 V1.0, 2012-02

Sensing Touch on Slider A, B, C, D UT UT-MAXT d Figure 32 Section 1 before transformation After the transformation, the W, X, Y and Z signals have much lower values (Figure 33). The position axis has been arbitrarily scaled from -0.5 to 1.5 in this region for convenience. W, X, Y, Z MAXT Z Y 0 d -MAXT/3 0 W, X -0.5 1.5 Figure 33 Section 1 after transformation Signals W and X are constant low in this section so they do not participate in the position calculation. The other two signals can be described as: Y = 2 MAXT ---------------- d 3 (1) Z = 2 MAXT ---------------- 2 MAXT ---------------- d 3 3 (2) Application Note 26 V1.0, 2012-02

If we rearrange Equation (1), we get 2 MAXT ---------------- Y = --- which we can substitute in Equation (2): 3 d Y Z --- Y = ---d d d Sensing Touch on Slider Z = Y --- ( 1 d) d dy ( + Z) = Y d = Y ------------- Y + Z (3) Z d = 1 ------------- Y + Z (4) One division is needed to calculate the position; this operation needs the most computing performance. To minimize the error, it is safer to use Equation (3) if Y is larger and Equation (4) if Z is larger. An offset of 0.5 and a scaling factor of 2 R are added to create a more usable calculated position (Figure 34). R is for resolution and corresponds to the number of left bitshifts on the numerator. Section 1 Left d 1.5 2 R Z 2 = --------------- R Y + Z Section 1 Right d = ---------------- Y 2 R + Y + Z 0.5 2R W, X, Y, Z MAXT Z Y 0 d -MAXT/3 W, X 2 R 0 2*2 R Figure 34 Section 1 after offsetting and scaling Sections 2, 3 and 4 In these three sections, the position can be calculated in a similar way as in Section 1, using the two non-constant signals. Offsets of 2.5, 4.5 and 6.5, and the same scaling factor, can then be added to sections 2, 3 and 4 respectively to get a calculated position of 0..8*2 R. Application Note 27 V1.0, 2012-02

Sensing Touch on Slider Section 2 Left d 3.5 2 R Y 2 = ---------------- R X + Y Section 2 Right d = ---------------- X 2 R + X + Y 2.5 2R Section 3 Left d 5.5 2 R X 2 = ---------------- R X + Z Section 3 Right d = --------------- Z 2 R + X + Z 4.5 2R Section 4 Left d 7.5 2 R X 2 = ---------------- R X+ Z Section 4 Right d = --------------- Z 2 R + X + Z 6.5 2R Figure 35 gives an illustration of the calculated position across all 4 sections while Figure 36 shows the actual calculated position. position Left Right Z Y X W d calculated position 0 2*2 R 4*2 R 6*2 R 8*2 R Figure 35 Calculated position vs real position across all sections Application Note 28 V1.0, 2012-02

Sensing Touch on Slider Figure 36 Actual calculated position 3.1.4 Library for Position Calculation Infineon provides a function library for position calculation. The resolution, which was explained in earlier sections, is user-selectable from 1 to 8. The XC82xMx and XC83xMx microcontrollers have a Multiplication/Division Unit (MDU) for hardware acceleration. If the MDU is used for the division necessary to calculate the position, the resolution is fixed at 8. The execution is faster and code size is smaller than without hardware acceleration. The disadvantage is that the MDU increases the microcontroller s current consumption almost 1mA. Application Note 29 V1.0, 2012-02

U-SPY 4 U-SPY Two settings files, intouch_slider.ini and intouch_slider_ii.ini have been configured for the intouch_slider and intouch_slider_ii boards respectively. 4.1 intouch_slider.ini This settings file (Figure 37) is customized to allow the user to monitor the calculated slider position and the parameters of the Touch Slider Library, while running the demonstration program. Figure 37 intouch_slider.ini User Interface Buttons The buttons in this settings file are used to select the signal(s) to be monitored. The format of the data transmitted for the buttons is shown in the following table (Table 1): Table 1 Transmit Data Format for Buttons D0 D1 Value (hex) 08 XX Description I.D. number Button number Application Note 30 V1.0, 2012-02

U-SPY The data received by the microcontroller will be used to determine the signals that will be transmitted to U-SPY for display on the Oscilloscope. Progress Bar The progress bar displays the calculated slider position. The format of the transmitted data for the progress bar is as follows (Table 2): Table 2 Transmit Data Format for Progress Bar D0 D1 D2 D3 Value (hex) A2 XX XX XX Description I.D. number Progress Bar Index Calculated Position (High Byte) Calculated Position (Low Byte) Oscilloscope The oscilloscope function allows the user to monitor up to 3 signals at a time (Figure 38). A total of 3 oscilloscopes are available. In this application, only 2 oscilloscopes are used. If the Slider Avg button is selected, 4 signals will be displayed (3 signals on 1 oscilloscope and 1 signal on another). If the Position, Amp button is selected, 2 signals will be displayed on 1 oscilloscope. The format of the transmitted data for the oscilloscope is as follows (Table 3): Figure 38 U-SPY Oscilloscope Table 3 Transmit Data Format for Oscilloscope D0 D1 D2 D3 D4 D5 D6 D7 Value (hex) A4 01 XX XX XX XX XX XX Description I.D. number Scope number Signal 1 high byte Signal 1 low byte Signal 2 high byte Signal 2 low byte Signal 3 high byte Signal 3 low byte Application Note 31 V1.0, 2012-02

U-SPY As mentioned in the previous section, the user is able to monitor two different types of signals in this settings file. The signals displayed are as follows (Table 4: Slider Avg Mode, Table 5: Position, Amp Mode): Table 4 Signals Displayed for Slider Avg Mode Oscilloscope 1 Signal 1 Signal 2 Signal 3 Description Slider_B Current Pad Average Slider_C Current Pad Average Slider_D Current Pad Average Colour Green Pink Yellow Oscilloscope 2 Signal 1 Signal 2 Signal 3 Description Slider_A Current Pad None None Average Colour Green Pink Yellow Table 5 Signals Displayed for Position, Amp Mode Signal 1 Signal 2 Signal 3 Description Slider Position Slider Amplitude None Colour Green Pink Yellow 4.2 intouch_slider_ii.ini This settings file (Figure 39) is customized to allow the user to monitor the calculated slider position and the parameters of the Touch Slider Library, while running the demonstration program. Application Note 32 V1.0, 2012-02

U-SPY Figure 39 intouch_slider_ii.ini User Interface Buttons The buttons in this settings file are used to select the signal(s) to be monitored. The format of the data transmitted for the buttons is shown in the following table (Table 6): Table 6 Transmit Data Format for Buttons D0 D1 Value (hex) 08 XX Description I.D. number Button number The data received by the microcontroller will be used to determine the signals that will be transmitted to U-SPY for display on the Oscilloscope. Progress Bars The progress bars display the calculated slider positions for the 2-pad and 3-pad sliders. The format of the transmitted data for the progress bar is as follows (Table 7): Application Note 33 V1.0, 2012-02

U-SPY Table 7 Transmit Data Format for Progress Bar D0 D1 D2 D3 Value (hex) A2 XX XX XX Description I.D. number Progress Bar Index Calculated Position (High Byte) Calculated Position (Low Byte) Oscilloscope The oscilloscope function allows the user to monitor up to 3 signals at a time (Figure 40). A total of 3 oscilloscopes are available. In this application, only 2 oscilloscopes are used. If the Slider Avg button is selected, 5 signals will be displayed (2 signals on 1 oscilloscope for 2-pad slider and 3 signals on another for 3-pad slider). If the Position, Amp button is selected, 4 signals will be displayed on 2 oscilloscope (2 signals each). The format of the transmitted data for the oscilloscope is as follows (Table 8): Figure 40 Table 8 Value (hex) Descriptio n U-SPY Oscilloscope Transmit Data Format for Oscilloscope D0 D1 D2 D3 D4 D5 D6 D7 A4 01 XX XX XX XX XX XX I.D. number Scope number Signal 1 high byte Signal 1 low byte Signal 2 high byte Signal 2 low byte Signal 3 high byte Signal 3 low byte As mentioned in the previous section, the user is able to monitor two different types of signals in this settings file. The signals displayed are as follows (Table 4: Slider Avg Mode, Table 5: Position, Amp Mode): Application Note 34 V1.0, 2012-02

U-SPY Table 9 Signals Displayed for Slider Avg Mode Oscilloscope 1 Signal 1 Signal 2 Signal 3 Description Slider_D Current Pad Slider_E Current Pad None Average (2-pad Slider) Average (2-pad Slider) Colour Green Pink Yellow Oscilloscope 2 Signal 1 Signal 2 Signal 3 Description Slider_A Current Pad Average (3-pad Slider) Slider_B Current Pad Average (3-pad Slider) Slider_C Current Pad Average (3-pad Slider) Colour Green Pink Yellow Table 10 Signals Displayed for Position, Amp Mode Oscilloscope 1 Signal 1 Signal 2 Signal 3 Description 2-pad Slider Position 2-pad Slider Amplitude None Colour Green Pink Yellow Oscilloscope 2 Signal 1 Signal 2 Signal 3 Description 3-pad Slider Position 3-pad Slider Amplitude None Colour Green Pink Yellow Application Note 35 V1.0, 2012-02

Appendix - Schematics and Layout Appendix - Schematics and Layout 470R 470R 470R 470R LED4 green LED3 green LED2 green LED1 green 1 1 1 1 TP1 PAD_XS TP2 PAD_XS TP3 PAD_XS TP4 PAD_XS A B C D 1 2 3 4 5 6 2 1 COL3 LINE0 4 3 COL4 LINE1 6 5 COL5 LINE2 8 7 AN6 LINE3 R1 R2 R3 R4 10 9 AN5 LINE4 12 11 AN4 LINE5 14 13 AN3 LINE6 16 15 AN2 COL0 18 17 AN1 COL1 20 19 AN0 COL2 GND Touch Sense Application Kit Slider 1 2 3 4 5 6 A B C D Figure 41 intouch Slider Board Schematics Application Note 36 V1.0, 2012-02

LED1 LED2 LED3 AP08129 Appendix - Schematics and Layout Figure 42 intouch Slider Board Componenet Bottom Layout Figure 43 intouch Slider Board Top Layout Application Note 37 V1.0, 2012-02

Appendix - Schematics and Layout Figure 44 intouch Slider Board Bottom Layout Application Note 38 V1.0, 2012-02

Appendix - Schematics and Layout 1 1 1 1 1 TP1 PAD_XS TP2 PAD_XS TP3 PAD_XS TP4 PAD_XS TP5 PAD_XS A B C D 1 2 3 4 5 6 2 1 COL3 LINE0 4 3 COL4 LINE1 6 5 COL5 LINE2 8 7 AN6 LINE3 10 9 AN5 LINE4 12 11 AN4 LINE5 14 13 AN3 LINE6 16 15 AN2 COL0 18 17 AN1 COL1 20 19 AN0 COL2 GND Touch Sense Application Kit Slider 1 2 3 4 5 6 A B C D Figure 45 intouch Slider II Board Schematics Application Note 39 V1.0, 2012-02

Appendix - Schematics and Layout Figure 46 intouch Slider II Board Top Layout Figure 47 intouch Slider II Board Bottom Layout Application Note 40 V1.0, 2012-02

References References The list below provides resources that may be useful to the user. 1. User s Manual - XC83x; 8-Bit Single-Chip Microcontroller 2. Application Note - AP08100 - Configuration for Capacitive Touch-Sense Application 3. Application Note - AP08110 - Design Guidelines for XC82x and XC83x Board Layout 4. Application Note - AP08113 - Capacitive-Touch Color Wheel Implementation 5. Application Note - AP08115 - Design Guidelines for Capacitive Touch-Sensing Application 6. Application Note - AP08121 - Infrared Remote Controller with Capacitive Touch Interface 7. Application Note - AP08122-16-Button Capacitive Touch Interface with XC836T 8. Application Note - AP08124 - XC82/83x Design Guidelines for Electrical Fast Transient (EFT) Protection in Touch-Sense Applications 9. Application Note - AP08126 - Infineon Touch Solutions - intouch Application Kit 10. Application Note - AP08127 - intouch Application Kit - Buttons 11. Application Note - AP08128 - intouch Application Kit - Touch Wheel 12. Application Note - AP08130 - intouch Application Kit - LED Matrix 13. Link to XC83x-Series - www.infineon.com/xc83x 14. Link to Solutions for advanced touch control - www.infineon.com/intouch Application Note 41 V1.0, 2012-02

www.infineon.com Published by Infineon Technologies AG