Cypress Semiconductor CY3280-BK1 Quick Start

CY3280-BK1 Universal CapSense Controller
Basic Kit #1 Quick Start
Doc. # 001-37959 Rev. **
Cypress Semiconductor
198 Champion Court
San Jose, CA 95134-1709
Phone (USA): 800.858.1810
Phone (Intnl): 408.943.2600
[+] Feedback
Copyrights
Copyrights
© Cypress Semiconductor Corporation, 2007. The information contained here in is subject to ch ange wi thout noti ce. Cypress Semiconductor Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in a Cypress product. Nor does it convey or imply any license under patent or other rights. Cypress products are not warranted nor intended to be used for medical, life support, life saving, critical control or sa fety applica tions, unless pursu ant to an express written agreement with Cypress. Furthermore, 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. The inclusion of Cypress products in life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges.
Any Source Code (software and/or firmware) is owned by Cypress Semiconductor Corporation (Cypress) and is protected by and subject to worldwide patent protection (United States and foreign), United States copyright laws and international treaty provisions. Cypress hereby grants to licensee a personal, non-exclusive, non-transferable license to copy, use, modify, create derivative works of, and compile the Cypress Source Code and derivative works for the sole purpose of creating custom soft­ware and or firmware in support of licensee product to be used only in conjunction with a Cypress integrated circuit as speci­fied in the applicable agreement. Any reproduction, modification, transla tion, compilation, or representation of this Source Code except as specified above is prohibited without the express written permission of Cypress.
Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATE­RIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the right to make cha nges without further notice to the materials described herein. Cypress does not assume any liability arising out of the applica tion or use of any product or circuit described herein. Cypress does not authorize its products for use as critical components in life-support systems whe re a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress’ product in a life-support sys­tems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges.
Use may be limited by and subject to the applicable Cypress software license agreement. PSoC Designer™, Programmable System-on-Chip™, and PSoC Express™ are trademarks and PSoC® is a registered
trademark of Cypress Semiconductor Corp. All other trademarks or registered trademarks referenced herein are property of the respective corporations.
Flash Code Protection
Cypress products meet the specifications contained in their particular Cypress PSoC Data Sheets. Cypress believes that its family of PSoC products is one of the most secure families of its kind on the market today, regardless of how they are used. There may be methods, unknown to Cypress, that can breach the code protecti on features. Any of these methods, to our knowledge, would be dishonest and possibly illegal. Neither Cypress nor any other semiconductor manufacturer can guaran­tee the security of their code. Code protection does not mean that we are guaranteeing the prod uct as "unbreakable."
Cypress is willing to work with the customer who is concerned about the inte grity of their code. Co de prot ection i s constantly evolving. We at Cypress are committed to continuously improving the code protection features of our products.
2 CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. **
[+] Feedback
Contents
1. Getting Started 5
Kit Contents..................................... ... ... ....................................... ... ... ... .... ..................5
Installing Software . ... ... ... .... ... ....................................... ... ... ... .... ... ... ... .........................5
Install PSoC Express Development Software..................................................5
Install PSoC Designer Development Software.................................................5
Additional CY3280-BK1 Universal CapSense Controller CD Content .............6
CapSense Best Practices............................................................................................6
2. Use the Board as Fac tory Programmed 7
Power the Board..........................................................................................................7
Test the Board .............................................................................................................8
Resetting the Board to the Original Factory Programming..........................................8
3. Create a PSoC Expres s CapSense Project 9
Start a New Project......................................................................................................9
Add the First CSA Button Driver to Your Design .........................................................9
Add a Second CSA Button Driver to Your Design.....................................................10
Add the First LED Value Driver to Your Design.........................................................10
Add the Second LED Value Driver to Your Design....................................................10
Define the LED Transfer Function .............................................................................11
Build Your Project............................................................... ... .... ... ... ... ... .... ... ... ..........12
Assign Drivers to Pins................................................................................................12
Program the CY3280-20x34 UCC Board...................................................................13
Test the Board ...........................................................................................................14
What’s Next? .............................................................................................................14
4. Tune a PSoC Express CapSense Project 15
Open Your PSoC Express Project................... ... ... ... .... ... ... ... .... ... ... ... ... .... ... ... ... .... ...15
Add an I2C Slave Driver to Your Design ...................................................................15
Build the Project.................. ... ... ... .... ... ... ....................................... ... ... ... .... ... ... ... .... ...15
Assign Drivers to Pins................................................................................................16
Program the CY3280-20x34 UCC Board...................................................................16
Tune Button1.............................................................................................................16
5. Create a PSoC Designer CapS ense Project 19
Start a New Project....................................................................................................19
Add CSA, LED, and I2C User Modules to Your Design ............................................20
Configure CSA, LED, and I2C User Modules in Your Design ................................ ...21
Configure Sensor Pins Using the CSA Wizard..........................................................21
Add Code to main.c and Build the Project.................................................................22
Program the CY3280 - 20x34 Board ............ .............................................................23
Test the Board ...........................................................................................................23
CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. ** 3
[+] Feedback
Contents
What's Next? .............................................................................................................23
6. Design Support and Resou rces 25
PSoC Development Software Online ........................................................................25
PSoC Data Sheets and Application Notes ................................................................25
PSoC Device Selector Guide ....................................................................................25
PSoC Development Tools Selector Guide ................................................................25
PSoC On-Demand Training.......................................................................................25
PSoC On-Site Training..............................................................................................25
Online Technical Support............. ... ... ... .......................................... .... ......................25
Additional CapSense Resources...............................................................................26
4 CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. **
[+] Feedback

1. Getting S tarted

The examples in this Quick Start are for the CY3280-20x34 and CY3280-SLM Linear Slider Module boards only.

Kit Contents

CY3280-20x34 Universal CapSense Controller Board
CY3280-21x34 Universal CapSense Controller Board
CY3280-SLM Universal CapSense Linear Slider Module
CY3280-BBM Universal CapSense Prototyping Module
CY3240-I2USB Board
CY3210 MiniProg1 Programmer
USB 2.0 Retractable Cable
PSoC Express Installation CD
PSoC Designer and PSoC Programmer Installation CD
CY3280-BK1 Universal CapSense Controller Kit CD
1.5 mm and 3 mm Polycarbonate Overlays (with Adhesive for attachment to module board if
wanted)

Installing Software

To use the examples in this quick start:
Install PSoC Express Development Software
Install PSoC Designer Development Software
Review the Additional CY3280-BK1 Universal CapSense Controller CD Content

Install PSoC Express Development Software

1.1 Insert the PSoC Express Installation CD.
1.2 Install PSoC Express 3.
1.3 Install .NET Framework 2.0.
1.4 Install PSoC Programmer.
1.5 Install Express Pack 3 (found on the kit CD in the \Software folder).

Install PSoC Designer Development Software

1.6 Insert the PSoC Designer and PSoC Programmer Installation CD.
1.7 Browse to and launch PD44_B119x86.exe at \PSoC Programmer 2.3_PSoc Designer
4.4\psoc_designer_tm__v__4_4_13\.
1.8 Follow the installation instructions.
1.9 Install Service Pack 1 (found on the kit CD in the \Software folder).
1.10 A C compiler license is required to build PSoC Designer C language projects. Section 2.1 of the C Language Compiler Users Guide.pdf found in Help Documentation explains how to enter the license.
CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. ** 5
[+] Feedback
Getting Started

Additional CY3280-BK1 Universal CapSense Controller CD Content

Example projects for PSoC Express and PSoC Designer
Hardware schematics and gerber files
CY3240-I2USB software installer and documentation

CapSense Best Practices

