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: Assembly code to reset processor
PostPosted: Thu Feb 25, 2010 6:10 pm 
Offline

Joined: Fri Jul 04, 2008 4:13 pm
Posts: 5
Location: Canada
Hi;

I'm just getting started with assembly programming for the SAM7S256. I'm wondering how I write a value to a specific "built in" register? For example, let's say I want to reset the processor. I know that I need to put together a 32 bit value with the reset key and the PROCRST flag (0xA5000001), but how to I load this value into the RSTC_CR register? I.e., what is the syntax to address that built in register?

FYI, I'm using IAR EWARM. Do I need to use the ioat91sam7s256.h file they provide?

Thanks!


Top
 Profile  
 
 Post subject: Re: Assembly code to reset processor
PostPosted: Thu Feb 25, 2010 6:56 pm 
Offline

Joined: Thu Feb 22, 2007 12:45 pm
Posts: 12
Location: waterlooville, UK
Hi,

Some programmers like to use the supplied header files as they save doing them all yourself but they do tend to have more than you need but you can always cut them down if you really want to.

// constant equate
rsmc = 0xFFFFFD00 ; rst manager control

// little bit of code, bit3 also set here to
// produce an external reset
ldr r4, =rsmc ; reset manage
ldr r3, =0xA5000001 ; enable reset bit
str r3, [r4, #0x08] ;


Top
 Profile  
 
 Post subject: Re: Assembly code to reset processor
PostPosted: Thu Feb 25, 2010 7:29 pm 
Offline

Joined: Fri Jul 04, 2008 4:13 pm
Posts: 5
Location: Canada
Ah, it was the [r4, #0x08] part that I was missing.

Thank you kindly!

Derrick


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