Flash Memory Operation
6-17
Flash Memory Controller
6.3.4
Flash Memory Access During Write or Erase
When any write or any erase operation is initiated from RAM and while
BUSY=1, the CPU may not read or write to or from any flash location.
Otherwise, an access violation occurs, ACCVIFG is set, and the result is
unpredictable. Also if a write to flash is attempted with WRT=0, the ACCVIFG
interrupt flag is set, and the flash memory is unaffected.
When a byte/word write or any erase operation is initiated from within flash
memory, the flash controller returns op-code 03FFFh to the CPU at the next
instruction fetch. Op-code 03FFFh is the
JMP PC
instruction. This causes the
CPU to loop until the flash operation is finished. When the operation is finished
and BUSY=0, the flash controller allows the CPU to fetch the proper op-code
and program execution resumes.
The flash access conditions while BUSY=1 are listed in Table 6−5.
Table 6−5. Flash Access While BUSY = 1
Flash
Operation
Flash
Access
WAIT
Result
Read
0
ACCVIFG = 0. 03FFFh is the value read
Any erase, or
B
/
d
i
Write
0
ACCVIFG = 1. Write is ignored
y
Byte/word write
Instruction
fetch
0
ACCVIFG = 0. CPU fetches 03FFFh. This
is the
JMP PC
instruction.
Any
0
ACCVIFG = 1, LOCK = 1
Read
1
ACCVIFG = 0, 03FFFh is the value read
Block write
Write
1
ACCVIFG = 0, Flash is written
Instruction
fetch
1
ACCVIFG = 1, LOCK = 1
Interrupts are automatically disabled during any flash operation on F47x
devices when EEI = 0 and EEIEX = 0 and on all other devices where EEI and
EEIEX are not present. After the flash operation has completed, interrupts are
automatically re-enabled. Any interrupt that occurred during the operation will
have its associated flag set and will generate an interrupt request when
re-enabled.
On F47x devices when EEIEX = 1 and GIE = 1, an interrupt will immediately
abort any flash operation and the FAIL flag will be set. When EEI = 1, GIE = 1,
and EEIEX = 0, a segment erase will be interrupted by a pending interrupt
every 32 f
FTG
cycles. After servicing the interrupt, the segment erase is
continued for at least 32 f
FTG
cycles or until it is complete. During the servicing
of the interrupt, the BUSY bit remains set, but the flash memory can be
accessed by the CPU without causing an access violation. Nested interrupts
are not supported, since the RETI instruction is decoded to detect the return
from interrupt.
The watchdog timer (in watchdog mode) should be disabled before a flash
erase cycle. A reset will abort the erase and the result will be unpredictable.
After the erase cycle has completed, the watchdog may be re-enabled.
Summary of Contents for MSP430x4xx Family
Page 1: ...MSP430x4xx Family 2007 Mixed Signal Products User s Guide SLAU056G ...
Page 2: ......
Page 6: ...vi ...
Page 114: ...3 76 RISC 16 Bit CPU ...
Page 304: ...5 20 FLL Clock Module ...
Page 340: ...7 8 Supply Voltage Supervisor ...
Page 348: ...8 8 16 Bit Hardware Multiplier ...
Page 372: ...9 24 32 Bit Hardware Multiplier ...
Page 400: ...10 28 DMA Controller ...
Page 428: ...13 10 Basic Timer1 ...
Page 466: ...15 24 Timer_A ...
Page 522: ...17 30 USART Peripheral Interface UART Mode ...
Page 544: ...18 22 USART Peripheral Interface SPI Mode ...
Page 672: ...23 12 Comparator_A ...
Page 692: ...24 20 LCD Controller ...
Page 746: ...26 28 ADC12 ...