Go Down

Topic: Software Reset? (Read 749 times) previous topic - next topic

tms8c8

Is there a way to reset the board from inside the software? This was always a difficulty in the AVR boards but I found a function for the Mega to reset the software. Anything similar exist for the Due?

cmaglie

There is a specific Reset Controller.

here how the Due do "software" autoreset (triggered when the USB Native port is opened/closed at 1200bps):

https://github.com/arduino/Arduino/blob/ide-1.5.x/hardware/arduino/sam/cores/arduino/Reset.cpp#L26

the snippet you need is:

Code: [Select]

const int RSTC_KEY = 0xA5;
RSTC->RSTC_CR = RSTC_CR_KEY(RSTC_KEY) | RSTC_CR_PROCRST | RSTC_CR_PERRST;
while (true);

C.

tms8c8

Thanks, Cmaglie!

I'm learning my way around Wiring and the Arduino boards and IDE but not very quickly.  :smiley-red:

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy