Part Number: MSP430FR4133
In line with implementing a workaround for PMM32 errata, I wanted to know
how much current my MSP430FR4133 draws in AM at 16 MHz when spinning in an
endless loop w/o any interrupts or other "disturbances".
So I removed the "eint" which normally comes after the initialisation part and
before the main loop and checked the current. It was 1.15 mA which seems to be
OK for an FR4133 at 16 MHz in AM running entirely from the cache. Then I
changed some minor stuff in my initialisation code which does not have any
influence on the current consumption. But suddenly the supply current jumped
to 1.35 mA.
After a bit of searching it turned out that the current drawn depends on where
the main loop is running (it actually got moved around a bit while adding or
removing code in the initialisation part). The main loop is simply
forever: jmp forever
If it is located 2 bytes before a modulo 8 address (0x???6 oder 0x???E) it
consumes 1.35 mA. On every other address we'll have 1.15 mA. That means, if
we assume the following (gas) code
.balignw 8, 0x4303
nop
nop
nop
forever: jmp forever
it will draw 1.35 mA. When removing any number of nops, we get 1.15 mA.
First thing that jumps into mind is that the jmp sits on the last word of a
cache line and the prefetcher fetches the next 4 words from FRAM. But as we
have a 2-way set-associative cache with 4 lines of 64 bits each, it should be
possible to cache two consecutive, 8-byte-aligned memory blocks with 8 bytes
of size each.
To make things more funny: The code
.balignw 8, 0x4303
nop
nop
nop
forever: jmp forever
.word 0x0000
consumes 1.36 mA. But this one
.balignw 8, 0x4303
nop
nop
nop
forever: jmp forever
.word 0xFFFF
only 1.28. And last but not least:
.balignw 8, 0x4303
nop
nop
nop
forever: jmp forever1
forever1: jmp forever
uses 1.24 mA (irrespective of what comes after).
Any explanations?
