PSoC® 4 CapSense® Troubleshooting Guide - KBA219217

Version: **

 

Answer:

This guide helps to troubleshoot the common issues that can occur in PSoC 4 CapSense-based designs. If you are new to PSoC and CapSense, get started with AN64846 - Getting Started with CapSense®, and follow the recommendations provided in PSoC 4 CapSense design guide. This troubleshooting guide covers the Component configuration of CSD3.10. More references are provided in the Appendix section of this document. 

 
  1. There are touch issues in my design. What is the reason for this? How can this be solved?

This includes 

  • touch not detected when the sensor is touched
  • false touches

Steps to debug the issue:

Touch issues can be related to either hardware or firmware. Follow the recommended schematic and layout guidelines provided in PSoC 4 CapSense design guide. Refer to sections 6.4.12 and 6.4.13 for schematic and layout checklist. If you want to proceed without changing the hardware, you may try the following suggestion but if you are not able to resolve the issue by the following methods, you may need to change the hardware. Refer to 1.C.Hardware for hardware changes. Follow the steps sequentially as given in the flowchart.

Flow Chart

FlowChart

 

A. BIST:

Run BIST APIs and ensure that all of them pass. BIST APIs are included in the CapSense Component and include tests such as sensor shorts and sensor parasitic capacitance. If any BIST API fails, check the schematic and checklist and fix the issue. If the parasitic capacitance is high (>45pF), use manual tuning. 

Note:

i. To use BIST APIs, the self-test library should be enabled in the Component configuration (Figure 1).

Figure 1

figure 1

ii. SmartSense cannot be used when BIST is enabled. If you are using SmartSense tuning, switch to manual tuning and perform BIST and then switch again to SmartSense tuning. 

 

B. Check Tuning: There are three different modes of tuning. Observe the CapSense data (rawcount, baseline, signal, IDAC, etc. ) during the debug process. You may use the Tuner GUI that comes with the CapSense Component to observe CapSense data and modify CapSense parameters. Bridge Control Panel can also used for CapSense data monitoring. You should be able to determine the SNR during this stage. Refer to Chapter 5 in CapSense Design guide for more details. The CSX sensing supports only manual tuning mode currently. 

 

i. SmartSense Full Auto-Tune

a. The button not detected:

  • Finger capacitance:
      In this tuning mode, finger capacitance is the only configurable parameter. For the button to be detected, the signal obtained when the sensor is touched should be greater than finger threshold plus hysteresis. The SmartSense will set the finger threshold and hysteresis parameter. If the signal is lesser than finger threshold plus hysteresis, the finger capacitance value should be decreased until the condition is met. Measure the peak-peak noise in the rawcount and the signal when the sensor is touched. Set the value of finger capacitance (Figure 2) such that the signal obtained meets SNR more than 5:1. If it is not possible to get more than 5:1 SNR even when finger capacitance is 0.1, you may need to switch to SmartSense Hardware parameters only or Manual tuning mode. If there is higher noise which causes poor SNR, check the ‘Noise’ section to reduce the noise. 

Threshold: 
In this tuning mode, SmartSense sets all thresholds. The finger threshold and hysteresis are discussed in the previous point. Another important threshold parameter is noise threshold. If there are the baseline tracks in the rawcount when the sensor is touched, the signal will be low resulting in no touch. Decreasing the finger capacitance value can help in this case; if not, change to SmartSense Hardware parameters only or Manual tuning mode. 
SmartSense doesn’t work if the sensor parasitic capacitance is high. You can enable the compensation IDAC in that case. 

If it doesn’t help, you need to switch to manual tuning mode

Figure 2 

figure 2

 

b. False touches 
Noise:

  • One of the major causes for false touches is noise. If noise of the sensor is high, observe the pattern of noise and enable appropriate firmware filters available in the CapSense Component (Figure 3). See page 17 of the CapSense datasheet for details of filters.

Figure 3 

