Datasheet

CY8C21x34/B CapSense
®
Design Guide Document No. 001-66271 Rev. *B 33
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. A code example that uses an I
2
C communication protocol to
communicate with the PC can be downloaded here. After downloading the example project:
1. Open the code example using PSoC Designer. In Workspace Explorer, right-click CSD User Module and select
CSD Wizard. You are shown four CapSense buttons assigned to the pins. Change the number of buttons and
pin assignments according to your application requirements.
2. Change Modulator Capacitor Pin and Feedback Resistor Pin, if required.
3. Generate and build the project.
4. Program the CapSense controller with the hex file.
5. Refer to “Instructions to use USB-I2C Tool to Monitoring CapSense Data found in the code example’s
documentation for instructions on how to monitor raw count, baseline, and difference count.
4.2.2 Select Prescaler
To select the Prescaler value, use the following process:
1. Measure the maximum sensor parasitic capacitance using an LCR meter or the CapSense controller. If you are
using an LCR meter, skip to Step 5.
2. Use the CSD User Module with clock prescaler and the following parameters:
a. Scan Speed = Normal
b. Resolution = 16
c. Reference = VBG
d. Prescaler period = 15 (SysClk = 24 MHz), 7 (SysClk = 12 MHz), or 3 (SysClk = 6 MHz)
e. ShieldElectrodeOut = Enable or disable depending on the application
3. Build the project and download it to the CapSense controller.
4. Monitor only the raw counts from all the sensors (including slider segments) and note the highest raw count
value.
5. Use Equation 7 to calculate maximum parasitic capacitance.
Equation 7
6. Use Equation 8 to calculate fs
max
.
Equation 8
7. Calculate the prescaler value based on the clock configuration.
8. For CSD with the clock prescaler configuration:
Equation 9
9. For CSDADC with the PWM8 clock source configuration:
Equation 10
10. For better SNR performance, round the calculated prescaler to the nearest 2
n
1 value (1, 3, 7, 15, 31, and so
on.)
4.2.3 Set Raw Count Range with R
b
The value of the bleed resistor, R
b
, determines the sensitivity of the CapSense sensor. Sensitivity is the difference
count measured between a touch and no touch condition. Increasing R
b
improves sensitivity and also increases the