Reply
Posts: 113
Registered: ‎12-27-2016
Accepted Solution

Power down unused RAM in all energy modes ?

Does the settings in EMU->RAMPOWERDOWN only take effect when entering EM2/3, or do they take effect immediately in any energy mode ?  In other words, can used RAM be shutdown in any energy mode to conserve power ? Reference manual suggests they they only have an effect in EM2/3.

 

Also, if they settings only take effect when entering EM2/3, then the setup can be done once in initialization, and the settings doesn't need to change immediately before going to sleep, or immediately after waking up. Is that a correct statement ?

 

Thanks.

Posts: 490
Registered: ‎09-18-2015

Re: Power down unused RAM in all energy modes ?

Hi @gahelton1,

 

Don't know off the top of my head, but this seems easy enough to try, and you've proved in previous posts that you aren't afraid of seeing what happens Smiley Happy

 

John

Posts: 490
Registered: ‎09-18-2015

Re: Power down unused RAM in all energy modes ?

Hi @gahelton1

 

Arrghhh, had to try it Smiley Happy

 

Before...

 

before.png

 

After (setting EMU_RAM0CTRL_RAMPOWERDOWN = 0xF)...

 

after.png

 

It works. Note that you'll still complete reads in the RAM address space when accessing the powered down areas; they'll just return 0 instead of valid data. When you power these areas back up again, whatever they previously held, of course, will be gone.

 

John

Posts: 113
Registered: ‎12-27-2016

Re: Power down unused RAM in all energy modes ?

Hi John,

 

Thank you for doing the experiment.

 

So let me get this right. Turning off/on RAM blocks happens immediately, and not when the micro is commanded to sleep/wake - correct ?

 

So this means that the programmer could just turn off the unused RAM blocks at the beginning of the program, and just leave them off. And maybe save a little power in running mode to. Also being careful not to turn off an area used by the stack.

 

Thanks.

Highlighted
Posts: 490
Registered: ‎09-18-2015

Re: Power down unused RAM in all energy modes ?

Hi @gahelton1,

 

So let me get this right. Turning off/on RAM blocks happens immediately, and not when the micro is commanded to sleep/wake - correct ?

 

Well, we might need to check on this.

 

After further thought, it's not clear to me if the effect of EMU_RAM0CTRL_RAMPOWERDOWN in EM0/EM1 as I observed through the debugger is the actual power down of the selected RAM blocks or simply their not being selected when accessed. You might see if you can observe a difference in Energy Profiler.

 

John

Posts: 490
Registered: ‎09-18-2015

Re: Power down unused RAM in all energy modes ?

Hi @gahelton1,

 

I talked about this with one of our designers today.  He stated that the RAMs are not powered down in EM0 or EM1, even when you write a value to EMU_RAM0CTRL_RAMPOWERDOWN.

 

This doesn't explain why the deactivated arrays do not show in the memory map, but they're not being powered down. I'll pass along a more specific explanation when the designer checks into this.

 

John

Posts: 490
Registered: ‎09-18-2015

Re: Power down unused RAM in all energy modes ?

Hi @gahelton1,

 

Two designers have responded to me and explained the mechanism behind EMU_RAM0CTRL_RAMPOWERDOWN.

 

So, I can confirm that in EM0/EM1, the arrays remain powered and do, in fact, remain accessible and retain data.

 

All EMU_RAM0CTRL_RAMPOWERDOWN effectively does in EM0/EM1 is mask off the RAMs. Read and write cycles terminate normally as they would when the RAMs are powered, but reads return 0s and writes have no effect.

 

In fact, when you again make the RAMs "accessible," the contents they held before writing to EMU_RAM0CTRL_RAMPOWERDOWN will still be there, unchanged.

 

John