Push Button - Cypress.com Forums http://www.cypress.com/? Re: Push Button http://www.cypress.com/?rID=52041 In the ISR routine, a flag can be set. In the infinite loop of the main( ) function, the flag can be polled. When the flag is set, data is transmitted through UART and flag is reset. This way, data is transmitted only once upon push of the button.

For the data to be transmitted again, the button should be pressed again.

The ISR can be configured to be Rising Edge Triggered.

]]>
Sat, 11 Jun 2011 11:07:35 -0600
Re: Push Button http://www.cypress.com/?rID=52040 Hi Doacn,

 

My suggestion was to use an ISR Component connected to the Button_Pin. The schematic will look something like this.

 

 

 

Assume that the Button is connected to ground when pushed, and is left floating when not pushed. Then for this logic, the drive mode of the pin should be configured as Resistive Pull-Up.

 

]]>
Sat, 11 Jun 2011 10:59:58 -0600
Re: Push Button http://www.cypress.com/?rID=52017 Hello Dasg,

  Do you mean to create a new interrupt component or the interrupt component in UART? More clarification please. Thanks.

P.S. I had done both ways and I still get the same result.

]]>
Fri, 10 Jun 2011 15:02:59 -0600
Re: Push Button http://www.cypress.com/?rID=52015 Awesome! Thanks, I will try both methods and see type of result best suit us. Thanks for your help!!

]]>
Fri, 10 Jun 2011 13:02:05 -0600
Re: Push Button http://www.cypress.com/?rID=51966 Have a look at AN60024 - Switch Debouncer/. This should solve your problem.

]]>
Thu, 09 Jun 2011 02:31:31 -0600
Re: Push Button http://www.cypress.com/?rID=51964 Hi Doacn,

 

SInce you are using the statements in an infinite loop [ for(;;) ], the UART will send the value it reads continuously.

If the value has to be printed via UART only once when the button is pushed, you may use an Interrupt component.

Setting it to Rising edge or Falling edge triggered as per your requirement will enable you to send the value on the required edge. Holding the botton for a longer time will not result in sending of more than one value via UART.

 

This is one way to overcome this issue.

]]>
Thu, 09 Jun 2011 01:57:52 -0600