How fast can I write to memory on a MSP430?
mov #P1OUT, R10 ; 2 cycles
mov.b #0, @R10 ; 4 cycles
the write needs 4 cycles to execute.
Or 3 cycles for a PUSH with the stack pointer set to the address I want to access, but then another cycle is necessary to fix the stack pointer anyway. Also it's an ugly hack.
4 cycles per write seems like a lot. Is this accurate or am I overlooking something?
Posted Nov 28, 2012, 11:19 PM UTC
34
According to the MSP430x2xx User's Guide (slau144i) and the MSP430x5xx User's Guide (slau208k):
is two cycles to execute.
The second instructions does not appear to be a valid assembler directive. The closest I could find would be:
which would complete in 5 cycles on the x2xx series and 4 cycles on the x5xx series.
You're right, mspgcc actually assembles that as
mov.b #0, 0(R10), but the first 0 is a constant loaded from R3, so I count 4 cycles on a x2xx.