How fast can I write to memory on a MSP430?

theory
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
TheFrisbeeNinjaTelecommunications•

According to the MSP430x2xx User's Guide (slau144i) and the MSP430x5xx User's Guide (slau208k):

mov #P1OUT, R10;

is two cycles to execute.

The second instructions does not appear to be a valid assembler directive. The closest I could find would be:

mov.b #0, 0(R10)

which would complete in 5 cycles on the x2xx series and 4 cycles on the x5xx series.

3
ondraOP•

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.

1
theatrus•

Yup. Memory access was always a slow point.

The ultra low power Cortex-M3s (EFM32) run circles around the MSP430.

2
ondraOP•

Eh, that sucks.

The AVRs also seem to be able to write quite a bit faster at the same frequency.

I should still be able to do what I want, but the code will need to be a large (and buggy) state machine.

1