Pages: [1]   Go Down
Author Topic: Software Reset?  (Read 544 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Forum Administrator
Milano, Italy
Offline Offline
Sr. Member
*****
Karma: 23
Posts: 292
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
const int RSTC_KEY = 0xA5;
RSTC->RSTC_CR = RSTC_CR_KEY(RSTC_KEY) | RSTC_CR_PROCRST | RSTC_CR_PERRST;
while (true);
Logged

C.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, Cmaglie!

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

Pages: [1]   Go Up
Jump to: