LM3S328-IRN20-A0T Luminary Micro, Inc., LM3S328-IRN20-A0T Datasheet - Page 99

no-image

LM3S328-IRN20-A0T

Manufacturer Part Number
LM3S328-IRN20-A0T
Description
Microcontroller
Manufacturer
Luminary Micro, Inc.
Datasheet
7.3.2
7.4
April 27, 2007
Flash Programming
The Stellaris devices provide a user-friendly interface for flash programming. All erase/program
operations are handled via three registers: FMA, FMD and FMC.
The flash is programmed using the following sequence:
1.
2.
3.
4.
To perform an erase of a 1-KB page:
1.
2.
3.
To perform a mass erase of the flash:
1.
2.
Register Map
Table 7-2 lists the Flash memory and control registers. The offset listed is a hexadecimal
increment to the register’s address, relative to the Flash control base address of 0x400FD000,
Write source data to the FMD register.
Write the target address to the FMA register.
Write the flash write key and the WRITE bit (a value of 0xA4420001) to the FMC register.
Poll the FMC register until the WRITE bit is cleared.
Write the page address to the FMA register.
Write the flash write key and the ERASE bit (a value of 0xA4420002) to the FMC register.
Poll the FMC register until the ERASE bit is cleared.
Write the flash write key and the MERASE bit (a value of 0xA4420004) to the FMC register.
Poll the FMC register until the MERASE bit is cleared.
}
//
// Clear the DBG field of the FMPRE register. Note that the value
// used in this instance does not affect the state of the BlockN
// bits, but were the value different, all bits in the FMPRE are
// affected by this function!
//
HWREG(FLASH_FMPRE) &= 0x3fffffff;
//
// The following sequence activates the one-time
// programming of the FMPRE register.
//
HWREG(FLASH_FMA) = 0x900;
HWREG(FLASH_FMC) = (FLASH_FMC_WRKEY | FLASH_FMC_COMT);
//
// Wait until the operation is complete.
//
while (HWREG(FLASH_FMC) & FLASH_FMC_COMT)
{
}
Preliminary
LM3S328 Data Sheet
99

Related parts for LM3S328-IRN20-A0T