background image

CY3280-22x45 Universal CapSense® Controller Development Kit Guide, Doc. # 001-51921 Rev. *H

37

Code Examples

Figure 5-2.  Default View

5.1.2.1

Add CSD2X, LED, and EzI2Cs User Module to Your Design

1.  In the 

User Module

 window, expand the 

Cap Sensors

 folder.

Figure 5-3.  Cap Sensors Folder

2. Double-click 

CSD2X

 or right-click 

CSD2X

 and select 

Place

, as shown in 

Figure 5-4

.

Summary of Contents for Universal CapSense CY3280-22x45

Page 1: ...x45 Universal CapSense Controller Development Kit Guide Doc 001 51921 Rev H Cypress Semiconductor 198 Champion Court San Jose CA 95134 1709 Phone USA 800 858 1810 Phone Intnl 408 943 2600 http www cyp...

Page 2: ...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 FITNE...

Page 3: ...0 22x45 Universal CapSense Controller Board Features 19 3 3 Hardware Requirement 19 3 3 1 Connecting CapSense Module Board 20 3 3 2 Test the Board 21 3 3 3 Reset Board to Factory Settings 21 4 Hardwar...

Page 4: ...CapSense Project Using PSoC Designer 35 5 1 1 Flowchart 35 5 1 2 Create New Project 35 5 1 2 1 Add CSD2X LED and EzI2Cs User Module to Your Design 37 5 1 2 2 Configure LED and EzI2Cs User Modules 41...

Page 5: ...ory default may affect its performance and cause interference with other apparatus in the immediate vicinity If such interference is detected suitable mitigating measures should be taken The CY3280 22...

Page 6: ...at an ESD workstation If one is not available use appropriate ESD protection by wearing an antistatic wrist strap attached to chassis ground any unpainted metal surface on your board when handling par...

Page 7: ...items are included in the kit CY3280 22x45 UCC board Printed documents CY3280 22x45 UCC DVD CY3240 I2USB board CY3217 MiniProg1 programmer USB A to Mini B cable 1 1 1 Prerequisites The following are r...

Page 8: ...ts The default Install_directory is C Program Files Cypress 1 4 Bridge Control Panel The Bridge Control Panel GUI is used with CY3240 I2USB bridge to enable communication with I2C slave devices here i...

Page 9: ...Convention Usage Courier New Displays file locations user entered text and source code C cd icc Italics Displays file names and reference documentation Read about the sourcefile hex file in the PSoC D...

Page 10: ...10 CY3280 22x45 Universal CapSense Controller Development Kit Guide Doc 001 51921 Rev H Introduction Note Intentionally left blank...

Page 11: ...information using WinRar or sim ilar tools This ISO file includes kit code examples hardware files documents Cypress pre requisites PSoC Designer and PSoC Programmer and other mandatory prerequisite...

Page 12: ...creen Note If auto run does not execute double click cyautorun exe in the root directory of the DVD as shown in Figure 2 2 Figure 2 2 DVD Root Directory 3 The InstallShield Wizard screen appears which...

Page 13: ...eld Wizard 5 In the Product Installation Overview screen select the installation type that best suits your requirement The drop down menu has three options Typical Complete and Custom as shown in Figu...

Page 14: ...nstallation begins a list of packages appear on the Installation Page A green check mark appears adjacent to every package that is downloaded and installed see Figure 2 5 9 Wait until all the packages...

Page 15: ...re 2 6 Installation Complete Page After software installation verify your setup by opening PSoC Programmer with the MiniProg attached to PC Open Bridge Control Panel with the CY3240 I2USB bridge attac...

Page 16: ...n existing project Figure 2 7 PSoC Designer Interconnect View 3 To experiment with the code examples go to Code Examples chapter on page 35 Note For more details on PSoC Designer see the PSoC Designer...

Page 17: ...Figure 2 8 Figure 2 8 PSoC Programmer Window 3 Click the File Load button from the PSoC Programmer menu bar navigate and select the hex file 4 Use the Program button to program the hex file on to the...

Page 18: ...18 CY3280 22x45 Universal CapSense Controller Development Kit Guide Doc 001 51921 Rev H Getting Started...

Page 19: ...ry settings If it has not follow the instructions in 3 3 3 Reset Board to Factory Settings 3 2 CY3280 22x45 Universal CapSense Controller Board Features CY3280 SLM Universal CapSense Linear Slider Mod...

Page 20: ...ce shunt on pins 1 and 2 of jumper J2 to enable shield signal routing in CY3280 SLM module Place shunt on pins 2 and 3 of jumper J2 if no overlay is present in the SLM board 3 Place shunt on pins 1 an...

Page 21: ...hese steps to reset the board to the original factory installed programming 1 Place shunt on pins 2 and 3 of JP3 and pins 1 and 2 of JP4 default setting Remove JP1 and JP2 if present 2 Connect your co...

Page 22: ...it Guide Doc 001 51921 Rev H Kit Operation Figure 3 2 Programmer Settings for MiniProg3 8 From the Device menu select CY8C22545 24AXI 9 Click Program Programming Succeeded appears in the Actions pane...

Page 23: ...er Board has the following sections PSoC CY8C22045 24AXI Note CY8C22045 is an On Chip Debug OCD part which can be used for debugging projects developed for all CY8C22x45 and CY8C21x45 family of device...

Page 24: ...f Vadj can be calculated individually by using these equations Equation 2 Equation 3 For more information about the LP3875ES ADJ refer to the LP3875ES ADJ data sheet Follow these steps if the fixed 5...

Page 25: ...1 If the potentiometer RV3 is needed for the right channel place shunt on JP2 The resistors of R55 and R56 are not populated as default Note RV2 and RV3 potentiometers are not Bleed resistors they can...

Page 26: ...VCC Selection Jumper JP3 Figure 4 5 PSoC VCC Selection Jumper Place shunt on pin 2 and pin 3 of JP3 to select fixed 5 V as PSoC VCC power supply Place shunt on pin 1 and pin 2 of JP3 to select variabl...

Page 27: ...in P1 5 used as an interrupt to pin 3 of the ISSP I2C header 4 2 5 External 9 V Battery Power Connector BH1 The 9 V battery can be directly connected to this connector to power the board 4 2 6 SPI I2C...

Page 28: ...ted resistors of R76 and R77 must be populated Configure P1 5 to the TX of UART and P1 7 to the RX of UART in the interconnection window of PSoC Designer 5 2 4 2 8 ISSP I2CUSB Interface J3 Figure 4 9...

Page 29: ...circuit debugging Connect the ICE Cube to J4 Then the PSoC Designer debugger provides in circuit emulation support that allows you to test the project in a hardware environment when viewing and debugg...

Page 30: ...two boards are connected Table 4 3 Pin Usage Pin Port of PSoC Description 1 P0 6 Connect to Slider9 of CY3280 SLM Board 2 P0 4 Connect to Slider8 of CY3280 SLM Board 3 P0 2 Connect to Slider7 of CY328...

Page 31: ...t to Button1 of CY3280 SLM Board 29 P2 5 Connect to LED5 of CY3280 SLM Board 30 P2 7 Connect to LED4 of CY3280 SLM Board 31 P0 1 Connect to LED3 of CY3280 SLM Board 32 P0 3 Connect to LED2 of CY3280 S...

Page 32: ...board such as a tem perature sensor The resistors R68 and R69 are not populated by default The following table lists the pin connection on the J7 connector to CY8C22045 24AXI chip Table 4 4 Pin Conne...

Page 33: ...Ground 30 GND Ground 31 NC GPIO 32 NC GPIO 33 P1 1 GPIO 34 P1 0 GPIO 35 GND Ground 36 GND Ground 37 VCC PSoC VCC power supply 38 Vadj Variable power supply 39 Vin External power supply 40 5V Fixed 5...

Page 34: ...34 CY3280 22x45 Universal CapSense Controller Development Kit Guide Doc 001 51921 Rev H Hardware Design Note Intentionally left blank...

Page 35: ...nse The completed code example is available in the following location Installed directory CY3280 22X45 1 0 Firmware CY3280_22X45_SLM The CY3280_22x45_SLM folder can be copied and placed in the user di...

Page 36: ...own in Figure 5 1 3 To save the project in a different location click Browse and navigate to the desired directory Figure 5 1 New Project 4 In the Target Device option choose CY8C22545 24AXI from the...

Page 37: ...Rev H 37 Code Examples Figure 5 2 Default View 5 1 2 1 Add CSD2X LED and EzI2Cs User Module to Your Design 1 In the User Module window expand the Cap Sensors folder Figure 5 3 Cap Sensors Folder 2 Do...

