Incorporating a Capacitive Touch Interface into Your Design Renesas Electronics America Inc.
Renesas Technology & Solution Portfolio 2
Microcontroller and Microprocessor Line-up 2010 2012 32-bit 8/16-bit 1200 DMIPS, Superscalar Automotive & Industrial, 65nm 600µA/MHz, 1.5µA standby 500 DMIPS, Low Power Automotive & Industrial, 90nm 600µA/MHz, 1.5µA standby 165 DMIPS, FPU, DSC Industrial, 90nm 200µA/MHz, 1.6µA deep standby 25 DMIPS, Low Power Industrial & Automotive, 150nm 190µA/MHz, 0.3µA standby 10 DMIPS, Capacitive Touch Wide Industrial Format & LCDs Automotive, 130nm 350µA/MHz, 1µA standby 1200 DMIPS, Performance Automotive, 40nm 500µA/MHz, 35µA deep standby 165 DMIPS, FPU, DSC Industrial, 40nm 200µA/MHz, 0.3µA deep standby Embedded Security, ASSP Industrial, 90nm 1mA/MHz, 100µA standby 44 DMIPS, True Low Power Industrial & Automotive, 130nm 144µA/MHz, 0.2µA standby 3
Enabling The Smart Society Challenge: Embedded designs are increasingly being incorporated in new, innovated interfaces. How can the engineer keep up with the increased demand for users desires for enhanced user interfaces. Solution: Let s investigate one of those highly desired interfaces, capacitive touch! 4
Agenda Touch Basics What is Capacitive Touch Detection methods Simple touch sensing Transforming analog to digital Renesas Touch Solution Hardware implementation Software overview Available Solution Capacitive Touch Lab Q&A 5
Touch Basics 6 6
What is Capacitive Touch? Solution Components Flat, non-conductive surface Capacitive circuitry Electrode pads Connecting circuits Springs or other conductive elements Detection system Measures change in capacitance Touch Detection Capacitance change = touch? 7
Touch Sensing Model Based on plate capacitance model C = cap. in farads (F). A = plate area d = distance between plates k = dielectric constant E = permittivity of free space Basic Operation Object detected = 1 plate Electrode = other plate Typically: Bigger object = bigger plate area = bigger cap change Large electrodes = bigger plate area = more sensitive Thicker dielectric = less change in C = less sensitive 8
Types of Capacitive Touch Detection Methods Mutual Capacitance * Power Consumption: Medium/High Emissions: Medium/High Immunity: Medium/High Renesas Method Self Capacitance * Power Consumption: Low Emissions: Low Immunity: Medium * Attributes may vary depending on implementation 9
Capacitive Sensing 10 10
Simplified Hardware Circuit Major components Charge Circuit Circuit Control Capacitance Detection Touch Electrode 11
Circuit Operation Charge circuit Vct Cr Cx Rc Cc 12
Circuit Operation Waveform process RC charge formula 13
Circuit Operation Quick discharge Vct 14
Circuit Operation RC discharge formula 15
Circuit Operation Charge re-distribution Vct 16
Circuit Operation Charge re-distribution Charge re-distribution Charge re-distribution Vct = Vc * (Cr / Cr + Cx) 17
Circuit Operation Continue process till Test if Vct below Vref No = Count channel up Yes = Cycle complete Charge re-distribution 18
Circuit Operation Repeat discharge and re-distribution Test if Vct below Vref No = Count channel up Yes = Cycle complete 19
Touch Detection 20 20
Effect of Touch Adding object adds capacitance 22
Touch Sampling Quicker re-distribution/discharge 23
Touch Analog to Digital Tracking counts vs. time Counts Time 24
Touch Analog to Digital 25 25
Touch-Sensor Control Unit 26 26
Why Develop Hardware? How could we control the switches shown in the diagram? Would our timing need to be accurate? How would you measure the discharge curve voltage? 27 27
T-SCU (Touch-Sensor Control Unit) T-SCU performs: Sequencing and timing of the charge/discharge Key scanning High-frequency filtering Interrupt Generation Data Transfers DTC or DMA T-SCU T-SCU Features Up to 36 channel sense capability Single, scan, or selective scan modes S/W or H/W scan kickoff 28 28
R8C T-SCU CPU Utilization R8C/3xT SCU performs touch scanning autonomously In software solution, CPU is utilized 100% Softwarebased solution CPU CPU Active (Touch Scanning) CPU Active (System Functions) R8C/3xT Option A CPU SCU System Functions Scanning + Data Transfer CPU Active (Touch Post Processing) R8C/3xT Option B CPU SCU CLK Not Operating Scanning + Data Transfer Less than 15% of total CPU time (20MHz) 29
T-SCU Scan Sequence Complete scan example using Ch 0 to Ch 2 T-SCU Data Transfer to RAM Buffer SCSTRT (Start bit) User Code running T-SCU Operating Ch 0 Measure T-SCU DTC Ch 0 User Code running T-SCU Operating Ch 1 Measure T-SCU DTC Ch 1 User Code running T-SCU Operating Ch 2 Measure T-SCU DTC Ch 2 T-SCU Interrupt Touch SW Processing Scan is started by program Note: Time for operations not to scale 30 30
T-SCU Data Storage Count data is transferred by DTC to RAM Buffer Start address of buffer is set in T-SCU Destination Register Dedicated RAM Example Scan channel 0-2 in ascending order T-SCU Destination Register = 0C00h start Measure Ch 0 Measure Ch 1 Measure Ch 2 0C00h 0C01h 0C02h 0C03h 0C04h 0C05h 0C06h 0C07h 0C08h 0C09h 0C0Ah 0C0Bh CH0 dataa CH0 datad CH1 dataa CH1 datad CH2 dataa CH2 datad T-SCU Interrupt 31 31
T-SCU Low Power Operation Core can be in Wait mode T-SCU trigger from Timer for sampling interval Once scan is completed DMA (not DTC) transfers data to RAM Utilizes a special SDMA block DMA interrupt wakes MCU on transfer complete Touch determination made No touch MCU back to sleep Touch - MCU services button 33 33
Low-power Example Example using Timer as Trigger Wait mode Wait mode Power Consumption normal process T-SCU not operating T-SCU touch detection Touch Data processing T-SCU not operating T-SCU touch detection Touch Data processing Timer trigger Enable T-SCU (via S/W) Start trigger (internal) T-SCU DMA transfers touch data to RAM Buffer so MCU does not wake up until DMA Interrupt occurs 34 34
Flexible Tuning Capability Dual Comparison Capacitor Aids in tuning flexibility Selectable via H/W register Reconfigurable during operation Long electrodes Choose Cr1 (CHxA1) CHxA0 Rr Cr0 CHxA1 Cr1 CH Selector CHxB Rc CHxC Cc Shorter electrodes Choose Cr0 (CHxA0) 35
Improving Noise immunity 20MHz Sample Clock Decreased measurement cycle reduces noise influence Larger internal registers Higher count values Touch waveform with noise influence Inverter Noise Noise influence Correct level Measure point @20MHz clock High speed sample clock is effective for reducing noise 36
Renesas Touch Software 37 37
Implementation Overview Three Distinct Layers User Application Application Layer Renesas API covers: Tscu_mode Slider position Wheel position Sensor On/Off Drift On/Off T-T-SCU Driver SetTscuMode GetSliderPosition GetWheelPosition GetTouchOnOff SetTscuDcen Basic Touch Decision Slider/Wheel Auto Calibration Slider Position Detection Functional Implementation interface Layer Wheel Position Detection Touch position Detection User Application Typical interface thru USER API Low-level functions/data can be accessed as well from any level Auto Calibration Drift Correction Measurement value output Reference Value Calculation S/W Noise Filter H/W interface Layer Full-source code available H/W Noise Filter TSCU Driver 38
Touch API Configuration Touch API Overview Base API and User API Base API controls TT-SCU measurement and low-level touch decision User API allows setup and acquisition of touch data from application level Five (5) Source Files Needed touch_control.c touch_user_api.c touch_interrupt.c slider_control.c wheel_control.c 39
Touch API Functionality Major Base API Functions Data movement and TT-SCU interrupt process Low-level touch decision Drift correction Automatic calibration Multi Touch Cancellation New User API Functions Wheel position detection Slider position detection Start/Stop of TT-SCU measurement Drift compensation enable/disable 40
Touch API Features Drift Compensation Monitors continuously Reduces environmental effects Suspended if touched 41 41
Integrated Wheel Processing Configurable Wheel Setting Uses updated wheel shapes 4 or 8 channels selectable Positional The range of the position value is from zero to 72 When the value is zero the wheel is not touched API variable returns information 42
Integrated Slider Processing Configurable Slider 6 channels implementation Configurable Resolution Currently up to 256 positions Features Reports position on touch User code determines direction API variable returns information for processing CH0 CH1 CH2 CH3 CH4 CH5 43
Renesas Touch Solution 44 44
R8C/3xT-A Features CPU Core 16-bit R8C CPU Core with built-in hardware multiplier Single-cycle memory access Touch T-SCU Up to 36 channels ~8 ms for scanning 36 channels Tuning dependent Memory ROM: up to 128KB SRAM: up to 10KB Power Supply 1.8V to 5.5V Clocks Hi-Speed and Low Speed OCO XCIN and XIN Analog 20 channels, 10-bit Communication SPI, UART, I 2 C (SSU block), LIN Package 80 pin LQFP (14x14) Program Flash up to 128KB Memory SRAM up to 10KB Data Flash up to 4KB DTC Clock Generation Internal, External POR, LVD System Event Link Controller Interrupt Controller Debug Single-Wire Low Speed Low Mode Speed Mode Power Wait Management Mode Wait Mode STOP Mode STOP SRAM Mode On SRAM On T-SCU Touch DMA ADC 10-bit, 20 ch Analog On-Chip Voltage Reference 1 x Timer 8-bit 3 Timers x Timer 16-bit WDT Program Code Protect Register Protect Safety Clock Monitoring CRC 1 x I 2 C 1 x SSU Communication SPI Compatible 3x UART 7, 8-bit 1 x LIN 1ch 46
Renesas Touch Evaluation Kit Renesas Demo Kit for R8C/36T-A Full featured development platform Includes E1debugger HEW IDE environment and trial compiler Touch software source included Workbench tuning tool included 47
Touch Application Notes Application notes Hardware Design Power Supplies Noise Tech Briefs Humidity Temperature Design Guides Tuning Guidelines Layout Recommendations Spring Usage 48 48
Advanced Tuning Tools Intuitive GUI Measurement Parameter Setting Circuit Modeling 49
Questions? 50
Enabling The Smart Society Challenge: Embedded designs are increasingly being incorporated in new, innovated interfaces. How can the engineer keep up with the increased demand for users desires for enhanced user interfaces. Solution: Let s investigate one of those highly desired interfaces, capacitive touch! Do you agree that we accomplished the above statement? 51
Renesas Electronics America Inc.