SLAU320AJ July 2010 – May 2021
In addition to the TCLK signal at a frequency of 350 kHz ±100 kHz (used for the flash timing generator, see data sheet parameter fFTG), two more data sheet parameters must be taken into account when using the described method to perform a mass or main memory erase. The first is tCMErase (cumulative mass erase time) and the second is tMass Erase (mass erase time). Two different specification combinations of these parameters are currently implemented in dedicated MSP430 devices. Table 2-10 shows an overview of the parameters (assuming a maximum TCLK frequency of 450 KHz).
Implementation | tCMErase | tMass Erase | Mass Erase Duration Generated by the Flash Timing Generator |
---|---|---|---|
1 | 200 ms | 5300 × tFTG | 11.1 ms |
2 | 20 ms | 10600 × tFTG | 20 ms |
For implementation 1, to assure the recommended 200-ms erase time to safely erase the flash memory space, 5300 TCLK cycles are transmitted to the target MSP430 device and repeated 19 times. With implementation 2, the following sequence needs to be performed only once.
MSP430F2xx devices have four information memory segments of 64 bytes each. Segment INFOA (see the MSP430F2xx Family User's Guide for more information) is a lockable flash information segment and contains important calibration data for the MSP430F2xx clock system (DCO) unique to the given device programmed at production test. The remaining three information memory segments (INFOB, INFOC, and INFOD) cannot be erased by a mass erase operation as long as INFOA is locked. INFOB, INFOC, and INFOD can be erased segment by segment, independent of the lock setting for INFOA. Unlocking INFOA allows performing the mass erase operation.
Switch CPU to stopped state (HaltCPU) | Perform once or Repeat 19 times(3) | ||
ClrTCLK | |||
IR_SHIFT("IR_CNTRL_SIG_16BIT") | |||
DR_SHIFT16(0x2408) | : set RW to write | ||
IR_SHIFT("IR_ADDR_16BIT") | |||
DR_SHIFT16(0x0128)
(1) | : FCTL1 address | ||
IR_SHIFT("IR_DATA_TO_ADDR") | |||
DR_SHIFT16(0xA506) | : Enable FLASH mass erase | ||
SetTCLK | |||
ClrTCLK | |||
IR_SHIFT("IR_ADDR_16BIT") | |||
DR_SHIFT16(0x012A)
(1) | : FCTL2 address | ||
IR_SHIFT("IR_DATA_TO_ADDR") | |||
DR_SHIFT16(0xA540) | : Source is MCLK and divider is 0 | ||
SetTCLK | |||
ClrTCLK | |||
IR_SHIFT("IR_ADDR_16BIT") | |||
DR_SHIFT16(0x012C)
(1) | : FCTL3 address | ||
IR_SHIFT("IR_DATA_TO_ADDR") | |||
DR_SHIFT16(0xA500)
(4) | : Clear FCTL3 register | Perform once or Repeat 19 times(3) | |
SetTCLK | |||
ClrTCLK | |||
IR_SHIFT("IR_ADDR_16BIT") | |||
DR_SHIFT16("EraseAddr")
(1) |
: Set address for erase
(2) | ||
IR_SHIFT("IR_DATA_TO_ADDR") | |||
DR_SHIFT16(0x55AA) | : Write dummy data for erase start | ||
SetTCLK | |||
ClrTCLK | |||
IR_SHIFT("IR_CNTRL_SIG_16BIT") | |||
DR_SHIFT16(0x2409) | : set RW to read | ||
SetTCLK | Perform 10600 or 5300 times(3) | ||
ClrTCLK | |||
IR_SHIFT("IR_CNTRL_SIG_16BIT") | |||
DR_SHIFT16(0x2408) | : set RW to write | ||
IR_SHIFT("IR_ADDR_16BIT") | |||
DR_SHIFT16(0x0128)
(1) | : FCTL1 address | ||
IR_SHIFT("IR_DATA_TO_ADDR") | |||
DR_SHIFT16(0xA500) | : Disable FLASH erase | ||
SetTCLK | |||
ClrTCLK | |||
IR_SHIFT("IR_ADDR_16BIT") | |||
DR_SHIFT16(0x012C)
(1) | : Point to FCTL3 Address | ||
IR_SHIFT("IR_DATA_TO_ADDR") | |||
DR_SHIFT16(0xA510)
(4) | : Set LOCK bit in FCTL3 | ||
SetTCLK | |||
ReleaseCPU should now be executed, returning the CPU to normal operation. |