Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 1 > capsense

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



capsense
Moderator:
ARVI

Post Reply
Follow this topic



capsense

pran posted on 24 Jan 2013 8:52 PM PST
Top Contributor
26 Forum Posts

Can you give me some code(program) example for capsense .




Re: capsense

arvi posted on 25 Jan 2013 10:22 PM PST
Cypress Employee
119 Forum Posts

 

 

Hi,

 

What Cypress development kit do you have? 

 

The most commonly used kits for experimenting with CapSense:

 

1. CY8CKIT-001 PSoC® Development Kit with CY8CKIT-020 PSoC® CY8C28 Family Processor Module Kit

2. CY3214-PSoCEvalUSB PSoC CapSensePLUS with USB Evaluation Kit

3. Other kits which support CapSense - http://www.cypress.com/?app=search&searchType=advanced&keyword=capsense&rtID=110&id=0&applicationID=0&l=0

 

 

If you already have one of the above kits, navigate to the webpage for your kit on Cypress.com and scroll down; you will be able to see some attachments - Code examples.zip or the Kit user guide, which will contain example projects or information on how you can create one.

 

 

Regards,

Arvind



Re: capsense

danaaknight posted on 25 Jan 2013 02:38 PM PST
Top Contributor
1773 Forum Posts

A useful reference page -

 

http://www.cypress.com/?id=1575&tabID=39265

 

Regards, Dana.



Re: capsense

pmad posted on 25 Jan 2013 09:04 PM PST
Cypress Employee
154 Forum Posts

 There are bunch of code examples available for different devices on the following pages:

http://www.cypress.com/?rID=36805

http://www.cypress.com/?app=search&searchType=advanced&keyword=&rtID=113&id=0&applicationID=0&l=0&source=header

 

Cheers,

Pushek



Re: capsense

pran posted on 14 Feb 2013 09:45 PM PST
Top Contributor
26 Forum Posts

hi,

Thanks to all.

Your information is very helpful. I have kit CY32x80. I working on device CY8C20434LKXI for practice. Source code have 5 buttons and one slider.

I want to add few more sensor(10 buttons and 2slider) in my project touch pad, please tell me what changes i have to make in source code and other settings for same device CY8C20434-LKXI.

Pramod.



Re: capsense

MSUR posted on 15 Feb 2013 12:02 AM PST
Cypress Employee
29 Forum Posts

Hello Pramod,

 

If you already have the project with 5 buttons and 1 slider, in order to expand the same to 10 buttons and 2 sliders - you can follow the below steps -

 

1. First check pin requirements for the design- 10 buttons with 2 sliders each having 10 segements requires 30+1 pins; Since you are using CY8C20434 device which has just 28 I/Os, you cannot use a 10 segment slider. Either choose a higher pin part device or use a lower segment count sliders - say two 5 segement sliders or one 5 segemnt and one 10 segment slider.

 

2. If you are done with the above, you can now proceed to setting the number of buttons/sliders. In the chip editor view, right click (either in chip editor or workspace explorer) on your CapSense UM and Select CSA wizard ( or CSA_EMC wizard if you are using CSA_EMC)

 

3. In wizard you can simply type the number of buttons you want in the Buttons field and Number of sliders you want in the sliders field (these options are in the Global settings tab) - Enter 10 against buttons and 2 against sliders for your case.

 

4. Now click on Slider S1 in the right side pane - it will get highlighted in red indicating it is selected.

 

5. Now click on the sensor settings tab, in this tab, against the Sensors count field enter the number of segments you want in this slider - say 5 segments. You can select the resolution and Diplex option as well - refer UM datasheet for complete details on these parameters (Right click on the UM and then click on Datasheet)

 

6. Now Follow step 4 & 5 for Slider S2

 

7. Once you are done, you need to assign pins for the sensors. You can do the same by either simply clicking-dragging-dropping the button or slider segment on to a pin in Chip pin assignment view (if you want to assign by chip pin wise) or Table pin assignment view (if you want to go by port pin wise)

 

8. Once you have assigned all the sensors to a pin and selected ExternalCap (P0[3] for CY3280 board) in the Global settings, click Ok to save/close the configuration wizard.

 

9. Now build your project by pressing F6 or Build -> Generate/Build

 

10. Now in the project, in the UpdateI2CBuffer API, you can access CSA_baSnsOnMask[0] and [1] for reading the button status. Note that CSA_baSnsOnMask[0] will have button status of Button 0 to Button 7 (from LSB to MSB) and CSA_baSnsOnMask[1] will have button status of Button 8 to Button 15. Since there are just 10 buttons in our design, the MSB 5 bits of this register is of no use. Accordingly you can modify the code to get the status of that particular button.

 

11. In the same function, where you are calling CSA_wGetCentroidPos(1) - you can call CSA_wGetCentroidPos(2) to read the status of Slider S2. You can do a similar processing for Slider S2 like done for Slider S1 to implement both Slider S1 and S2.

 

12. Remember if you are adding an extra variable to the I2C buffer, define the same in the structure defined in 'main.h'

 

Hope this helps.

If you need let me know, I can post some screenshots for clarity.

 

Regards,

MSUR



Re: capsense

pran posted on 19 Feb 2013 10:44 PM PST
Top Contributor
26 Forum Posts

Hi MSUR,

                Thanks MSUR, your informatin is very helpful for me.  one small question is same code will work on another device (eg. code for CY8C20434-LKXI on CY8C20434-LQXI).

pramod.



Re: capsense

pran posted on 20 Feb 2013 12:31 AM PST
Top Contributor
26 Forum Posts

hi MSUR,

Two errors occurred in project. can you give some solution.

!E <library>(3385): {linker} Cannot allocate space for 96 bytes for 'ram0' area
C:\PROGRA~1\Cypress\PSOCDE~1\5.2\Common\CY3E64~1\tools\make: *** [output/Ten_button_Two_Slider.rom] Error -1

pramod.

 



Re: capsense

pran posted on 20 Feb 2013 01:28 AM PST
Top Contributor
26 Forum Posts


Hi  MSUR,

Why resource meter window appears black. I attach Screen shot. With reference to aove error.

pramod



Re: capsense

pran posted on 21 Feb 2013 08:06 PM PST
Top Contributor
26 Forum Posts

Hi

Manage to solve above problems.

Thank You.

Pramod






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20