Texas Instruments MSP430x1xx User Manual page 139

Texas instruments modules and peripherals user's guide
Table of Contents

Advertisement

In byte/word mode, the internally-generated programming voltage is applied
to the complete 64-byte block, each time a byte or word is written, for 32 of the
35 f
subjected to the programming voltage accumulates. The cumulative
programming time, t
programming time is met, the block must be erased before performing any
further writes to any address within the block. See the device-specific
datasheet for specifications.
Initiating a Byte/Word Write from Within Flash Memory
The flow to initiate a byte/word write from flash is shown in Figure 5−8.
Figure 5−8. Initiating a Byte/Word Write from Flash
; Byte/word write from flash. 514 kHz < SMCLK < 952 kHz
; Assumes 0FF1Eh is already erased
; Assumes ACCVIE = NMIIE = OFIE = 0.
cycles. With each byte or word write, the amount of time the block is
FTG
must not be exceeded for any block. If the cumulative
CPT,
Disable all interrupts and watchdog
Setup flash controller
and set WRT=1
Write byte or word
Set WRT=0, LOCK=1,
re-enable interrupts and watchdog
MOV
#WDTPW+WDTHOLD,&WDTCTL
DINT
MOV
#FWKEY+FSSEL1+FN0,&FCTL2 ; SMCLK/2
MOV
#FWKEY,&FCTL3
MOV
#FWKEY+WRT,&FCTL1
MOV
#0123h,&0FF1Eh
MOV
#FWKEY,&FCTL1
MOV
#FWKEY+LOCK,&FCTL3
...
EINT
Flash Memory Operation
; Disable WDT
; Disable interrupts
; Clear LOCK
; Enable write
; 0123h
−> 0FF1Eh
; Done. Clear WRT
; Set LOCK
; Re-enable WDT?
; Enable interrupts
Flash Memory Controller
5-9

Advertisement

Table of Contents
loading

Table of Contents