This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F6779: power consumption when executing code from RAM instead of Flash

Part Number: MSP430F6779

On page 28 of the MSP430F6779 datasheet. It shows the power consumption difference of executing from Flash Vs RAM. See table 5.4 below. RAM Icc  is about 1/2 of Flasf Icc

If we load some code that is used often from Flash into ram on power up, and then execute this section of code from RAM,  Should we expect a reduction in power consumption.?

Theoretically if we executer  code 100 % from Ram we would expect power consumption to be ½ that of Flash.

Correct?

Thank you

joe

  • Hi Joe,

    Actually I don't think so. The current will drop so much.

    1. I think your device will enter LPM mode. If the time is so long. You can not find it will do much help to your power consumption. You can calculate the help use the picture shown as bellow.

    2. MSP430F6779 have a very small RAM, you can't put a large code into the RAM. Normally, people putting code into RAM is for high speed code running. 

    3. If you meet the power consumption problem, I would advise you full use the low power mode and change your code strategy to make the active time smaller.

    Eason

  • Hi Eason,

    Thanks for the reply here!

    Following up to point 1 in your response, are you saying that the code in RAM will execute quickly and the device would then enter Static Power/Power-Down mode so any current savings would be minimal over time?

    What if the device was always in Active Mode and running? If Joe was able to execute entirely from RAM would his power consumption assertion be correct?

    Thanks,

    Jacob

  • 1. Yes, it can save some power that the code can be read faster on RAM than flash. However, I am not sure MSP430 flash devices have cache. It can help improve the speed when the code load from flash. 

    2. What do you mean with power consumption assertion? I think you need to consider the power module and peripheral's power consumption into consideration. 

  • Hi Eason,

    Thanks for the follow up. For item (1), thanks for the confirmation. Understood now that, if you execute the code more quickly via RAM, it would allow you to quickly get to a static power state.

    However, I believe that then ties into the (2) power consumption point. 

    In the application being considered here, I don't believe that the "Static Power" mode will ever be used. For the intended application and the "power consumption assertion" comment, we're looking at the device always operating in the "Active Mode".

    If we always operate in the circled regions below (no power down/low power mode), would the assertion that 

    executer  code 100 % from Ram we would expect power consumption to be ½ that of Flash.

    then be correct?

  • I assume it will be a little higher than 1/2. You also need to consider the peripheral power consumption.

  • Hi, Eason,

    thanks for the answers. 

    Earlier you  also wrote:. Yes, it can save some power that the code can be read faster on RAM than flash. However, I am not sure MSP430 flash devices have cache. It can help improve the speed when the code load from flash

    Please clarify the following:

    1) Is it faster to to run code from RAM than Flash?

    1) What is the difference in speed or timing between RAM and Flash.?

    Thanks

    Joe

  • 1) Yes. It will be faster to run code from RAM than flash. About the cache influence, I don't know too much details that how it will help. I would advise you to make a test.

    2) Here is the clock frequency for flash controller. For RAM, I assume it can be up to the MAX speed of clock(25MHz).

  • Hi,

    1) Are you saying that the Flash access speed is at 1 mhz?  and RAM may be up to 25mhz?

    2) You mentioned Cache. I don’t see any indication in the datasheet  that the MSP430 has or uses cache.

    Joe

  • Hi Joe,

    1. Sorry, I think I have make a wrong answer to the RAM and flash read, please refer to this one:

    https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1084889/msp430f6779-ram-v-flash-access-speeds?tisearch=e2e-sitesearch&keymatch=MSP430%20flash%20speed#

    2. I also check with our colleague, the speed in the datasheet doesn't mean the flash clock. As I know, for the current TI flash MCU, it can support up to 24MHz flash clock speed. I may guess the flash in MSP430 may also can reach the max CPU speed. 

    Eason

**Attention** This is a public forum