CY8CKIT-031 PSoC® CapSense® Expansion Board Kit Guide, Doc. # 001-66474 Rev. *H
21
Code Examples
4.4
Code Example 3: BMM_I2C_Tuner
This code example can be executed in 2 ways: With Capsense Tuning (requires I2C interface using
MiniProg3) and Without Capsense Tuning (no additional requirements) i.e., the same project can be
used to demonstrate the capsense functionality as well as Capsense tuning using Tuner Helper GUI
in PSoC Creator. This is done by commenting/uncommenting the line #define ENABLE_TUNING in
the main.c file of the code example. PSoC creator does not compile the code under #ifdef (if defined)
statement when #define statement is commented (/*…… */ or //). Similarly, when the #define
statement is removed from comments, the code required for working with Tuner GUI gets compiled.
By default, the project is set to work without Capsense tuning by commenting the #define.
4.4.1
BMM_I2C_Tuning example (Without Tuning)
4.4.1.1
Project Description
This code example provides a platform to build CapSense-based projects. This project
demonstrates the use of CapSense Matrix Buttons using Capsense_CSD component in PSoC
Creator.
When a Capsense button is touched, the leds corresponding to the Row and Column gets turned
ON. 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.
4.4.1.2
Hardware Connections
■
Connect the CapSense Matrix Button Module to connector J2 of the PSoC CapSense Expansion
Board.
■
For the PSoC Development Kit, connect J1 of the PSoC CapSense Expansion Board Kit to port A
of the development kit.
■
For the PSoC 3/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.
Note
See Shielding Electrode on page 31 for more details.
4.4.1.3
Verify Output
Touch any button and observe that corresponding row and column LED turns ON.
Figure 4-4. CapSense Matrix Button Module Project