figure 3

  • If the noise is present only for a few samples, increase the ON debounce to eliminate false touches (response time will be slower). Change to SmartSense Hardware parameters only or Manual tuning mode to use this parameter
  • Do not have oversensitive sensors because noise will be higher and false touch can occur when neighboring sensor is touched.

Noise threshold also play a role in eliminating the noise in the signal. If the noise is greater than the noise threshold and there is gradually increase in rawcounts, the sensor can get stuck. In this case, change to SmartSense Hardware parameters only or Manual tuning mode.

 

ii. SmartSense Hardware parameters only

The only difference between SmartSense Auto-Tune mode and this mode is that you can set the threshold values in this mode. The troubleshooting procedure is similar to the steps given in Section 1.C.i except that the threshold parameters are also configurable. 

a. The button not detected:

  • Finger capacitance:
      Measure the peak-peak noise in the rawcount and the signal when the sensor is touched. Set the value of finger capacitance (Figure 2) such that the signal obtained meets SNR more than 5:1 (Since higher noise threshold can cause the baseline to track the rawcount, the noise threshold should be set to a lower value during this measurement). If the SNR is less than 5:1 even when finger capacitance is 0.1, you may need to switch to Manual tuning mode. If there is higher noise which causes poor SNR, check 'Noise' section to reduce the noise. 
  • Thresholds: 
     
      Setting the threshold parameters for each widget is important to correctly detect touches (Figure 4). The recommended values for these thresholds are as follows: 

     Finger Threshold = 80% of signal
     Noise Threshold = Negative Noise Threshold = 50% of Finger Threshold
     Hysteresis = 12.5% of Finger Threshold
     ON Debounce should be set appropriately. Higher value can miss touches.

Figure 4

figure 4

SmartSense doesn’t work if the sensor parasitic capacitance is high. You can enable the compensation IDAC in that case; if it doesn’t help, you need to switch to manual tuning mode.

 

b. False touch:

Refer to section 1.C.i.b which has the steps to avoid false touches

 

iii. Manual tuning

When using Manual tuning mode, set all CapSense parameters correctly. Detailed procedure for manual tuning is given in Section 5.3 of the CapSense Design guide. The following section will help to troubleshoot the issue. If there are touch issues when using manual tuning, check if the following parameters are set correctly. 

a. The button not detected:

  • Setting correct hardware parameters:
      Check Sense clock frequency / TX frequency:

Ensure the sense clock frequency / TX frequency is set such that the sensor charges and discharges completely for CSD and CSX sensor respectively. 

F<sub>max</sub>= 1  / R<sub>series</sub> * Cp

Cp can be obtained from the BIST API or the LCR meter

R<sub>series</sub> is the sum of internal resistance (500 ohm) plus series resistance in the capsense lines

There are different sources for the clock (Figure 5)

  • Direct
  • PRS (only for CSD sensing)
  • SSC (only in 4th gen CapSense PSoC 4S devices, PSoC Analog co-processor)

For EMC applications, PRS and SSC clocks are recommended. PRS is preferred for higher sense clock frequencies and SSC for lower sense clock frequencies. For CSX, SSC can be used. Refer to Section 5.3.2.2.1 in the CapSense Design guide for PRS and SSC consideration.

Figure 5 

figure 5

Check the rawcount calibration:
If the IDAC auto-calibration is enabled, the rawcount is expected to be as follows: 

  • 85% of the maximum value for the CSD sensing with single IDAC mode
  • 70% of the maximum value for the CSD sensing with dual IDAC mode
  • 40% of the maximum value for the CSX sensing.
  • If there is any big variation in these values, it indicates that there is some issue with auto calibration. In such cases, you may have to check with manual calibration. If IDAC auto calibration is disabled, set the IDAC (Figure 6) to ensure the rawcount is calibrated correctly (85%, 70%, 40%). 

Figure 6

figure 6

 Resolution / Sub-conversion:
These parameters are similar to the finger capacitance used in SmartSense. Measure the peak-peak noise in the rawcount. Set the value of resolution/sub-conversion such that the signal obtained meets SNR more than 5:1 for CSD/CSX respectively. (Since a higher noise threshold can cause the baseline to track the rawcount, the noise threshold should be set to a lower value during this measurement). 

Figure 7 

figure 7

Figure 8

figure 8

If there is higher noise which causes poor SNR, check the ‘Noise’ section to reduce the noise. If you unable to get SNR of atleast 5:1 after the hardware parameters are set, you may need to modify the hardware

Thresholds:
Refer the Thresholds section 1.C.ii.a in SmartSense Hardware parameters only.

 

b. False touches: 

Noise:
Refer to section 1.C.i.b for noise issues.

At the end of the ‘Check tuning’ step, you should get SNR more than 5:1 and ensure the IDAC calibration is done correctly. If the CapSense sensor works correctly in the tuner but doesn’t work in the application, check the project; check the hardware otherwise. 

 

C. Hardware changes:

The following are some suggestions for hardware changes depending on the issue. For the complete hardware recommendations, see the PSoC 4 CapSense design guide

i. Touch not detected: 

a. Sensor size:
 If the sensor size is small compared to the touch area, increase the sensor size so that there is more coupling between the sensor and finger. If the sensor size is larger than recommended, Cp will be high. 

b. Overlay:
  For CSD, the thickness of the overlay can be reduced if the finger capacitance added is very small. Ensure that there is no air gap between the sensor and overlay. A CSX design needs an overlay of at least 0.5 mm to work. Use only a non-metallic overlay.

c. Cp, Cm: 
  For CSD, the sensitivity for the higher Cp will be poor. Do not have a solid ground fill; use a hatch ground fill instead. If Cp is high even for hatch ground fill, drive the hatch pattern with the shield signal. However, this can result in higher emission and lower noise immunity. Do not increase the trace length/width from the recommended value. For CSX design, the initial Cm between TX and RX should be at least 1 pF.

ii. False touches:

a. Grounding:
    Check if the hatch ground of the recommended filling is used and the ground return path is as short as possible. Refer to the detailed grounding implementation in Section 6.4.9 in CapSense Design guide.

b. Power supply:
    Ensure that the power supply is good and the decoupling capacitors are placed close to the device pins

c. Crosstalk:
   If there are any digital or communication lines close to CapSense lines, it can lead to cross talk. Separate these lines from CapSense lines; if not, use ground traces between them. 

 

D. Project verification:

If CapSense works in the tuner but doesn’t work as expected in application, the issues could be because of improper firmware flow. Refer to the example projects familiarize yourself with the CapSense Component. 

2. Rawcount in my design is saturated. What is the reason for this? How can this be solved?

A. If the rawcount saturates when auto calibration is enabled, it is not able to find the proper IDAC value. In such cases, check with manual calibration instead.
B. When using manual calibration, set the IDAC values correctly (Figure 6). Setting a very low value can saturate the rawcount
C. When the sensor clock frequency is very high, the sensor will be not able to charge and discharge completely. The switching waveform on sensor should be monitored. The sensor parasitic capacitance (Cp) and series resistance (Rs) should be estimated and the frequency should be lower than 1/(10RC) (Figure 9).
D. Rawcounts will change if there is change in environmental conditions such as temperature and humidity due to change in the capacitance. For a slow variation, the baseline update algorithm will handle these variations.

Figure 9

figure 9

3. CapSense doesn’t work over temperature/humidity. What is the reason for this? How can this be solved?

A. Typically, auto calibration will calibrate the IDAC such that rawcounts are calibrated to 85%, 70%, and 40% of the maximum value for CSD single IDAC, CSD dual IDAC, and CSX respectively . When there is a change in temperature, rawcount may increase due to which there could be rawcount saturation. In such cases, auto calibration can be disabled and the IDAC can be manually set (Figure 6). CapSense_CSDCalibrateWidget () API can be used to set the rawcount to a particular percentage. 