The Universal CapSense Controller has been created using the best practices for CapSense lay out. To enable universality and development of the kit and its projects, certain design elements have been changed from what is recommended for final products. Below is a list of the design features in
the Universal CapSense Controller and what to change for final products.
Design Feature Reason Impact Recommended Change
Sensing traces routed through a connector to sen­sors
Sensing traces routed to other schematic elements
Sensing traces located on the top layer
Several regulators used, including a variable regulator
Test point on CMOD Accessibility of charge/dis-
GND spacing is generalized for noise immunity and sensitivity
Connection to shield electrode is through a jumper (module ­J2)
ESD protection cir­cuitry is not included
UM Parameters set to supplied overlay thicknesses
Unused pins are not routed directly to GND
0-ohm Resistors populated through­out
Buttons, sliders and LEDs placed on the module board to all for greater flexibility with cus­tom modules for development and subsequent releases.
Universality of the board enabled by population/depopu­lation of 0-ohm resistors
Using vias to route traces to bot­tom of board and back to con­nector increases parasitic capacitance.
Demonstration of CapSense at several voltages.
charge waveforms
Universality of kit required mid­dle-ground on many parameters
Flexibility of module boards for both CSD and CSA control boards
Development/evaluation plat­form without consistent overlay is inherently vulnerable to ESD events
Projects optimized for supplied hardware
Pins brought out to connector for subsequent modules or cus­tom designs
Universality of the board enabled by population/depopu­lation of 0-ohm resistors
Connectors increase the para­sitic capacitance of the sensors, effectively reducing their sensi­tivity. Connectors also create another path for noise to enter the system.
Solder pads of 0-ohm resistors increase parasitic capacitance.
Possible noise sensitivity to stimulus on top side of board. Finger presses on routing of control board can lead to sensor activation.
Global and User Module param­eters may need to be verified with changing power supply.
A test point increases noise sen­sitivity by acting as an antenna.
Design is not optimized for high­noise or very thick overlays
Higher resistance paths can impair performance of shield electrode in CSD projects
Direct or air-separated ESD testing may impair operation or damage circuitry. +/-2kV limit on PSoC pins (see datasheet).
Sensitivity may not be high enough for very thicker overlays
Possible noise path Tie unused sensing traces
Solder pads of 0-ohm resistors increase parasitic capacitance
Sensors and control circuitry should be located on the same printed circuit board. Lower par­asitic capacitance by reducing trace lengths.
Route traces directly to sensing elements. Use as few 0-ohm resistors as possible
Route sensing traces on non­user side of printed circuit board. Route sensing traces as far from noise sources as possi­ble.
Supply one regulated voltage to PSoC.
Solder-pad test points for leads offer better noise immunity if test points are required.
Increase spacing for thicker overlays and better sensitivity. Decrease spacing for greater noise immunity
Dedicated trace for shield elec­trode. Remove jumpers wher­ever possible
Include an overlay and ESD pro­tection circuitry
Thicker overlays may require verification of parameters to ensure proper operation
directly to ground
Route traces directly to sensing elements. Use as few 0-ohm resistors as possible
6 CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. **
[+] Feedback

2. Use the Board as Factory Programmed

The examples in this Quick Start are for the CY3280-20x34 and CY3280-SLM Linear Slider Module boards only.
The CY3280-20x34 board is preprogrammed with demonstration firmware. When powered by a PSoC MiniProg, a CY3240-I2USB Bridge, or an optional external power supply, the LEDs light up when a finger touches one of the buttons or the slider.
These instructions assume your board has not been reprogrammed from the factory settings. If it has, and you would like to follow along with this demonstration, follow the instructions in the Reset­ting the Board to the Original Factory Programming section on page 5, and then start this example with the Power the Board section below.

Power the Board

2.1 Connect your computer to the CapSense test board ISSP Connector (J3) using the PSoC MiniProg and a USB cable. If this is your first time using the MiniProg, you will need to install the driver using these steps before proceeding:
a. When the Found New Hardware Wizard opens, select the Install the software automati-
cally (Recommended) option and click Next.
b. A warning message may tell you the software you are trying to install has not passed Win-
dows Logo testing. Click Continue Anyway each time it appears.
c. When the installation is complete, click Finish.
2.2 Open PSoC Programmer by going to the Windows Start menu and selecting All Programs Cypress MicroSystems PSoC Programming PSoC Programmer.
CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. ** 7
[+] Feedback
Use the Board as Factory Programmed
2.3 From the Port menu, select MiniProg1/<Identification Code>.
2.4 Click Toggle Device Power . The D1 LED on the CY3280-20x34 board lights green.

Test the Board

