4 Replies Latest reply on Jun 19, 2012 8:13 AM by glenn.yeager

    Weird button problem

    glenn.yeager

      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.

        • 1. Re: Weird button problem
          norman.chahuares.collantes

          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.

          • 2. Re: Weird button problem
            user_78878863

            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.

            • 3. Re: Weird button problem
              glenn.yeager

              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.

              • 4. Re: Weird button problem
                user_78878863

                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)
                •    
                • 5. Re: Weird button problem
                  glenn.yeager

                  Thanks Hli that works wonderfully