Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 3 > Weird button problem

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



Weird button problem
Moderator:
RKRM

Post Reply
Follow this topic



Weird button problem

ImperfectSeven posted on 18 Jun 2012 12:58 PM PST
Top Contributor
77 Forum Posts

Back again, this time I am having a problem with the buttons that are on the CY8CKIT-030 development board.

The data sheet says that the push buttons are connected to P6[1] and to P15[5], however if I take digital input pins and assign them to the buttons then output that to some LEDs I don't get any light in the LEDs regardless of how long I hold the button down.

I also tried with the capsense buttons and they will turn the LEDs on but it is a strange behavior. Actually hitting the buttons themselves (P5[6] and P5[5]) does not result in the LEDs coming on, however if I swipe across the button and hold my finger on the capsense bar then the light will stay on until i remove my finger.

I don't think this is the correct behavior for either of the buttons, all I want right now is that the LED turns on when I press the corresponding button. I'm not sure what all I can check to troubleshoot this.




Re: Weird button problem

zeta posted on 18 Jun 2012 04:28 PM PST
Top Contributor
174 Forum Posts

First make sure your board works properly. The cy8ckit-030 come with a preprogrammed selft test firmware that allows you to find out if everything is working. It tests all buttons, LEDs and capsense buttons. if you still have the hex you can burn it and see if your board is working properly.



Re: Weird button problem

hli posted on 19 Jun 2012 01:24 AM PST
Top Contributor
675 Forum Posts

You cannot directly connect the CapSense inputs to your logic, You need to use the CapSense component. Unfortunately it doesn't allow to connect it directly to the logic, you need to handle it in code. There are code samples for the -030 kit (see chapter 5.4 in the user guide).

Regarding the problem with the buttons: can you post your project here? From your description I don't see any reason it shouldn't work.



Re: Weird button problem

ImperfectSeven posted on 19 Jun 2012 06:13 AM PST
Top Contributor
77 Forum Posts

Well I couldn't get it working as before, but I ended up connecting the buttons to a status register and then using some debounce code to get the change the value of some variables. I'm still not sure why I can't wire the button directly to an LED and have it work as such.

As far as the Cap Sense I did find the blocks for it a little after my first post, but my goal was not focused on those so I left them alone. I only used them because I thought the other switches might be damaged.

As far as the self test, everything checks out ok. If you would like I can still upload my poject.



Re: Weird button problem

hli posted on 20 Jun 2012 02:44 PM PST
Top Contributor
675 Forum Posts

OK, I did some experiments. I got it working only with the proper configuration of the input pin:

  • Type: digital input
  • General: resistive pullup enabled (the button inputs have no resistor)
  • Input: input buffer enabled (but not synchronized)


Re: Weird button problem

ImperfectSeven posted on 20 Jun 2012 02:53 PM PST
Top Contributor
77 Forum Posts

Thanks Hli that works wonderfully






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