CY8CKIT-031 PSoC® CapSense® Expansion Board Kit Guide, Doc. # 001-66474 Rev. *H
22
Code Examples
Note
To evaluate the Capsense tuning part of the code example, a MiniProg3 is required. It does
not work without MiniProg3 because the code waits forever in the main loop if I2C communication is
not set up. You can buy MiniProg3 through this link
http:www.cypress.com/go/CY8CKIT-002
4.4.2
BMM_I2C_Tuning (With Tuning)
4.4.2.1
Project Description
This code example shows the CapSense Matrix Button Module (BMM) with "Tuner" for monitoring of
CapSense outputs. The CapSense outputs such as Rawcounts, Baseline, and Signal (Difference
count) can be monitored on the "Tuner" GUI. The project uses the auto-tuning feature, which sets all
CapSense parameters to the best values automatically. The parameter settings can be monitored in
the GUI but cannot be altered because they are set by auto-tuning. In the manual tuning method,
parameter settings can be changed in the GUI and the resulting output can be seen.
The example also makes use of LEDs on the CapSense BMM board. Touching a button turns on the
corresponding LED. The code uses tuner APIs. The tuner API CapSense_TunerComm() is used in
main loop to scan sensors, which also sends the CapSense variables RawCounts, Baseline, and
Difference counts (Signal) to the PC GUI through I2C communication.
The Sensitivity parameter in the CapSense_CSD component configuration is set to ‘4’ and the
example is tested to work without any overlay. When an overlay of some thickness is used, the
sensitivity parameter should be changed to ‘1’, as shown in
. To configure the
Sensitivity parameter, double-click on the
CapSense_CSD
component. Click on the
Scan Order
tab. Select the individual CapSense sensor and configure the sensitivity as required.
4.4.2.2
Hardware Connections
■
Connect the CapSense Matrix Button Module to connector J2 of the PSoC CapSense Expansion
Board.
■
For the PSoC Development Kit (CY8CKIT-001), connect J1 of the PSoC CapSense Expansion
Board Kit to port A of the development kit.
■
For the PSoC 3 or PSoC 5LP Development Kit, connect J1 of the PSoC CapSense Expansion
Board Kit to port D of the development kit. Remove LCD from port P8. LCD module adds
parasitic capacitance and noise to CapSense because it shares the same pins of port D that are
used for CapSense.
■
Connect jumper J2 on the CapSense Matrix Button Slider Module to short SHIELD and SHLD.
■
Build and program the code example and reset the device.
■
If MiniProg3 is used, then disconnect it from the programming port and PC. The MiniProg3 is
used for I2C communication. Connect MiniProg3 to the J3 header on the PSoC CapSense
Expansion Board Kit. Make sure that I2C pins SDA, SCL, and GND on the MiniProg3 are
mapped to the corresponding I2C pins on the kit; see
Note that when MiniProg3 is used for both I2C and programming, the MiniProg3 should be dis-
connected from PC every time the connection is changed.
Note
Shielding Electrode on page 34
for more details.