2.5 Touch the slider on the board with your finger. An LED will light up representing where your fin­ger is on the slider. The LED state changes as you move your finger across the slider
2.6 Touch one or more buttons with your finger. The LEDs light up corresponding to the buttons being pressed.

Resetting the Board to the Original Factory Programming

Follow these steps if you wish to reset the board to the original factory installed programming:
2.7 Place shunts on pins 2 and 3 of J1 and pins 1 and 2 of J4.
2.8 The example projects are available on the CD and from the Cypress web site. On
www.cypress.com, search for CY3280-BK1.
2.9 To reset the board to the factory conditions, connect your computer to the CY3280­20x34 board ISSP Connector (J3) using the PSoC MiniProg and a USB cable.
2.10 Open PSoC Programmer by going to the Windows Start menu  All Programs  Cypress MicroSystems PSoC Programming PSoC Programmer
2.11 Click File Load, navigate to, and open the CY3280_20x34_slm.hex file on the CD at:
Firmware/PSoCDesigner/CY8C20x34/CY3280_20x34_SLM/Output/CY3280_20x34_slm.hex
2.12 From the Device Family menu, select 20x34.
2.13 From the Device menu, select CY8C20434-12LFXC.
2.14 Click Program. “Programming Succeeded...” appears in the Actions pane when programming is complete.
Note: The CY3280_20x34_slm example project is a PSoC Designer project, and will not open with PSoC Express. PSoC Programmer uses .hex files generated by both applications.
8 CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. **
[+] Feedback

3. Create a PSoC Express CapSense Project

This project walks you through the steps of creating a PSoC Express project fr om scratch. At the end of the project, you will be able to touch a button on the board and see the corresponding LED light up.

Start a New Project

3.1 Open PSoC Express.
3.2 Select File New Project.
3.3 Name the project MyExpressProject.
3.4 If needed, click Browse to save the project in a different location.
3.5 Click OK.

Add the First CSA Button Driver to Your Design

3.6 Ensure the Driver Catalog pane is visible by selecting View Driver Catalog.
3.7 Each driver and valuator has certain properties associated with it. For the purposes of this example, ensure View
Use Add Driver Dialog is checked.
3.8 In the Driver Catalog pane, go to Inputs CapSense CapSense - CSA, right-click on But­ton - CSA, and select Add to Design. The Add Input Driver window will open.
3.9 In the Add Input Driver window, name the driver Button1.
CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. ** 9
[+] Feedback
Create a PSoC Express CapSense Project
3.10 Click OK to accept the default settings. Another Add Input Driver window will open automati­cally.
3.11 Name this driver CapSenseProperties.
3.12 In the Properties pane, set ExternalCap to Enabled.
3.13 Click OK.

Add a Second CSA Button Driver to Your Design

3.14 Repeat Step 3.8 to add a second CSA Button to your design.
3.15 Name the driver Button2.
3.16 Click OK.

Add the First LED Value Driver to Your Design

3.17 In the Driver Catalog pane, go to Outputs Display  LED  Single Color, and add an On/ Off driver to your design. The Add Output Driver window will open.
3.18 In the Add Output Driver window, name the driver LED1.
3.19 In the Properties pane, set Current Mode to Sinking.
3.20 Click OK.

Add the Second LED Value Driver to Your Design

3.21 In the Driver Catalog pane, go to Outputs  Display  LED  Single Color, and add another On/Off driver to your design. The Add Output Driver window will open.
3.22 In the Add Output Driver window, name the driver LED2.
3.23 In the Properties pane, set Current Mode to Sinking.
3.24 Click OK.
10 CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. **
[+] Feedback

Define the LED Transfer Function

3.25 You now have five drivers on your design desktop: Button1, Button2, LED1, LED2, and CapSenseProperties. Right-click the LED1 dr ive r and select Transfer Function.
Note: If your driver icons are stacked on top of each other, simply use your mouse to click and drag each driver to a new location until all five drivers are clearly visible. You may also click your mouse button while holding the [Ctrl] or [Ctrl] + [Shift] keys to zoom in and out respectively.
3.26 In the Select Transfer Function window, select TableLookup and click OK.
3.27 In the Select Input(s) window, select Button1_Status.
Create a PSoC Express CapSense Project
3.28 Click Next.
3.29 Set the Table Lookup to have the LED be off when its corresponding button is in an of f state, and on when the button is in the on state.
3.30 Click OK.
3.31 Repeat steps 3.25 to 3.30 for LED2, making sure to select Button2_Status for the Transfer Function.
CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. ** 11
[+] Feedback
Create a PSoC Express CapSense Project

