Re: Connecting buttons with MSP430F2013 for Input Output with software



anmol wrote:
On Jun 9, 11:31 pm, Tauno Voipio <tauno.voi...@xxxxxxxxxxxxx> wrote:
anmol wrote:
Hi!
I want to connect 5 buttons with the MSP430F2013 MCU . I want to use
the buttons for input with a software . Please help and tell me how
to go about the task . If you have any tutorial , curcuit diagrams ,
videos please give the download location or the url of the site .
Regards
Anmol
Study project - homework?

--

Tauno Voipio

It's a project but not a school or college project . Please help me in
connecting the buttons with MCU for input to software .

Thanks
Anmol

Your question just _sounded_ so much like an end-of-year "do my work for me" sort of question...

If you have enough undedicated pins, hook up one switch per pin (view with a fixed-width font):

VCC
+
|
|
.-.
| |
| |
to '-'
processor |
o------------o
|
o |
|-
o |
|
|
===
GND
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

This circuit will read as a '1' on the input pin's bit when the switch is open, and '0' when it is closed. It will also introduce you to the wonderful world of switch bounce, which you can find out about via web searches.

There are a lot of ways to deal with switch bounce in software, but basically you need to read the switch, then _make sure_ that it has finished deciding whether it's a '1' or a '0' before you do anything with it. The best way for your application depends on your application, so I suggest you read up on the many ways to debounce switches before you choose which method to use.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" gives you just what it says.
See details at http://www.wescottdesign.com/actfes/actfes.html
.