Pages: [1]   Go Down
Author Topic: Using the reset pin on atmega328p  (Read 1041 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 61
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, I have made a scoreboard and once it reaches all the way up to 10 I need a way to reset the game. I am wondering if I can hook up a push button to the reset pin of the micro-controller. Do I need to put any resistor or anything?. I will be using a standalone atmega328p with boot-loader on it for this project. Thanks for any assistance!
Logged

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You should have around a 10k pullup resistor on the pin and have the switch pull the line to ground
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 94
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It sounds like what you want to do could be done without having to reboot the board. That just seems a little harsh. You could use any pin you want as an input and just detect a voltage or logic state change. Like the previous reply said, implement a pull up resistor. There are plenty of code examples to help you with detecting a button press and handling de-bounce (which can also nicely be handled in many cases with a parallel capacitor). Check out the Playground:Input:Mechanical:Switches and Buttons section
What triggers your score to increment?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 61
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the suggestions smiley...Yea I was looking for a easy way out  ]smiley-small I will try to read up on using the digital pin for resetting. Thanks!

I have a sensor photo sensor that is doing the increment.
« Last Edit: January 24, 2012, 10:11:29 am by jat421 » Logged

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1025
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Pulling the reset pin to ground will reset your program. It will work and cause no problems.

Most folks like the more elegant method of having another input that resets your counter to 0 and any other initial conditions that you need to set.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As others have said, you don't need to reset the board - only have a switch input to your sketch that tells you to zero the scores.

Since the Arduino inputs have a built-in pullup resister (software enabled), you can do this just by wiring a switch to pull one of the inputs low - you don't need to wire up external resisters.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I agree with the software version unless you don't mind the 1-2 sec while the bootloader runs
I usually like to have a pyshical pullup resistor, its more robust than the 20-50k internal,
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 61
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

All great suggestions!. Thanks!...Gonna give it a try over the weekend. Thanks again guys for the help!  smiley-lol

Logged

Pages: [1]   Go Up
Jump to: