Pages: [1]   Go Down
Author Topic: Software reseting arduino  (Read 1002 times)
0 Members and 1 Guest are viewing this topic.
Am Indian
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Am an Indian with the Italian product
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there any way to software reseting the arduino with one command??
(other than the switch)????????????? :-/
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 614
Posts: 49363
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are a number of ways this could be accomplished, but none are software only. If you explain why you need to do this, an appropriate solution might be proposed.
Logged

UK
Offline Offline
Faraday Member
**
Karma: 17
Posts: 2884
Gorm deficient
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Watchdog?
Logged

Per Arduino ad Astra

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13718
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
void(* resetFunc) (void) = 0; //declare reset function @ address 0

void setup(void)
{
  Serial.begin(9600);
  Serial.println("Start");
}

void loop(void)
{
  delay(2000);  // to simulate something useful :)
  resetFunc();
}
[don't know the source] The function starts to execute at addres 0 . This seems to be the address where an Arduino starts when it is started. It also resets my "hanging" ethernetshield. It works on my 328 and I hope to test it on an UNO this week. I don't have a mega at hand.

Rob
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26297
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The function starts to execute at addres 0
But it is not (as has been said many, many times before) a processor reset.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13718
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

found older thread, same question. new insight
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1222941939/all  ==>  http://support.atmel.no/bin/customer?=&action=viewKbEntry&id=21

Seems I have to rewrite a few sketches this evening smiley
Rob

update: the example at the support site seems to reset the arduino every 30 ms!. Read the forum thread carefully as it may have unwanted side effects.
« Last Edit: November 03, 2010, 01:58:42 pm by robtillaart » Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

0
Offline Offline
Faraday Member
**
Karma: 23
Posts: 3482
20 LEDs are enough
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The WDT is the best way without external hardware. However it is not exactly the same as a real reset. You can determine the difference.

Udo
Logged

Check out my experiments http://blog.blinkenlight.net

Am Indian
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Am an Indian with the Italian product
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

o thnks for the reply...

am trying to gav a password protection to my DTMF controlled robot..
i wnt to start the program from the begining in case if the call is disconnected without stopping the motor by pressing stop key in the mobile...

any way thnx...nw am using goto statement...
Logged

0
Offline Offline
Faraday Member
**
Karma: 23
Posts: 3482
20 LEDs are enough
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you are building a robot you may want to think about watchdog in general. I find the following article very helpful
http://www.eetimes.com/discussion/break-point/4024509/Li-l-Bow-Wow.

Udo
Logged

Check out my experiments http://blog.blinkenlight.net

Pages: [1]   Go Up
Jump to: