Go Down

Topic: Software reseting arduino (Read 1 time) previous topic - next topic

jaz neeraj

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

PaulS

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.

Groove

Per Arduino ad Astra

robtillaart

Code: [Select]

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
Rob Tillaart

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

AWOL

Quote
The function starts to execute at addres 0

But it is not (as has been said many, many times before) a processor reset.
"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.

robtillaart

#5
Nov 03, 2010, 07:47 pm Last Edit: Nov 03, 2010, 07:58 pm by robtillaart Reason: 1
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 :)
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.
Rob Tillaart

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

Udo Klein

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
Check out my experiments http://blog.blinkenlight.net

jaz neeraj

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...

Udo Klein

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
Check out my experiments http://blog.blinkenlight.net

Go Up