Where MSP430 code, data and peripherals actually live, and the rules that govern that space. Dónde viven realmente el código, los datos y los periféricos del MSP430, y las reglas de ese espacio.
Santi Scagliusi, PhD
dato: .word 0x1234 mov.w &dato, R4 ; R4 = 0x1234 mov.b &dato, R5 ; R5 = ? mov.b &dato+1, R6 ; R6 = ?
What will R5 hold?¿Qué valor tendrá R5?
0x12 or 0x34? Commit before you run it.¿0x12 o 0x34? Decide antes de ejecutar.
The real question is the lifetime of the data, not which memory is best. La pregunta real es cuánto debe vivir el dato, no qué memoria es mejor.
Write the target cell directly.Escribe la celda objetivo directo.
The whole sector erases first.Primero se borra el sector entero.
~1015 writes · byte-addressable ~1015 escrituras · direccionable por byte
Non-volatile: survives power loss.No volátil: sobrevive sin energía.
Volatile: fast, lost without power.Volátil: rápida, se pierde sin energía.
Same instructions for everything. The cost: fetch and data share one bus. Las mismas instrucciones para todo. El coste: fetch y datos comparten un bus.
The same MOV that touches RAM can change a real pin.El mismo MOV que toca la RAM puede cambiar un pin real.
Set the direction register first. Writing P1OUT only lights the LED once the pin is an output.Primero fija el registro de dirección. Escribir P1OUT solo enciende el LED cuando el pin ya es salida.
bis.b #BIT0, &P1DIR ; salida bis.b #BIT0, &P1OUT ; LED encendido bic.b #BIT0, &0x0202 ; sin nombre mov.b &0x0202, R5 ; R5 = ?
Does the LED turn off?¿Se apaga el LED?
0x0202 has no name. Does the CPU care?0x0202 no tiene nombre. ¿Le importa a la CPU?
.word 0x1234
.word 0x1234 at 0x1C00 splits into two bytes, low byte first..word 0x1234 en 0x1C00 se parte en dos bytes, primero el bajo.
It matters when bytes leave the chip: agree the order. Importa cuando los bytes salen del chip: recuerda pactar el orden.
20-bit address space: 128 KB of FRAM goes past 0xFFFF.Espacio de 20 bits: los 128 KB de FRAM pasan de 0xFFFF.
On power-up the CPU reads here to find where the program begins.Al encender, la CPU lee aquí para saber dónde empieza el programa.
Main FRAM: your program and constants.FRAM principal: tu programa y tus constantes.
Variables, buffers and the stack, in the 2 KB up to 0x23FF.Variables, buffers y la pila, en los 2 KB hasta 0x23FF.
tabla: .word 10, 20, 30, 40 ; FRAM .bss copia, 8 ; RAM bucle: mov.w @R4+, R8 mov.w R8, 0(R7) add.w R8, R6 incd.w R7 dec.w R5 jnz bucle ; R6 = ?
Where does each label land?¿Dónde cae cada etiqueta?
0x4400 or 0x1C00? And R6 at the end?¿0x4400 o 0x1C00? ¿Y R6 al final?
Persistent code and constants in FRAM, fast-changing state in SRAM.Código y constantes persistentes en FRAM, estado cambiante en SRAM.
Von Neumann. The same MOV reaches RAM or a real peripheral pin.Von Neumann. El mismo MOV llega a la RAM o a un pin real.
A word splits into bytes; the value never changes, only the order.Una palabra se parte en bytes; el valor no cambia, solo el orden.