Note: There are flat stops in the CSD characteristics at 25%, 50%, and 75% of the maximum value. Use the PRS mode of the clock to reduce flat spots.

B. Threshold parameters can be changed based on the change in temperature. 
C. Set the baseline filter with low order so that baseline tracks the rawcount faster
D. Sensor auto reset can be used to avoid the rawcount getting stuck but still false touches will be present. 
E. Use a higher-order IIR filter to reduce the ramp due to temperature. 

4. Response time of the button is very slow. What is the reason for this? How can this be solved?

A. Set the Modular clock frequency to the highest value because it is proportional to the scan time (Figure 10)

Figure 10

figure 10

B. The high order filter will affect the responsiveness (Figure 3)
C. Higher ON debounce value can cause a long response time (Figure 4).
D. In low-power modes, choose an optimal wake-up interval considering both power consumption and response time.
E. Having a higher resolution/lower finger capacitance/sub-conversion takes more scan time. Ensure that the scan time of the sensors is set to an optimal value to ensure an SNR of 5:1.

5. Why is non-linearity observed in rawcount characteristics? What is the reason for this? How can this be solved?

CapSense is based on Sigma-Delta Modulator; nonlinearity is unavoidable in this. Flat spots occur at 25%, 50%, and 75% of the maximum value. To overcome nonlinearity issues, use PRS as the clock source. Refer to Section in 5.3.2.1.2 in CapSense Design guide

6. Shield waveform is not the same as the sensor waveform. What is the reason for this? How can this be solved? 

Figure 11

figure 11

Shield is used in proximity/water tolerance applications. When the shield capacitance is very high, it will not be able to charge/discharge completely. In this case, use a shield tank capacitor of 10 nF and enable it in the CapSense Component (Figure 11). Use the shield electrode delay if waveforms have phase delay.

Note: For 4th gen CapSense devices (PSoC 4S devices, PSoC Analog Coprocessor), a shield tank capacitor cannot be used when both CSD and CSX are used.

7. CapSense consumes more power. How can this be reduced? 

    Ensure that the following considerations are taken into account for low-power CapSense designs:
A. The response time must be as fast as possible. Refer Q4.
B. During CapSense scan, put the device to sleep mode.
C. Put the device to deep-sleep mode when scan is completed. Wakeup can be configured to generate an interrupt at regular period to wake the device and do a CapSense scan
D. If the CapSense design has only one sensor, use the CapSense_CSDSetupWidgetExt() and CapSense_CSDScanExt() advanced APIs
E. If the design consists of many CapSense sensors, gang all the sensors and scan them as a single sensor until a button touch of some duration. If a touch detected, all sensors scan be scanned individually again (Figure 12).

Figure 12

figure 12

F. Similar to ganging, if there is no touch detected for some duration, increase the wake-up interrupt interval for a longer duration. This is known as dual-rate scan

Refer to the Low power CapSense design Application Note for more information. 

8. Linear Slider-specific issues 

A. Check if the CapSense slider design rule is followed correctly. The parasitic capacitance of the slider should be uniform for good linearity. 
B. When the slider is not touched, the centroid position returned will be 0xFF. When there are multiple touches on the slider, the lowest position will be reported. 
C. When duplexing is enabled, the sensor assignment should be as per the recommendation. For details of the sensor assignment, refer to page no.98 of the CapSense datasheet

Figure 13

figure 13

9. Radial Slider specific issues: 

A. The radial slider pattern should be a complete circle. If the pattern is incomplete, the centroid position when the last element is touched will not be equal to the maximum value. Refer to the centroid calculation algorithm given in the page96 of the CapSense datasheet.
B. A position filter is not recommended for a radial slider. When used, there will be an unexpected value when moving from the last to the first element and vice versa. 

10. Tuner-specific issues:
      
 A. Check whether EZI2C is started and buffer is set to CapSense

            EZI2C_EzI2CSetBuffer1(sizeof(CapSense_dsRam),sizeof(CapSense_dsRam),(uint8*)&CapSense_dsRam);

      B. Check whether the I2C-to-USB bridge connections are configured properly

      C. Check whether the I2C device with the given address is listed in Bridge Control Panel (Figure 14).

Figure 14

figure 14

Note: If the I2C-to-USB bridge is connected to Bridge Control Panel or any other application, it will be listed in the Tuner GUI. In such cases, disconnect the bridge from the application and connect it to the Tuner GUI. D. Verify that I2C settings in the Tuner GUI are identical to the settings of the EZI2C Component (Figure 15).

Figure 15

figure 15figure 15

E. If you want to change the CapSense parameter, sync'd read 
   should be enabled (Figure 16) and CapSense_RunTuner() API should be called after each scan.

Figure 16

figure 16

F. Before putting to deep-sleep, check the EZI2C communication status. Put the device to deep-sleep only when the I2C communication is not busy. 
G. CapSense scan should happen continuously. If there is no CapSense scan for 5 seconds, the Tuner generates an error. This should be taken care of in the low-power mode designs.

11.CapSense sensor is active only for some duration and then turned off. What is the reason for this? How can this be solved?

     If sensor auto-reset is enabled in the CapSense Component, the sensor will go inactive after some time. To prevent this, disable sensor auto-reset (Figure 17). 

Figure 17

figure 17

12.CapSense doesn’t work in EMC testing. What is the reason for this? How can this be solved?

Firmware:
In case of EMC noise immunity, a few more options in addition to the firmware filters can be used

  • You can enable the multiple frequency scan option in the CapSense Component, which will scan each sensor with three different frequencies. 
  • As discussed in the sense clock/TX frequency section, the PRS/SSC can be used as the clock source
  • If there is any interference/immunity needed in a certain band of interest, the sense clock frequency/TX frequency can be changed accordingly.

Hardware:

The series resistors in CapSense lines can help in EMC issue. The recommended resistance is 560 ohms; it can be increased up to 4.7 kΩ if it helps. Increasing the resistance will impact the sensitivity. If the EMC immunity fails at a frequency, a ferrite bead that has high impedance at that frequency can be put in series in CapSense lines. 

13.Why can’t some pins be assigned as CapSense sensor in PSoC 4M/L devices?

In PSoC 4M/L devices, there are two CapSense blocks with each of them associated with particular ports (Figure 18). Ports 5, 8, and 9 can be assigned to only the CSD2 block; these ports cannot be assigned to CSD1. Similarly, the other ports cannot be assigned to CSD2.

Note: Currently CSD3.0 can support only one CapSense component in PSoC 4M devices.

Figure 18

figure 18

14. CapSense false triggers in the presence of water. How can this be solved?

A. Use shield electrode in liquid-tolerant designs.
B. If the CapSense sensors are close to each other, connect an inactive sensor to shield (Figure 19). 
C. A button can be configured as the guard sensor, which can be used to avoid false triggers using firmware when there is large pool/ flow of liquid.
     Refer to PSoC 4 CapSense design guide for more details on liquid tolerance/rejection recommendations.

Figure 19

figure 19

15.How can proximity distance be increased without any hardware changes?

ALP filter is very useful to achieve more sensing distance. Using an ALP filter will have an impact on the response time. Refer to Section 8.1 in the Proximity Sensing with CapSense application note.

Note: ALP is not yet available in the new CSD component CSD3.10. Therefore, you may have to use CSD2.60.

Appendix

Getting started with CapSense 

PSoC 4 CapSense design

CapSense 3.10 datasheet

CapSense CSD 2.60 datasheet

Low power CapSense design

Proximity sensing with CapSense

Design Considerations for Electrical Fast Transient Immunity of a CapSense® System