Page 38: ...Window CSD Select 3 In the Choose a CSD2X Configuration dialog select Dual channel with IDAC Configuration 4 Click OK see Figure 5 5 Figure 5 5 CSD2X Configuration Dialog 5 Expand the Digital Comm fol...

Page 39: ...User Module Window EzI2Cs Select 6 Expand Misc Digital folder and place the LED user module to do this double click LED or right click LED and select Place as shown in Figure 5 7 Figure 5 7 LED User M...

Page 40: ...22x45 Universal CapSense Controller Development Kit Guide Doc 001 51921 Rev H Code Examples Figure 5 8 Workspace Explorer Window 8 All seven selected user modules are displayed in the Workspace Explor...

Page 41: ...Port as Port_2 Pin as Port_2_5 and Drive as Active Low as shown in Figure 5 10 Figure 5 10 LED_1 Properties Window 3 Similarly select the LED_2 LED_3 LED_4 and LED_5 user modules in the Workspace Exp...

Page 42: ...erties Window 5 1 2 3 Configure Sensor CSD2X User Module 1 Right click the CSD2X_1 user module and select CSD2X Wizard as shown in Figure 5 12 Figure 5 12 Selecting CSD2X Wizard 2 In the CapSense Wiza...

Page 43: ...x to False Resolution to 50 Sensor count to 10 Figure 5 13 CapSense Wizard Sensor Settings Figure 5 14 CapSense Wizard 4 To assign the sensor on a particular pin click and drag from the sensor block t...

Page 44: ...v H Code Examples ment can be done in Chip Pin Assignment View Figure 5 15 or Table Pin Assignment View Figure 5 16 Figure 5 15 Chip Pin Assignment View Figure 5 16 Table Pin Assignment View 5 Assign...

Page 45: ...er window In the Properties window of CSD2X_1 set the values as in Figure 5 17 it shows all the parameters of CSD2X_1 Figure 5 17 CSD2X_1 Properties Window 7 Configure the Global Resource window as sh...

Page 46: ...Installed Directory CY3280 22x45 1 0 Firmware CY3280_22x45_SLM of this user guide and select Build Generate Build MyProject Project 9 Verify that the compile finishes with no errors in the Output Tab...

Page 47: ...ton to power the board from the MiniProg as shown in Figure 5 20 Figure 5 20 Program Part Dialog 4 Click the File Load button Operation Succeeded appears in the Actions pane when program ming is compl...

Page 48: ...1 5 Reading CapSense Data over I2 C 1 Connect your computer to the CY3280 22x45 Universal CapSense Controller board s ISSP con nector J3 using I2 C USB bridge and a USB cable 2 Go to Start Cypress Op...

Page 49: ...Code Examples Figure 5 23 Variable Settings 7 Sample data read Reading raw count of BTN0 a Send I2C write instruction W 43 00 00 once b Press the Repeat button to send the following I2C read instructi...

Page 50: ...50 CY3280 22x45 Universal CapSense Controller Development Kit Guide Doc 001 51921 Rev H Code Examples...

Page 51: ...20 560ohm R20 560ohm C12 0 1uF C12 0 1uF R6 560ohm R6 560ohm R22 100ohm R22 100ohm RV1 10K RV1 10K TP2 Testpoint TP2 Testpoint R63 1K R63 1K R70 560ohm R70 560ohm R15 560ohm R15 560ohm TP3 Testpoint T...

Page 52: ...52 CY3280 22x45 Universal CapSense Controller Development Kit Guide Doc 001 51921 Rev H Appendix A 2 Top Silk Screen...

Page 53: ...9POS R A PCB SLD DB9F FCI D09S13A4GL00LF 14 1 J3 CONN HEADER 5POS 100 VERT TIN Molex Connector Corpora tion 22 23 2051 15 1 J4 RJ45 CONN MOD JACK 8 8 RT A PCB 50AU Tyco Electronics 5557785 1 16 1 J5 C...

Page 54: ...OHM 1 10W 5 0603 SMD Panasonic ECG ERJ 3GEYJ102V 32 11 TP1 TP2 TP3 TP4 TP5 TP6 TP7 TP8 TP9 TP10 TP11 TEST POINT PC MINI 040 D BLACK Keystone Electronics 5001 33 1 U1 PSoC Cypress Semiconductor Corp C...

Page 55: ...include Kit Operation and Code Examples chapter Extensive content updates throughout the document D 3670320 07 09 2012 MSUR SGUP Major content updates and updated figures E 3698958 08 08 2012 MSUR Min...

Reviews: