Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: ask for "software reset" function about sam9260
PostPosted: Tue Mar 29, 2011 2:36 am 
Offline

Joined: Fri Mar 04, 2011 5:21 am
Posts: 11
i use the following code comply with datasheet,but it is not effect.the board was not reset after these code runing.who can tell me what's wrong?


/// Keywords to write to the reset registers
#define RSTC_KEY_PASSWORD (0xA5 << 24)
void SoftwareReset()
{
AT91C_BASE_RSTC->RSTC_RMR |= RSTC_KEY_PASSWORD;
AT91C_BASE_RSTC->RSTC_RCR = AT91C_RSTC_EXTRST | RSTC_KEY_PASSWORD;
}


Top
 Profile  
 
 Post subject: Re: ask for "software reset" function about sam9260
PostPosted: Tue Mar 29, 2011 3:26 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
You should probably mask RMR so the password doesn't get garbled

// Keywords to write to the reset registers
#define RSTC_KEY_PASSWORD (0xA5 << 24)
#define AT91C_RSTC_KEY (0xFF << 24) // (RSTC) Password

void SoftwareReset()
{
AT91C_BASE_RSTC->RSTC_RMR = (AT91C_BASE_RSTC->RSTC_RMR & ~AT91C_RSTC_KEY) | RSTC_KEY_PASSWORD;
AT91C_BASE_RSTC->RSTC_RCR = AT91C_RSTC_EXTRST | RSTC_KEY_PASSWORD;
}

It's also conceivable that you need to enable user resets

AT91C_BASE_RSTC->RSTC_RMR = (AT91C_BASE_RSTC->RSTC_RMR & ~AT91C_RSTC_KEY) | RSTC_KEY_PASSWORD | AT91C_URSTEN;

or perhaps be using the processor reset as apposed to the external one.

AT91C_BASE_RSTC->RSTC_RCR = AT91C_RSTC_PROCRST | RSTC_KEY_PASSWORD;


Top
 Profile  
 
 Post subject: Re: ask for "software reset" function about sam9260
PostPosted: Tue Mar 29, 2011 4:57 am 
Offline

Joined: Fri Mar 04, 2011 5:21 am
Posts: 11
ok,i already can reset board, but i get the last reset-source is user-reset,not software reset.
i change
AT91C_BASE_RSTC->RSTC_RCR = AT91C_RSTC_EXTRST | RSTC_KEY_PASSWORD;
to
AT91C_BASE_RSTC->RSTC_RCR = AT91C_RSTC_PROCRST | RSTC_KEY_PASSWORD;

after wait 20s time,it can reset,but the reset source is also user-reset,not software reset.
do you know why?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: