Arduino Software Reset

Hello everyone,

I would like to know what the command bellow does, and mainly if it's safe to use it.

asm volatile("rjmp 3584\n\t");

Where 3584=$0E00 (bootloader address)

It's supose to be equivalent to a hardware reset (reset button), that was what I'm looking for. But before I test it up, I would like some opnions about it, since I don't have any clue about what it really does.

Before anyone says about the other ways of doing it, I already tried it (watch dog, digital pin to ground, asm volatile ("jmp 0"), etc.) , but none actually did what I expect to do, a real hardware reset without the risk of damaging the board.

Thanks.

Check Section 37 of the datasheet, the Instruction Set Summary.

I would have though JMP 0xE000 vs RJMP.

CrossRoads:
Check Section 37 of the datasheet, the Instruction Set Summary.

I would have though JMP 0xE000 vs RJMP.

Thanks CrossRoads, it seens to work, but my doubt persists, is it really a "hardware reset"?
By that I mean, does it reset the hardware peripherals into their default condition, simulating a reset button press?

No. For that you need to bring the external reset line low.
Add a 555 timer set up as a 1-shot to pulse the line low.

You can also use a Watchdog timer to do a reset.

void software_Reboot()
{
wdt_enable(WDTO_15MS);
while(1) {}
}

then whenever you want to start a reset, call software_Reboot(), which will happen in 15 ms. Another way to achieve this: GitHub - WickedDevice/SoftReset: Software Reset Library for Arduino

More sources of info: http://playground.arduino.cc/Main/ArduinoReset