Build Your Project

3.32 Select Build Generate/Build ‘MyExpressProject’ Project
3.33 In the PSoC Device Configuration Selection window, select the CY8C20434, 32-Pin QFN part in the Available Device Configurations pane.
Note: The CY3280-20x34 Universal CapSense Controller includes a special on-chip debugger (OCD) part, CY8C20000, which is a 48-pin part that is not normally used for production. The corresponding production part is a CY8C20X34, and comes in 24 and 32 pin packag es. For instance, a CY8C20434 is a 32 pin QFN that has many of the same pins as the CY8C20000, but is a production part without the OCD function.
3.34 Ensure the Assign pins automatically check box is NOT selected.
3.35 Click Next.

Assign Drivers to Pins

3.36 In the User Pin Assignment window, click Unassign All Pins. All drivers move to the Unas­signed Drivers list.
3.37 To assign drivers to pins, drag and drop drivers from the Unassigned Drivers list onto a pin. Assign the CapSenseProperties_ExternalCap driver to port P0[3].
12 CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. **
[+] Feedback
Create a PSoC Express CapSense Project
B
3.38 Assign the rest of the drivers according to the following table:
Button1_CSA P1[6] Button2_CSA P1[3] CapSenseProperties_ExternalCap
(previously assigned in Step 3.27) LED1 P2[5] LED2 P2[7]
3>@ 3RUWBB
3>@ &DS6HQVH3URSHUWLHV
966
&<&/);&
/('
/('
3>@3RUWBB
3>@
3>@
3>@3RUWBB
3>@3RUWBB
3>@3RUWBB
3>@3RUWBB
3>@3RUWBB
3>@ 3RUWBB
4)1
P0[3]
3>@ 3RUWBB
9''
3>@ 3RUWBB
3>@ 3RUWBB
3>@ 3RUWBB
3>@ 3RUWBB
3>@ 3RUWBB
3>@ 3RUWBB
3>@ 3RUWBB
3>@ 3RUWBB
3>@ 3RUWBB
;5(6
3>@3RUWBB
3>@
3>@3RUWBB
966
3>@3RUWBB
3>@3RUWBB
3>@3RUWBB
3>@
%XWWRQB&6$
%XWWRQB&6$
3.39 Click Next. PSoC Express builds your project (this may take a few minutes).

Program the CY3280-20x34 UCC Board

3.40 Connect your computer to the CapSense test board ISSP Connector (J3) using the PSoC MiniProg and a USB cable.
3.41 If this is your first time using the MiniProg, you will need to install the driver before proceeding. Follow the instructions in the Power the Board section on page 7.
3.42 In PSoC Express, select Program PSoC Programmer. The PSoC Programmer application opens.
CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. ** 13
[+] Feedback
Create a PSoC Express CapSense Project
3.43 From the Port menu, select MiniProg1/<Identification Code>.
3.44 Click Program . “Programming Succeeded...” appears in the Actions pane when pro­gramming is complete.

Test the Board

3.45 Click Toggle Device Power .
3.46 Touch buttons P1[6] and P1[3] on the board with your finger. The corresponding LED lights up.
3.47 When you are done experimenting, clic k Toggle Device Power , and close PSoC Programmer.
3.48 Return to PSoC Express and select File Save Application.

What’s Next?

You have now completed the PSoC Express CapSense project. The next example walks you through adjusting the settings so the slider is not as sensitive, a process known as tuning.
14 CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. **
[+] Feedback

4. T une a PSoC Express CapSense Project

Note: A CY3240-I2USB Bridge is needed for CapSense tuning. If you do no t have a CY32 40-I2USB Bridge board, purchase one online by goin g to http://www.cypress.com/design/DK10063, and click­ing Buy Online.
The goal of tuning a capacitive sensing application is to adjust the sensitivity of the buttons or slider so that they accurately detect finger presses. This involves determining which raw counts coming from the sensor are actual finger presses, or if it is some other stimuli that changes the raw count.
Detailed tuning information is available in the CapSense Guide. In PSoC Express, select Help
Documentation, and select CapSense Guide.

Open Your PSoC Express Project

4.1 In PSoC Express, if the project from the previous example is closed, select MyExpressProject in the Recent Project pane (or click browse and open the project).
4.2 If you are not in the Design view, click Design .

Add an I2C Slave Driver to Your Design

4.3 In the Driver Catalog pane, go to Interfaces Communication I2C, and add a Slave driver to your design.
4.4 In the Add Interface window, name the driver I2CSlave and click OK.

Build the Project

4.5 Select Build Generate/Build ‘MyExpressProject’ Project
4.6 In the PSoC Device Configuration Selection window, select the CY8C20434, 32-Pin QFN part in the Available Device Configurations pane.
4.7 Ensure the Assign pins automatically check box is NOT selected.
4.8 Click Next.
CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. ** 15
[+] Feedback
Tune a PSoC Express CapSense Project

Assign Drivers to Pins

4.9 In the User Pin Assignment window, click Unassign All Pins. All drivers move to the Unas­signed Drivers list.
4.10To assign drivers to pins, drag and drop drivers from the Unassigned Drivers list onto a pin. Assign the CapSenseProperties_ExternalCap driver to port P0[3].
Assign the rest of the drivers according to the following table.
Button1_CSA P1[6] Button2_CSA P1[3] CapSenseProperties_ExternalCap
(previously assigned in Step 4.10) I2CSlave I2CSCLPin P1[1] I2CSlave I2CSDAPin (automatically
assigned when the SCL pin is assigned) LED1 P2[5] LED2 P2[7]
P0[3]
P1[0]
4.11 Click Next. PSoC Express builds your project (this may take a few minutes).

Program the CY3280-20x34 UCC Board

4.12 Connect your computer to the CapSense test board ISSP Connector (J3) using the PSoC MiniProg and a USB cable.
4.13 Select Program Programmer. When PSoC Programmer opens, click Program.
When programming has successfully completed, close PSoC Programmer and return to PSoC Express.

Tune Button1

4.14 Click the Monitor button .
4.15 Connect your computer to the CapSense test board ISSP Connector (J3) using the USB­I2C bridge and a USB cable.
4.16 From the Power Selection menu, se lec t 5V Supplied.
4.17 Click the Start button.
4.18 Right-click the Button1 driver and select Show Tuner to open the CSA Button Tuner Window.
4.19Touch Button1 with your finger. Y ou can easily see the button is too sensitive because the sen­sor easily reports a full-finger contact.
4.20Increase the Finger Threshold to 250 and the IDAC setting to 250. Changing the IDAC setting is inversely related to the sensitivity of the button. Therefore, increasing the value decreases the sensitivity. Any Raw Count below the Finger Threshold does not register as a hit.
4.21 Click Apply to Board to write the changed parameter to Flash on the device.
16 CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. **
[+] Feedback
Tune a PSoC Express CapSense Project
4.22 Touch the button with your finger. The button is now less sensitive. When you're finished exper­imenting, close the CSA Button Tuner window and then click Stop. Monitoring a design con­sumes a lot of processor cycles on your PC.
Congratulations! You have successfully completed this example.To experiment with additional Uni­versal CapSense designs, go to the \Firmware folder on the kit CD.
CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. ** 17
[+] Feedback
Tune a PSoC Express CapSense Project
18 CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. **
[+] Feedback

5. Create a PSoC Designer CapSense Project

This project is a brief introduction to PSoC Designer. It is recommended that you complete the PSoC Designer training offered by Cypress. At the end of the project, you will be able to touch button P2[3] on the CY3280-SLM board and see the corresponding LED light up. A C compiler license is required to build PSoC Designer C language projects. Section 2.1 of the C Language Compiler Users
Guide.pdf found in Help Documentation explains how to enter the license.

Start a New Project

5.1 Open PSoC Designer.
5.2 Click Start New Project button .
5.3 Name the project MyDesignerProject.
5.4 If needed, click Browse to save the project in a different location.
5.5 Click Next.
5.6 A window may pop up notifying of any directory creations. Click Yes.
5.7 Click View Catalog.
5.8 Select the CY8C20434 part as the base part.
5.9 Select C for 'Main' file generation.
5.10 Click Finish.
CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. ** 19
[+] Feedback
Create a PSoC Designer CapSense Project

Add CSA, LED, and I2C User Modules to Your Design

5.11 If it is not already selected, click the Device Editor button .
5.12 Select Config Selection to see the user module selection screen.
5.13 Under Cap Sensors, right-click the CSA user module on the left of the screen.
5.14 Click Select.
5.15 Under Misc Digital, right-click the LED user module on the left of the screen.
5.16 Click Select.
5.17 Under Digital Comm, right-click the EzI2Cs user module on the left of the screen.
5.18 Click Select.
5.19 All three selected user modules should show up in the Selected User Modules window.
5.20 Select Config Interconnect to see the interconnect view.
5.21 To place the CSA and EzI2Cs user modules, right-click each user module and select Place. Note that the LED user module cannot be placed by the user.
20 CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. **
[+] Feedback
Create a PSoC Designer CapSense Project

Configure CSA, LED, and I2C User Modules in Your Design

5.22 Select the CSA User Module.
5.23 Set the External Cap to P0[3], under User Module Parame te rs (o n th e left center ).
5.24 Select the LED user module.
5.25 Set the port to Port_1 and the pin to Port_1_2.
5.26 Set the drive to active low.
5.27 Select the EzI2Cs user module.
5.28 Set the I2C Clock to 400K Fast.
5.29 Set the I2C Pin to P1[0]-P1[1].

Configure Sensor Pins Using the CSA Wizard

5.30 Right-click the CSA user module.
5.31 Select CSA Wizard.
5.32 Drag P2[3] to SW0.
5.33 Click OK. The Wizard will close.
5.34 Select Config Generate Application.
CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. ** 21
[+] Feedback
Create a PSoC Designer CapSense Project

Add Code to main.c and Build the Project

5.35 Select View Application Editor.
5.36 Ensure the Project View button is selected.
5.37 Double-click main.c under mydesignerproject files Source Files on the left.
5.38 Select all text in main.c and delete it.
5.39 Add the following code:
#include <m8c.h> #include "PSoCAPI.h" typedef struct I2C_regs {
BYTE button_state; WORD button_raw_counts; WORD button_baseline;
} I2C_REGS; I2C_REGS reg_info; void main() {
EzI2Cs_1_SetRamBuffer(sizeof(reg_info), 0, (BYTE *) ®_info); M8C_EnableGInt; EzI2Cs_1_Start(); CSA_1_Start(); CSA_1_InitializeBaselines(); CSA_1_SetDefaultFingerThresholds(); while (1) { CSA_1_ScanAllSensors();
CSA_1_UpdateAllBaselines(); CSA_1_bIsAnySensorActive(); M8C_DisableGInt; reg_info.button_raw_counts = CSA_1_waSnsResult[0]; reg_info.button_baseline = CSA_1_waSnsBaseline[0]; reg_info.button_state = (CSA_1_baSnsOnMask[0] & 1); M8C_EnableGInt; if (reg_info.button_state == 1) LED_1_On(); else LED_1_Off();
}
}
5.40 Select Build Rebuild All and verify the compile finishes with no errors.
22 CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. **
[+] Feedback

Program the CY3280 - 20x34 Board

5.41 Connect your computer to the CapSense test board ISSP Connector (J3) using the PSoC Mini­Prog and a USB cable. If this is your first time using the MiniProg, you will need to install the driver before proceeding. Follow the instructions in the Power the Board section on page 4 .
5.42 In PSoC Designer, select Program Program Part.The PSoC Programmer application opens.
5.43 From the Port menu, select MiniProg1/<Identification Code>.
5.44 Click Program. "Programming Succeeded..." appears in the Actions pane when programming is complete.
Create a PSoC Designer CapSense Project

Test the Board

5.45 Click Toggle Device Power.
5.46 Touch the sensor P2[3] on the board with your finger. The LED P1[2] will light up.
5.47 When you are done, click Toggle Device Power, and close PSoC Programmer.
5.48 Return to PSoC Designer and select File Save Project.

What's Next?

You have now completed the PSoC Designer CapSense project. There is a complete project that implements buttons and a slider available on the CD. To use these projects, the project folders need to be copied from the CD to a directory on a PC that h as PSoC Desig ne r installed. After copying the files, ensure that the parent folder attributes are not Read-only by following these steps:
5.49 Right-click the parent project folder.
5.50 Select Properties.
5.51 Ensure that the Read-only attribute is not checked.
5.52 Click OK.
CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. ** 23
[+] Feedback
Create a PSoC Designer CapSense Project
24 CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. **
[+] Feedback

6. Design Support and Resources

PSoC Development Software Online

All PSoC development software tools are available for download online. For PSoC Express, visit
www.cypress.com/psocexpress. For PSoC Designer visit www.cypress.com/psocdesigner. For
PSoC Programmer visit www.cypress.com/psocprogrammer.

PSoC Data Sheets and Application Notes

For all PSoC device data sheets and detailed appl ication notes, many with complete sta rter projects, visit www.cypress.com/designresources. In the Products column, select “PSoC Mixed-Signal Con­trollers” and in the Resource Type column, select either “Application Notes” or “Datasheets.”

PSoC Device Selector Guide

In the PSoC Application Notes section, search for AN2209—The Device Selection Guide for PSoC. It is a useful tool for determining exactly which PSoC device you should use for a specific design project.

PSoC Development Tools Selector Guide

In the PSoC Application Notes section, search for AN2402, The PSoC Development Tools Selector Guide. This is a complete catalog and description of all the develop m ent too ls th at su pp o rt PSoC devices and when to use them in your design cycle—from concept to production.

PSoC On-Demand Training

Visit www.cypress.com/psoctraining to engage in on-de mand self-p aced PSoC product and devel op­ment software training. Learn to design PSoC like the pros, at the introductory, intermediate, and advanced knowledge levels!

PSoC On-Site Training

Email training@cypress.com to enquire about PSoC in-person training seminars at a location near you. Learn design basics, tips, and tricks from the pros to become a PSoC design expert!

Online Technical Support

For knowledge base articles, customer forums, and online application support, visit
www.cypress.com/support.
CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. ** 25
[+] Feedback
Design Support and Resources

Additional CapSense Resources

A wealth of information about PSoC Express and CapSense is available on the Cypress.com web site, and more is frequently added. The following list is just a sample of what is available.
CapSense DataSheets
CY8C20434 Mixed Signal Array
CY8C20334 Mixed Signal Array
CY8C20234 Mixed Signal Array
CapSense Application Notes
AN2292, Layout Guidelines for PSoC™ CapSense
AN2318, EMC Design Considerations for PSoC CapSense Applications
AN2355, Calibrating CapSense with the CSR User Module
AN2360, Power and Sleep Considerations
AN2393, Migrating from CSR to CSA
AN2394, CapSense Best Practices
AN2397, CapSense Data Viewing Tool
AN2398, Waterproof Capacitive Sensing
AN2403, Signal-to-Noise Ratio Requirement for CapSense Applications
AN2408, Migrating from CSR to CSD
AN14459, CapSense Device and Method Selection Guide
CapSense Technical Articles
TA1186, Designer's Guide to Rapid Prototyping of Capacitive Sensors on any Surface
TA1179, Controls & Sensors Touch Sensors Spread Out
TA1168, White Paper Cypress’s CapSense Successive Approximation Algorithm
TA1193, The Art of Capacitive Touch Sensing
CapSense Developer Kits
DK10068, CapSense Successive Approximation (CSA)
DK10069, CapSense Sigma-Delta (CSD)
DK10064, CapSense Proximity Detection Demonstration
DK10059, CapSense Demo Board
26 CY3280-BK1 Universal CapSense Controller Quick Start, Doc. # 001-37959 Rev. **
[+] Feedback
Loading...