Hi All,
I have been working on MSP430F5510 to write data to FLash memory of MSP430F5510. The code is attachec below.
I am running the cpu @ 25MHZ.
Flash write code section is below.
void write_Flash1()
{
P_int = (int*)0xB500;
bGIE = (__get_SR_register() & GIE); //save interrupt status
_disable_interrupts();
LED_on(); _delay_cycles(10000); LED_off();
//Erase the segment befor write
FCTL3 = FWKEY; //Clear the lock bit
FCTL1 = FWKEY + ERASE; //Set the Erase bit
*P_int = 0; //Dummy write, to erase the segment
//Write the data to the segment
FCTL1 = FWKEY + WRT; //Set WRT bit for write operation
*P_int++ = 1234; //Write the block to flash
FCTL1 = FWKEY; //Clear WRT bit
FCTL3 = FWKEY + LOCK; //Set LOCK bit
LED_on(); _delay_cycles(10000); LED_off();
__bis_SR_register(bGIE); //restore interrupt status
_enable_interrupts();
}
1. I have scoped the time taken to write, and it is what troubling me. It took almost 25 milli seconds wite a byte. I might be reading the data sheet wrong, does that take only <100micro seconds to write?.
2.If you look at the screenshot of scope, the first pulse is before setting FCTL3 register. and the second spike is after writing and locking the flash, the pulse duration is different eventough I have the same delay cycles (_delay_cycles(10000);) Can some one point out the issue and help me please.
