Flash Memory Operation
6-16
Flash Memory Controller
; Write one block starting at 0F000h.
; Must be executed from RAM, Assumes Flash is already erased.
;
514 kHz < SMCLK < 952 kHz
; Assumes ACCVIE = NMIIE = OFIE = 0.
MOV
#32,R5
; Use as write counter
MOV
#0F000h,R6
; Write pointer
MOV
#WDTPW+WDTHOLD,&WDTCTL
; Disable WDT
L1
BIT
#BUSY,&FCTL3
; Test BUSY
JNZ
L1
; Loop while busy
MOV
#FWKEY+FN0,&FCTL2 ; SMCLK/2
MOV
#FWKEY,&FCTL3
; Clear LOCK
MOV
#FWKEY+WRT,&FCTL1
; Enable block write
L2
MOV
Write_Value,0(R6)
; Write location
L3
BIT
#WAIT,&FCTL3
; Test WAIT
JZ
L3
; Loop while WAIT=0
INCD
R6
; Point to next word
DEC
R5
; Decrement write counter
JNZ
L2
; End of block?
MOV
#FWKEY,&FCTL1
; Clear WRT,BLKWRT
L4
BIT
#BUSY,&FCTL3
; Test BUSY
JNZ
L4
; Loop while busy
MOV
#FWKEY+LOCK,&FCTL3
; Set LOCK
...
; Re-enable WDT if needed
Содержание MSP430x4xx Family
Страница 1: ...MSP430x4xx Family 2007 Mixed Signal Products User s Guide SLAU056G ...
Страница 2: ......
Страница 6: ...vi ...
Страница 114: ...3 76 RISC 16 Bit CPU ...
Страница 304: ...5 20 FLL Clock Module ...
Страница 340: ...7 8 Supply Voltage Supervisor ...
Страница 348: ...8 8 16 Bit Hardware Multiplier ...
Страница 372: ...9 24 32 Bit Hardware Multiplier ...
Страница 400: ...10 28 DMA Controller ...
Страница 428: ...13 10 Basic Timer1 ...
Страница 466: ...15 24 Timer_A ...
Страница 522: ...17 30 USART Peripheral Interface UART Mode ...
Страница 544: ...18 22 USART Peripheral Interface SPI Mode ...
Страница 672: ...23 12 Comparator_A ...
Страница 692: ...24 20 LCD Controller ...
Страница 746: ...26 28 ADC12 ...