EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Connecting buttons with MSP430F2013 for Input Output with software

Started by anmol June 9, 2008
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
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
On Jun 9, 11:31 pm, Tauno Voipio <tauno.voi...@INVALIDiki.fi> 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
On 10 Jun, 04:24, anmol <anmolan...@gmail.com> wrote:
> On Jun 9, 11:31 pm, Tauno Voipio <tauno.voi...@INVALIDiki.fi> wrote: > > > anmol wrote: > > > Hi! > > > I want to connect 5 buttons with the MSP430F2013 MCU . I want to use > > > the buttons for input =A0with a software . Please help and tell me how=
> > > to go about the task . If you have any tutorial , curcuit diagrams , > > > videos =A0please 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
Everything you need is in the data sheet and the User's Guide. You'll also find plenty of application information on the TI web site. If you are really stuck, try the MSP430 Yahoo group. Leon
anmol wrote:
> On Jun 9, 11:31 pm, Tauno Voipio <tauno.voi...@INVALIDiki.fi> 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
On Jun 10, 10:20 pm, Tim Wescott <t...@seemywebsite.com> wrote:
> anmol wrote: > > On Jun 9, 11:31 pm, Tauno Voipio <tauno.voi...@INVALIDiki.fi> 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/05www.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 Serviceshttp://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 athttp://www.wescottdesign.com/actfes/actfes.html
Sorry Tim if i sounded arrogant but i was trying to sound that . Thanks for the reply and also for correcting me as this one is my first post in any of the groups . Once again thanks for taking out time and writing a reply :)
On Jun 10, 10:20 pm, Tim Wescott <t...@seemywebsite.com> wrote:
> anmol wrote: > > On Jun 9, 11:31 pm, Tauno Voipio <tauno.voi...@INVALIDiki.fi> 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/05www.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 Serviceshttp://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 athttp://www.wescottdesign.com/actfes/actfes.html
Sorry Tim if i sounded arrogant but i was not trying to sound in that manner . Thanks for the reply and also for correcting me as this one is my first post in any of the groups . Once again thanks for taking out time and writing a reply :)
On Mon, 9 Jun 2008 10:59:54 -0700 (PDT), anmol <anmolanand@gmail.com>
wrote:

>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 .
If you can get the EZ430-F2013 ($20 last I checked without a coupon discount), you might already have most of what you'd need not only to write code and program the device but also to wire in your switches as Tim suggested. It plugs into a USB port on your computer and can use the IAR Kickstart IDE and compiler for programming in assembly, c, or c++ or some combination of those. There are some through-holes inside the tiny device and a small open rectangle in the side for bringing out signal wires for your switches and a ground/Vcc that you might take advantage of to get started quickly. The unit includes a small green LED inside the case, as well, that you can use for blinking or some other indicator as you may want. If that device isn't inappropriate for your needs, I can provide a small tutorial set of programs I wrote to get you started using the device, but they do NOT deal with switches. They are written in c and intended to let you learn about controlling the LED in various ways. But they do get you learning about controlling the CPU speed and using the timer. Which may help in its own way. ... Separately, depending on how you intend using switches and what kinds of external components you are willing to include, you can also consider learning about various topologies in wiring up switches. Tim wisely held to the simplest and most independent approach -- a switch and a pull-up resistor -- but there are other methods you can also consider if the number of switches grows and the number of I/O pins available is constrained. The whole subject of switches, push button and otherwise, and microcontrollers is a very interesting one in its own right and a very good one to use in learning about micros, software, and various hardware design approaches for user input via buttons. Debouncing is an very important part, but it's not the only interesting aspect. Enjoy it, fully. Jon
Tim Wescott wrote:
> If you have enough undedicated pins, hook up one switch per pin (view > with a fixed-width font):
[Schematics of pull-up resistor and switch] Just an addition to Tim's post. I don't know about the MSP430F2013 specifically, but many microcontrollers already have the resistor internally on some of the pins. All you need to do is enable it somehow. On AVRs it is done by writing to a port configured as inputs, but I'm sure each manufacturer has some unique, equally wacky way to do it. So before you warm up your solder iron, it might pay to check out the data sheet carefully. -- Pertti
On Wed, 11 Jun 2008 09:39:06 +0300, Pertti Kellom&#4294967295;ki
<pertti.kellomaki@tut.fi> wrote:

>Tim Wescott wrote: >> If you have enough undedicated pins, hook up one switch per pin (view >> with a fixed-width font): >[Schematics of pull-up resistor and switch] > >Just an addition to Tim's post. I don't know about the MSP430F2013 >specifically, but many microcontrollers already have the resistor >internally on some of the pins.
Many do, though the pull-up may be a bit weak.
>All you need to do is enable it somehow. >On AVRs it is done by writing to a port configured as inputs, but I'm >sure each manufacturer has some unique, equally wacky way to do it.
Some even have several ways to enable the same thing, in fact. ;)
>So before you warm up your solder iron, it might pay to check out >the data sheet carefully.
Always good advice! Jon

The 2024 Embedded Online Conference