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  [ 2 posts ] 
Author Message
 Post subject: I wonder a volatile value at the AT91SAM7S256
PostPosted: Tue May 10, 2011 7:02 am 
Offline

Joined: Tue May 10, 2011 6:58 am
Posts: 1
Hi
I am poor at English. I ask to be excused.
I am using the AT91SAM7S256.
I declared the RSTC mode register, with following

#define RSTC_MR *((volatile unsigned int *)(0xFFFFFD08))

and insert 0xA5000000. with following

RSTC_MR = 0xA5000000;

Then, I read the register to confirm whether the value is right. But the register is cleared at 0x0.

Otherwise declared the register, with following

#define RSTC_MR *((unsigned int *)(0xFFFFFD08))

and insert 0xA5000000.

Then I can read.

I wonder why this operation is done.

thanks, regards.


Top
 Profile  
 
 Post subject: Re: I wonder a volatile value at the AT91SAM7S256
PostPosted: Tue May 10, 2011 7:18 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
Without the volatile you see a compiler manifestation of the value you wrote, held over in an ARM register.

The "A5" key does not read back, the point is that you write *with* the key to confirm you are a valid writer, not some random read/write on memory. Otherwise what would be the point of protecting the peripheral register?


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


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:  
cron