Table of Contents

Advertisement

Quick Links

CY8C21x34/B
®
CapSense
Design Guide
Doc. No 001-66271 Rev. *B
Cypress Semiconductor
198 Champion Court
San Jose, CA 95134-1709
Phone (USA): 1.800.541.4736
Phone (Intnl): 408.943.2600
http://www.cypress.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CapSense CY8C21x34/B and is the answer not in the manual?

Questions and answers

Summary of Contents for Cypress CapSense CY8C21x34/B

  • Page 1 CY8C21x34/B ® CapSense Design Guide Doc. No 001-66271 Rev. *B Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone (USA): 1.800.541.4736 Phone (Intnl): 408.943.2600 http://www.cypress.com...
  • Page 2 PARTICULAR PURPOSE. Cypress reserves the right to make changes without further notice to the materials described herein. Cypress does not assume any liability arising out of the application or use of any product or circuit described herein. Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user.
  • Page 3: Table Of Contents

    Contents Introduction ..................................7 Abstract ................................. 7 Cypress CapSense Documentation Ecosystem ....................7 CY8C21x34/B CapSense Plus Family Features....................9 1.3.1 Advanced Touch Sensing Features ......................9 1.3.2 Device Features............................9 Document Conventions ............................10 CapSense Technology ..............................11 CapSense Fundamentals ............................ 11 CapSense Methods in CY8C21x34/B ........................
  • Page 4 3.6.6 Debounce ............................... 22 3.6.7 Negative Noise Threshold ........................22 3.6.8 Low Baseline Reset ..........................22 3.6.9 High Level Parameter Recommendations ....................22 CSD User Module Low-Level Parameters ......................23 3.7.1 Scanning Speed ............................. 23 3.7.2 Resolution ............................... 23 3.7.3 Reference ...............................
  • Page 5 Overlay Selection ..............................37 ESD Protection ..............................38 5.2.1 Prevent ..............................38 5.2.2 Redirect ..............................38 5.2.3 Clamp ..............................38 Electromagnetic Compatibility (EMC) Considerations ..................38 5.3.1 Radiated Interference ..........................38 5.3.2 Radiated Emissions ..........................39 5.3.3 Conducted Immunity and Emissions ....................... 39 Software Filtering ..............................
  • Page 6 Website ................................55 Datasheet ................................55 Technical Reference Manual ..........................55 Development Kits ..............................55 9.4.1 Universal CapSense Controller Kit ......................55 9.4.2 Universal CapSense Module Boards ...................... 55 9.4.3 In-Circuit Emulation (ICE) Kit ........................56 PSoC Programmer .............................. 56 MultiChart ................................
  • Page 7: Introduction

    1.2 Cypress CapSense Documentation Ecosystem Figure 1-1 Table 1-1 summarize the Cypress CapSense documentation ecosystem. These resources allow implementers to quickly access the information needed to successfully complete a CapSense product design. Figure 1-1 shows the typical flow of a product design cycle with capacitive sensing; the information in this guide is most pertinent to the topics highlighted in green.
  • Page 8 Preproduction build (prototype) 8. Test and evaluate system functionality and CapSense performance Performance satisfactory Production Table 1-1. Cypress Documents Supporting Numbered Design Tasks of Figure 1-1 Numbered Design Task of Supporting Cypress CapSense Documentation Figure 1-1 Getting Started with CapSense...
  • Page 9: Cy8C21X34/B Capsense Plus Family Features

    1.3 CY8C21x34/B CapSense Plus Family Features Cypress’s CY8C21x34/B is a low-power, high-performance, programmable CapSense controller family that features: 1.3.1 Advanced Touch Sensing Features  Programmable capacitive sensing elements Supports a combination of CapSense buttons, sliders, and proximity sensors with CSD and CSDADC ...
  • Page 10: Document Conventions

    1.4 Document Conventions Convention Usage Displays file locations, user entered text, and source code: Courier New C:\ ...cd\icc\ Displays file names and reference documentation: Italics Read about the sourcefile.hex file in the PSoC Designer User Guide. Displays keyboard commands in procedures: [Bracketed, Bold] [Enter] or [Ctrl] [C] Represents menu paths:...
  • Page 11: Capsense Technology

    2. CapSense Technology 2.1 CapSense Fundamentals CapSense is a touch-sensing technology that works by measuring the capacitance of each I/O pin on the CapSense controller that has been designated as a sensor. As shown in Figure 2-1, the total capacitance on each of the sensor pins can be modeled as equivalent lumped capacitors with values of C through C for a design with n sensors.
  • Page 12 Figure 2-2. Cross Section of Typical CapSense PCB with the Sensor Being Activated by a Finger ε ε Equation 1 Where: = The capacitance affected by a finger in contact with the overlay over a sensor ε = Free space permittivity ε...
  • Page 13: Capsense Methods In Cy8C21X34/B

    2.2 CapSense Methods in CY8C21x34/B CY8C21x34/B devices support several CapSense methods for converting sensor capacitance (C ) into a digital code. These are CapSense Sigma Delta (CSD), CSD with ADC (CSDADC), and SmartSense. These methods are implemented in the form of PSoC Designer User Modules and are described in Section 3 of this design guide.
  • Page 14: Csd With Adc Functionality (Csdadc)

    Figure 2-4. CSD Raw Counts during a Finger Touch 2.2.2 CSD with ADC Functionality (CSDADC) The CSDADC CapSense method functions in an identical manner as CSD except that it is augmented with the ADC functionality in addition to capacitance measurement. 2.2.2.1 ADC Features ...
  • Page 15 SmartSense Auto-tuning makes platform designs possible. Imagine the capacitive touch sensing multimedia keys in a laptop computer; the spacing between the buttons depends on the size of the laptop and keyboard layout. In this example, the wide-screen machine has larger spaces between the buttons than a standard-screen model. More space between buttons means increased trace length between the sensor and the CapSense controller, which leads to higher parasitic capacitance of the sensor.
  • Page 16: Capsense Design Tools

    3. CapSense Design Tools 3.1 Overview of CapSense Design Tools Cypress offers a full line of hardware and software tools for developing your CapSense capacitive touch-sense application. A basic development system for the CY8C21x34/B family includes the components discussed in this chapter.
  • Page 17: Universal Capsense Controller Kit

    Generate the application and switch to Application Editor. Adapt sample code from User Module Datasheet: (CY8C21x34) to implement buttons or sliders. 3.1.2 Universal CapSense Controller Kit The Universal CY3280-BK1 CapSense Controller Kit features predefined control circuitry and plug-in hardware to make prototyping and debugging easy.
  • Page 18: Universal Capsense Controller Module Board

    3.1.3 Universal CapSense Controller Module Board Cypress’s module boards feature a variety of sensors, LEDs, and interfaces to meet your application’s needs.  CY3280-BSM Simple Button Module  CY3280-BMM Matrix Button Module  CY3280-SLM Linear Slider Module  CY3280-SRM Radial Slider Module ...
  • Page 19: Raw Count

    Figure 3-4. Raw Count, Baseline, Difference Count, and Sensor State Raw Count Difference Count (Signal) 3.3.1 Raw Count The hardware circuit in the CapSense controller measures the sensor capacitance. It stores the result in a digital form called raw count upon calling the user module API UMname_ScanSensor(), where UMname can be CSD, CSDADC, or SmartSense.
  • Page 20: Csd User Module Configurations

    Sensor states are updated by the user module API UMname_bIsAnySensorActive() 3.4 CSD User Module Configurations The CSD User Module has two selectable clock configurations. These configurations use different signal sources for the switched-capacitor circuit on the front end of the CSD, as shown in Figure 2-3 on page 13.
  • Page 21: Csd User Module High-Level Parameters

    3.6 CSD User Module High-Level Parameters 3.6.1 Finger Threshold The Finger Threshold parameter is used by the user module to judge the active/inactive state of a sensor. If the Difference Count value of a sensor is greater than the Finger Threshold value, the sensor is judged as active. This definition assumes that Hysteresis is set to zero and Debounce is set to 1.
  • Page 22: Debounce

    Figure 3-6. Sensor State Versus Difference Count with Hysteresis Set to Zero Equation 4 3.6.6 Debounce The Debounce parameter prevents spikes in raw counts from changing the sensor state from OFF to ON. For the sensor state to transition from OFF to ON, the Difference Count value must remain greater than the Finger Threshold value plus the hysteresis level for the number of samples specified.
  • Page 23: Csd User Module Low-Level Parameters

     Negative Noise Threshold: Set equal to Noise Threshold  Low Baseline Reset: Set to 10 3.7 CSD User Module Low-Level Parameters The CSD User Module has several low-level parameters in addition to the high-level parameters. These parameters are specific to the CSD sensing method and determine how raw count data is acquired from the sensor. 3.7.1 Scanning Speed This parameter sets the sensor scanning speed.
  • Page 24: Reference

    3.7.3 Reference A voltage reference to the input of the comparator is required for the proper operation of CSD. Possible values are:  VBG: Internal voltage reference of 1.3 V derived from a fixed bandgap reference.  ASE11: Internal variable voltage reference derived from a PWM. ...
  • Page 25: Csdadc With Pwm8 Clock Source

    Because it needs a lower switching frequency, you should use configuration when operating in an environment with high C , The relationship between C and switching frequency is discussed in CapSense Performance Tuning with User Modules. 3.8.3 CSDADC with PWM8 Clock Source In this configuration, IMO is divided by an adjustable prescaler divider and used for the switched capacitor circuit on the front end of the CSD.
  • Page 26: Reference

    3.10.3 Reference A voltage reference to the input of the comparator is required for the proper operation of CSD. Possible values are:  VBG: Internal voltage reference of 1.3 V derived from a fixed band-gap reference.  ASE11: Internal variable voltage reference derived from a PWM. ...
  • Page 27: Smartsense User Module Parameters

    3.11 SmartSense User Module Parameters Figure 3-8. PSoC Designer SmartSense Parameters High-Level Low-Level Low-Level High-Level Low-Level 3.12 Low-Level Parameters 3.12.1 Shield Electrode Out A shield electrode is used to reduce parasitic capacitance. The shield electrode signal can be routed to one of the free digital row buses (Row_0_Output_1 –...
  • Page 28: Finger Threshold

    3.12.6 Finger Threshold This parameter is applicable only when threshold setting mode is set to Manual mode. It is recommended that you set this value to 80 percent of the sensor signal stored in the SmartSense_baSnSSignal[] array. This array can be easily monitored using I C or UART communication protocols.
  • Page 29: Capsense Performance Tuning With User Modules

    4. CapSense Performance Tuning with User Modules Optimal user module parameter settings depend on board layout, button dimensions, overlay material, and application requirements. These factors are discussed in Design Considerations. Tuning is the process of identifying the optimal parameter settings for robust and reliable sensor operation. 4.1 General Considerations 4.1.1 Signal, Noise, and SNR A well-tuned CapSense system reliably discriminates between ON and OFF sensor states.
  • Page 30: Charge/Discharge Rate

    4.1.1.2 CapSense Noise CapSense noise is the peak-to-peak variation in sensor response when a finger is not present, as shown in Figure 4-2. In this example, the output waveform without a finger is bounded by a minimum of 5912 counts and a maximum of 5938 counts.
  • Page 31: Importance Of Baseline Update Threshold Verification

    Figure 4-3. Charge/Discharge Waveforms >= 10*R Vref Vref Make sure to set the charge/discharge rate to a level that is compatible with this RC time constant. The rule of thumb is to allow a period of 5RC for each transition, with two transitions per period (one charge, one discharge).The equations for minimum time period and maximum frequency are: Equation 5 Equation 6...
  • Page 32: Tuning The Csd And Csdadc User Modules

    4.2 Tuning the CSD and CSDADC User Modules Figure 4-4. Tuning CSD and CSDADC User Modules ® Document No. 001-66271 Rev. *B CY8C21x34/B CapSense Design Guide...
  • Page 33: Set Up Hardware And Software For Tuning

    4.2.1 Set Up Hardware and Software for Tuning Before starting the tuning process, certain hardware and software tools are required. They are listed in the Overview of CapSense Design Tools. Tuning requires monitoring the raw counts, baseline, and difference counts of the sensors through a communication interface.
  • Page 34: Set High-Level Parameters

    raw count value in a no touch condition. Increasing R also decreases the maximum capacitance value that can be measured by the CapSense sensor. Figure 4-5. CSD Measurement Range Measurement Range with Measurement Range with RawCount 2 > R RawCount Difference 70% (2 count...
  • Page 35  Under Global Settings in the CapSense wizard, assign one sensor under the category "Button". Select the modulation Capacitor and Feedback resistor pin as well. Set the threshold setting mode as manual, and disable the Median and IIR filters. Ensure that in the board, the Rb value is 15 K and the Cmod is 10 nF. ...
  • Page 36 Figure 4-7. Monitoring the Sensor Signal baSnsSignal Now open the CapSense wizard, and under the Sensor Settings tab set the finger threshold to the calculated value (it is 100 for the example as shown in Figure 4-7). The SmartSense sensor tuning process is completed with the previous step. However, there could be scenarios where the SNR achieved in Step 5 is below 5:1, for example, when using a thicker overlay.
  • Page 37: Design Considerations

    5. Design Considerations When designing capacitive touch sense technology into your application, it is crucial to keep in mind that the CapSense device exists within a larger framework. Careful attention to every level of detail from PCB layout to user interface to end-use operating environment will lead to robust and reliable system performance.
  • Page 38: Esd Protection

    5.2 ESD Protection Robust ESD tolerance is a natural byproduct of careful system design. By considering how contact discharge will occur in your end product, particularly in your user interface, it is possible to withstand an 18-kV discharge event without incurring any damage to the CapSense controller. CapSense controller pins can withstand a direct 2-kV event.
  • Page 39: Radiated Emissions

    C, and SPI is 330 Ω.  The recommended series resistance for communication lines, such as I  Trace Length: Minimize trace length whenever possible.  Current Loop Area: Minimize the return path for current. Provide hatched ground instead of solid fill within 1 cm of the sensors and traces to reduce the impact of parasitic capacitance.
  • Page 40: Power Consumption

    Table 5-4 shows the RAM and flash requirements for different software filters. The amount of flash required for each filter type depends on the performance of the compiler. The requirements listed here are for both the ImageCraft compiler and the ImageCraft Pro compiler Table 5-4.
  • Page 41: Response Time Versus Power Consumption

    The average power consumed by the device can be calculated as follows: Equation 12 Where: = supply voltage = average current An Excel-based average power consumption calculator is available. Click here to download the calculator. 5.5.3 Response Time versus Power Consumption As illustrated in Equation 12, the average power consumption can be reduced by decreasing I or V may be...
  • Page 42: Pin Assignments

    5.6 Pin Assignments An effective method to reduce interaction between CapSense sensor traces and communication and non-CapSense traces is to isolate each by port assignment. Figure 5-2 shows a basic version of this isolation for a 32-pin QFN package. Because each function is isolated, the CapSense controller is oriented such that there is no crossing of communication, LED, and sensing traces.
  • Page 43: Water Tolerance

    6. Water Tolerance Some CapSense capacitive touch-sensing applications require reliable operation in the presence of water. White goods, automotive applications, and industrial applications are examples of systems that must perform in environments that include water, ice, and humidity changes. For such applications, shield electrodes and guard sensors can provide robust touch sensing.
  • Page 44 Figure 6-2. Capacitance Measurement with Water Drop  – Capacitance between the water drop and shield electrode The purpose of the shield electrode is to set up an electric field around the touch sensors that helps attenuate the effects of water. The shield electrode works by mirroring the voltage of the touch sensor on the shield. Follow these guidelines to ensure proper shield operation: ...
  • Page 45 Figure 6-3. Schematic View of Digital Interconnect Select Row_0_Output_2_Drive_0 and select GlobalOutEven_2 as shown in Figure 6-4. Figure 6-4. Schematic View of Output Select Click on GlobalOutEven_2 and select P0{2] in the Pin option as shown in the following figure. ®...
  • Page 46: Guard Sensor

    6.1.2 Guard Sensor Figure 6-5. PCB with Shield and Guard Sensor Shield Electrode Guard Sensor Sensor Pads ® Document No. 001-66271 Rev. *B CY8C21x34/B CapSense Design Guide...
  • Page 47 A guard sensor is a copper trace, as shown in Figure 6-5, that surrounds all the sensors on the PCB, which is used to detect the presence of a continuous water stream. When a water stream is present on the sensing surface, a large- capacitance C is added to the system, as shown in Figure...
  • Page 48: Design Recommendations

    Figure 6-7. Flow Chart to Implement the Guard Sensor Start of main function Initialize CapSense block and other blocks Scan all sensors including Guard sensor Update baseline of all sensors Is Guard Sensor ON? Turn off all the sensors Guard sensor counter elapsed? Report sensor status normally End of main function...
  • Page 49: Proximity Sensing

    7. Proximity Sensing Proximity sensors detect the presence of a hand or other conductive object before it makes contact with the capacitive touch surface. Imagine a hand stretched out to operate a car audio system in the dark. Proximity detection enables the system to light up with the approach of a finger.
  • Page 50: Design Recommendations

    7.2 Design Recommendations Using a shield electrode effectively extends the detection distance of the proximity sensor. This is particularly helpful when the proximity sensor must operate in the presence of metal. A wire sensor increases the beneficial effect of the shield electrode because it can be located farther from the shield electrode.
  • Page 51: Low Power Design Considerations

    8. Low Power Design Considerations Power consumption is an important aspect of microcontroller designs. Among the several techniques to reduce the average current used by the CapSense controller, sleep mode is the most popular. The CapSense controller uses sleep mode when it is not required to perform any function, similar to a cell phone backlight dimming after an idle period.
  • Page 52: Putting It All Together

    8.1.2 Putting it All Together The following code is a sample of a typical sleep preparation sequence for a 28-pin part. In this sequence, interrupts are disabled, the analog circuitry is turned off, all drive modes are set to Analog HI-Z, and interrupts are re-enabled. void PSoC_Sleep(void){ M8C_DisableGInt;...
  • Page 53: Post Wakeup Execution Sequence

    8.2 Post Wakeup Execution Sequence If the CapSense controller is awakened through a reset, then execution starts at the beginning of the boot code. If the CapSense controller is awakened by an interrupt service routine, the first instruction to execute is the one immediately following the sleep instruction.
  • Page 54 Figure 8-1. Sleep Timer User Module Block Diagram ® Document No. 001-66271 Rev. *B CY8C21x34/B CapSense Design Guide...
  • Page 55: Resources

     CY8C21234B, CY8C21334B, CY8C21434B, CY8C21534B, CY8C21634B 9.3 Technical Reference Manual Cypress has created the following technical reference manual to provide quick and easy access to information on CapSense controller functionality, including top-level architectural diagrams, registers, and timing diagrams.  CY8CPLC20,...
  • Page 56: In-Circuit Emulation (Ice) Kit

    PSoC Designer comes with a built-in C compiler and an embedded programmer. A pro compiler is available for complex designs. 9.8 Code Examples Cypress offers a large collection of code examples to get your design up and running fast.  Power Consumption With CapSense (CSD) on CY8C21x34 Device - EP65489 ...
  • Page 57: Design Support

     CSD with SPIS on CY8C21x34 9.9 Design Support Cypress has many design support channels to ensure the success of your CapSense solutions.  Knowledge Base Articles –Browse technical articles by product family or perform a search on various CapSense topics.

Table of Contents