Sparkfun embedded tutorial #2. Stuck on getting the RESET

Hi,

Newbie accomplishments so far with 3 sparkfun tutorials, but coming back to tutorial #2, which is at https://www.sparkfun.com/commerce/tutor … ials_id=93.

I am having a hard time getting the RESET switch to work. I use the momentary switch OMRON B3F-1025 or the B3F-1000. My blink led program works fine if I don’t wire the switch. If I do, it does not work at all. (I have checked the wiring many times.) Reading the datasheet of these two switches, I don’t see it indicating connecting pins 1 and 2 to the ground. So, when I don’t connect them to ground, the led blink program works fine, but the switch does nothing when I press it.

I follow the tutorial exactly and there are pictures showing the MEGA8’s RESET pin is connected to the SPI pin. I tested out that whether this connection is there or not, the led blink program does not run when I have pins 1 & 2 of the switch connected to the ground…I don’t know if this is mattered to mention or not, but that’s a clarification I would like to hear of.

Any tips? I would like very much make the switch work.

Thx.

unebonnevie:
Hi,

Newbie accomplishments so far with 3 sparkfun tutorials, but coming back to tutorial #2, which is at https://www.sparkfun.com/commerce/tutor … ials_id=93.

I am having a hard time getting the RESET switch to work. I use the momentary switch OMRON B3F-1025 or the B3F-1000. My blink led program works fine if I don’t wire the switch. If I do, it does not work at all. (I have checked the wiring many times.) Reading the datasheet of these two switches, I don’t see it indicating connecting pins 1 and 2 to the ground.

It won’t. Its a switch after all. It doesn’t particularly care about whats on either side (as long as the voltage and current aren’t too high).

unebonnevie:
So, when I don’t connect them to ground, the led blink program works fine, but the switch does nothing when I press it.

I follow the tutorial exactly and there are pictures showing the MEGA8’s RESET pin is connected to the SPI pin. I tested out that whether this connection is there or not, the led blink program does not run when I have pins 1 & 2 of the switch connected to the ground…I don’t know if this is mattered to mention or not, but that’s a clarification I would like to hear of.

Any tips? I would like very much make the switch work.

Thx.

Are you connecting the right leads on the switch? If you have the switch turned 90degrees, you’ll hold the processor in perpetual reset, which isn’t what you want.

Use a multimeter to probe the RESET pin relative to ground. With the switch pressed, it should read 0V (ground). With the switch open, it should read Vcc (probably near 5V in your case).

That was a good tip…I got it, after reading the fine prints on the pin.

Originally, I thought (from the tutorial) of the below ping configuration for the B3F-1025.

1 3

| |

2 4

NOPE! It’s:

1—2

3—4

The pin below pin 1 is always pin #3 for B3F-1xxxx switches.

So, when pressing down the switch, 1 would make contact to 3.

Yep, had to tilt the switch about 45 degrees on the breadboard and wired as follows:

2

GND----1

4

VCC (5V)—10k ohm----3---------------!RESET pin of the MEGA8

(Not shown: 1 connects to 2 and 3 connects to 4.) Pins 1 and 2 MUST be connected to GND.

When pins 1 and 3 of the switch are connected (by pressing the switch), !RESET gets pulled down dues to zero resistance through the GND, thus, activating reset.