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: How to make the AT91R40008 Sleep
PostPosted: Tue Feb 15, 2005 2:36 am 
Offline

Joined: Tue Feb 15, 2005 2:32 am
Posts: 3
I'm trying to understand how to put this chip to sleep to lower power consumption. Should I just turn off all of the periperal clocks? If so, in what ways can you wake the chip up again? Ideally, I'd like to put it to sleep and have it wake up if one of several keys is pressed or if an rs232 command comes in. Is that possible?

David Lawson


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 16, 2005 6:49 pm 
Offline
User avatar

Joined: Fri Feb 13, 2004 7:53 pm
Posts: 329
Hi David,

yes that's possible.

To do that, you have use the IDLE mode of the processor (core clock stopped) also to save more power than just only stopping all of the periperal clocks. To wake up the core, only an enabled IRQ at AIC level can do that ( the AIC is always clocked). So, you will have to turn off all of the periperal clocks that you do not need, and keep the PIO controller clocked with an input change interrupt enabled at PIO level, so that when you press a key of the keyboard, the PIO will detect it and will send an IRQ to the core which will wake it up. You can do the same with the USART. Keep it running, waiting a char with IRQ enabled on RX receive.

Hope this helps.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 16, 2005 8:53 pm 
Offline

Joined: Tue Feb 15, 2005 2:32 am
Posts: 3
I think that I figured out most of what you said. I wrote the following function to power down and it seems to work. I only leave usart0 clocked. Does this
look like the correct way to do it?

Also, does the usart being clocked require more power than the pio? If so, I'll use the pio when I get around to adding a switch.

David

--------------------------------------------------------------

void powerdown(void) {
unsigned long ps_pcsr;

// turn off the led's on the eb40a
PIO_SODR = LED1 | LED2 | LED3 | LED4 | LED5 | LED6 | LED7 | LED8;

ps_pcsr = PS_PCSR; // save the state for powering up
PS_PCDR = 0xfffffffb; // disable all peripheral except us0
PS_CR = 1; // turn off the cpu

//------------------------------------------------------------------------
// everything is off except usart 0. If serial interrupt happens it will
// turn back on the cpu and the interrupt will run and then return to
// here.
//------------------------------------------------------------------------

// power back up, restore the power saving registers

PS_PCER = ps_pcsr;

return;
}


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