Arduino Code for Reset

Hello all;

I have been using a MKR1400 GSM and a MKR1500 NB. I am wondering if there is code or programming direction that someone can point me to so that I can do a remote reset if the device is not operational or if there is code that will force the device to reset every 24 hours or something along that line.

Thank you
Dave

In the search box (top right of website window), type "software reset Arduino". If something needs explaining, c'mon back!

On AVR architectures I use the following function definition

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

It basically declares a 'function' that is at address 0. Because address 0 is the starting address when the processor powers up, it effectively does a soft reset of the processor.

MKR may be different but a similar concept will probably work.

So if the device is not working or operational, how could it accept remote comms to do a reset ?

NVIC_SystemReset();

99.9% you don’t need to restart.
You need to explore your code and wiring to understand WHY it’s locking up.

Or maybe just hung up but will run a reset every day. so many possible issues that might arise and just thinking about options to do a soft reset.

Investigate the watchdog timer that is in every Arduino. It can detect when a processor code has got stuck.

Well perhaps discount the possibility of doing the reset remotely, unless you had independant comms, from the main microcontroller, that could be used to carry out a reset. But then what to do if the independant comms crashes ?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.