Hi,
Can I reset an Arduino via a reset function call or do I have to do something with the reset pin?
Thanks and kind reagrds,
jB 8)
Hi,
Can I reset an Arduino via a reset function call or do I have to do something with the reset pin?
Thanks and kind reagrds,
jB 8)
Umm.... actually I don't really know at the moment of a reset function, but take a feed from a digital pin to the reset pin and ground it when you need to reset with software, might want to do something with a relay, not sure but you could get a floating pin and it could reset your board without warning
britesc:
Can I reset an Arduino via a reset function call or do I have to do something with the reset pin?
Why do you want to do this?
*** Congratulations! You are the 100th person to pose this question! ***
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1273155873
Maybe Not then!
The watchdog is the way to go.
Do you think that guy was a bit angry?
You can very simply restart your sketch (without running the bootloader) with a simple:
asm("GOTO 0");
It won't "reset" the chip, so it will remain in the same state it was before - things won't return to their default state, but it's close enough for most uses.
Humph!!!
I take it I am surrounded by scoundrels & cynics.
I asked as the boards have a reset pin and wondered if I had to use the pin with my own function or whether there was a function or whther someone had already done this.
As to why, I am explorering the capabilities of Arduino before I get into heacy coding.
I want to be able to change ethernet details, IP, GW etc via a web page. The details are held in EEPROM and I assumed as with many devices to get the new ethernet setup working I would have to reset, clearing any program buffers etc. If all I need to do is change IP, DNS, GW etc from a rer-read of the EEPROM then the necessatity for a reset pales at the moment.
Additionally how retentive of memory is an Arduino does it Garbage Collect, does it always release memory when a function has finished, do I need to add delete's in to my destructors?
kind regards,
jB 8)
britesc:
Humph!!!I take it I am surrounded by scoundrels & cynics.
Not really sure what you just said?
I take it I am surrounded by scoundrels & cynics.
I feel like that about my family sometimes too.
AWOL:
I take it I am surrounded by scoundrels & cynics.
I feel like that about my family sometimes too.
Yours too?! I thought it was just mine...
reset pin and wondered if I had to use the pin with my own function or whether there was a function or whther someone had already done this.
There is nothing your software can do with the reset pin unless you add external hardware.
Rob
Hi,
Thanks for the great responses.
Kind regards,
jB 8)
britesc:
I assumed as with many devices to get the new ethernet setup working I would have to reset, clearing any program buffers etc.
Don't assume. And it is better to state the real requirement.
Instead of:
Can I reset an Arduino via a reset function call or do I have to do something with the reset pin?
You could have asked:
How do I change ethernet details, IP, GW etc via a web page?
Here is a sample sketch that shows how to do a real hardware reset of the AVR chip in software.
It is pretty simple.
Note that there are many older Arduino bootloaders out there that don't properly set up
the WDT registers and look at the WDT status bits to allow this work properly.
--- bill
resetArduino.pde.zip (810 Bytes)
Thank you.
jB
Additionally how retentive of memory is an Arduino does it Garbage Collect, does it always release memory when a function has finished, do I need to add delete's in to my destructors?
C++ does not have garbage collection. Garbage collection only occurs in garbage languages. Learn to delete memory when you are done with it, and you don't need a garbage collector to do your job.