Go Down

Topic: How to reset Arduino UNO without pushing reset button? (Read 2 times) previous topic - next topic

retrolefty



Just be sure your arduino board is one that has a WDT friendly bootloader such as the current UNO, as older and current mega boards for example will 'brick' with short WDT interrupts, requiring you to reburn the bootloader to recover.


Lefty


So how to software reboot MEGA then?


Use external hardware components (555 pulse generator for example) to generate a reset pulse wired to the avr reset pin.

Or find a upgraded bootloader hex file that does handle WDT correctly for the mega board and burn that into the chip before using the WDT generated reset method.

Lefty

draythomp

#11
Jan 29, 2013, 04:16 pm Last Edit: Jan 29, 2013, 04:27 pm by draythomp Reason: 1
Quote
So how to software reboot MEGA then?


Depending on exactly what you want to do, use a call to location zero as in:

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

Or, if you want something more watchdog 'timerish', use the code I worked out to do this.  I wanted to simulate a watchdog and not use up any of the other timers.  It's at: http://www.desert-home.com/2011/10/2560-board-is-not-so-stupid-anymore.html
Trying to keep my house under control http://www.desert-home.com/

liudr

Lefty,

By upgraded bootloader are you referring to optiboot developed by westfw?

liudr


Quote
So how to software reboot MEGA then?


Depending on exactly what you want to do, use a call to location zero as in:

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

Or, if you want something more watchdog 'timerish', use the code I worked out to do this.  I wanted to simulate a watchdog and not use up any of the other timers.  It's at: http://www.desert-home.com/2011/10/2560-board-is-not-so-stupid-anymore.html


Thanks. I know of the location zero but also vaguely remember people mentioning that just the execution is reset and other things aren't. Could you give me some hint on what does and doesn't reset by calling zero?

BTW, your home page temperature scale is in DegF, right? Does it every go near 150F as the max scale is set there? Horrible heat.

retrolefty

#14
Jan 29, 2013, 05:40 pm Last Edit: Jan 29, 2013, 05:42 pm by retrolefty Reason: 1

Lefty,

By upgraded bootloader are you referring to optiboot developed by westfw?


Depends on the type of mega board you are talking about. There is a optiboot avalible for the mega1280 board but westfw already stated the optiboot will never work with a mega2560 board. However there is a upgraded/fixed mega2560 bootloader avalible that works with the WDT correctly, but at the moment I can't steer you to it's location as I don't own a mega2560 board I never bothered to download a fixed bootloader for it.
If you do want or need a mega1280 optiboot.hex file I would be glad to post it here for you?

PS: A simple jump to 0 to restart a sketch doesn't place any of the AVR hardware registers to their true default reset condition, which may or may not to a big deal, so is rarely recommended as a reliable method to use.

Lefty

Go Up